26 template <
int dim,
int spacedim>
39 template <
int dim,
int spacedim>
50 if (
tria.get_reference_cells().size() == 0)
67 template <
int dim,
int spacedim>
70 if (tria_change_signal.connected())
71 tria_change_signal.disconnect();
72 if (tria_create_signal.connected())
73 tria_create_signal.disconnect();
78 template <
int dim,
int spacedim>
82 update_flags |= flags;
87 template <
int dim,
int spacedim>
89 std::set<typename Triangulation<dim, spacedim>::active_cell_iterator>> &
97 std::lock_guard<std::mutex> lock(vertex_to_cells_mutex);
105 update_flags &= ~update_vertex_to_cell_map;
107 return vertex_to_cells;
112 template <
int dim,
int spacedim>
113 const std::vector<std::vector<Tensor<1, spacedim>>> &
121 std::lock_guard<std::mutex> lock(vertex_to_cell_centers_mutex);
126 *tria, get_vertex_to_cell_map());
130 update_flags &= ~update_vertex_to_cell_centers_directions;
132 return vertex_to_cell_centers;
137 template <
int dim,
int spacedim>
138 const std::map<unsigned int, Point<spacedim>> &
146 std::lock_guard<std::mutex> lock(used_vertices_mutex);
154 update_flags &= ~update_used_vertices;
156 return used_vertices;
161 template <
int dim,
int spacedim>
170 std::lock_guard<std::mutex> lock(used_vertices_rtree_mutex);
174 const auto &used_vertices = get_used_vertices();
175 std::vector<std::pair<Point<spacedim>,
unsigned int>>
vertices(
176 used_vertices.size());
178 for (
const auto &it : used_vertices)
184 update_flags &= ~update_used_vertices_rtree;
186 return used_vertices_rtree;
191 template <
int dim,
int spacedim>
193 std::pair<BoundingBox<spacedim>,
202 std::lock_guard<std::mutex> lock(cell_bounding_boxes_rtree_mutex);
206 std::vector<std::pair<
210 boxes.reserve(tria->n_active_cells());
211 for (
const auto &cell : tria->active_cell_iterators())
212 boxes.emplace_back(mapping->get_bounding_box(cell), cell);
214 cell_bounding_boxes_rtree =
pack_rtree(boxes);
218 update_flags &= ~update_cell_bounding_boxes_rtree;
220 return cell_bounding_boxes_rtree;
225 template <
int dim,
int spacedim>
227 std::pair<BoundingBox<spacedim>,
236 std::lock_guard<std::mutex> lock(
237 locally_owned_cell_bounding_boxes_rtree_mutex);
241 std::vector<std::pair<
248 boxes.reserve(parallel_tria->n_locally_owned_active_cells());
250 boxes.reserve(tria->n_active_cells());
251 for (
const auto &cell : tria->active_cell_iterators() |
253 boxes.emplace_back(mapping->get_bounding_box(cell), cell);
255 locally_owned_cell_bounding_boxes_rtree =
pack_rtree(boxes);
259 update_flags &= ~update_locally_owned_cell_bounding_boxes_rtree;
261 return locally_owned_cell_bounding_boxes_rtree;
266 template <
int dim,
int spacedim>
275 std::lock_guard<std::mutex> lock(covering_rtree_mutex);
278 covering_rtree.find(
level) == covering_rtree.end())
284 if (
const auto tria_mpi =
289 boxes, tria_mpi->get_communicator());
293 covering_rtree[
level] =
299 update_flags &= ~update_covering_rtree;
302 return covering_rtree[
level];
307 template <
int dim,
int spacedim>
308 const std::vector<std::set<unsigned int>> &
316 std::lock_guard<std::mutex> lock(vertex_to_neighbor_subdomain_mutex);
320 vertex_to_neighbor_subdomain.clear();
321 vertex_to_neighbor_subdomain.resize(tria->n_vertices());
322 for (
const auto &cell : tria->active_cell_iterators())
324 if (cell->is_ghost())
325 for (
const unsigned int v : cell->vertex_indices())
326 vertex_to_neighbor_subdomain[cell->vertex_index(v)].insert(
327 cell->subdomain_id());
331 update_flags &= ~update_vertex_to_neighbor_subdomain;
333 return vertex_to_neighbor_subdomain;
338 template <
int dim,
int spacedim>
339 const std::map<unsigned int, std::set<types::subdomain_id>> &
347 std::lock_guard<std::mutex> lock(vertices_with_ghost_neighbors_mutex);
356 update_flags &= ~update_vertex_with_ghost_neighbors;
362#include "grid_tools_cache.inst"
Abstract base class for mapping classes.
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
std::map< unsigned int, std::set<::types::subdomain_id > > * vertices_with_ghost_neighbors
std::vector< BoundingBox< boost::geometry::dimension< typename Rtree::indexable_type >::value > > extract_rtree_level(const Rtree &tree, const unsigned int level)
boost::geometry::index::rtree< LeafType, IndexType, IndexableGetter > RTree
RTree< typename LeafTypeIterator::value_type, IndexType, IndexableGetter > pack_rtree(const LeafTypeIterator &begin, const LeafTypeIterator &end)
boost::signals2::signal< void()> any_change