const std::vector<bool> & marked_vertices = {},
const RTree<std::pair<Point<spacedim>, unsigned int>> &used_vertices_rtree =
RTree<std::pair<Point<spacedim>, unsigned int>>{},
- const double tolerance = 1.e-10);
+ const double tolerance = 1.e-10,
+ const RTree<
+ std::pair<BoundingBox<spacedim>,
+ typename Triangulation<dim, spacedim>::active_cell_iterator>>
+ *relevant_cell_bounding_boxes_rtree = nullptr);
/**
* As compared to the functions above, this function identifies all active
const typename MeshType<dim, spacedim>::active_cell_iterator &cell_hint,
const std::vector<bool> & marked_vertices,
const RTree<std::pair<Point<spacedim>, unsigned int>> &used_vertices_rtree,
- const double tolerance)
+ const double tolerance,
+ const RTree<
+ std::pair<BoundingBox<spacedim>,
+ typename Triangulation<dim, spacedim>::active_cell_iterator>>
+ *relevant_cell_bounding_boxes_rtree)
{
std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
Point<dim>>
Point<dim>>
cell_and_position_approx;
+ if (relevant_cell_bounding_boxes_rtree != nullptr &&
+ !relevant_cell_bounding_boxes_rtree->empty())
+ {
+ using point_t = boost::geometry::model::
+ point<double, spacedim, boost::geometry::cs::cartesian>;
+ const auto pt =
+ spacedim == 1 ?
+ point_t(p[0]) :
+ (spacedim == 2 ? point_t(p[0], p[1]) : point_t(p[0], p[1], p[2]));
+ if (relevant_cell_bounding_boxes_rtree->qbegin(
+ boost::geometry::index::intersects(pt)) ==
+ relevant_cell_bounding_boxes_rtree->qend())
+ return cell_and_position;
+ }
+
bool found_cell = false;
bool approx_cell = false;
locally_owned_active_cells_around_point;
const auto first_cell = GridTools::find_active_cell_around_point(
- cache, point, cell_hint, marked_vertices, tolerance);
+ cache.get_mapping(),
+ cache.get_triangulation(),
+ point,
+ cache.get_vertex_to_cell_map(),
+ cache.get_vertex_to_cell_centers_directions(),
+ cell_hint,
+ marked_vertices,
+ cache.get_used_vertices_rtree(),
+ tolerance,
+ &cache.get_locally_owned_cell_bounding_boxes_rtree());
cell_hint = first_cell.first;
if (cell_hint.state() == IteratorState::valid)
X>::type &,
const std::vector<bool> &,
const RTree<std::pair<Point<deal_II_space_dimension>, unsigned int>> &,
- const double);
+ const double,
+ const RTree<std::pair<
+ BoundingBox<deal_II_space_dimension>,
+ typename Triangulation<deal_II_dimension, deal_II_space_dimension>::
+ active_cell_iterator>> *);
template std::vector<BoundingBox<deal_II_space_dimension>>
compute_mesh_predicate_bounding_box<X>(