From: Peter Munch Date: Thu, 6 Jan 2022 12:47:27 +0000 (+0100) Subject: RemotePointEvalution: pass marked_vertices X-Git-Tag: v9.4.0-rc1~657^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13178%2Fhead;p=dealii.git RemotePointEvalution: pass marked_vertices --- diff --git a/include/deal.II/base/mpi_remote_point_evaluation.h b/include/deal.II/base/mpi_remote_point_evaluation.h index 4734b19bd0..f79eda5a12 100644 --- a/include/deal.II/base/mpi_remote_point_evaluation.h +++ b/include/deal.II/base/mpi_remote_point_evaluation.h @@ -56,10 +56,14 @@ namespace Utilities * @param enforce_unique_mapping Enforce unique mapping, i.e., * (one-to-one) relation of points and cells. * @param rtree_level RTree level to be used during the construction of the bounding boxes. + * @param marked_vertices Function that marks relevant vertices to make search + * of active cells around point more efficient. */ - RemotePointEvaluation(const double tolerance = 1e-6, - const bool enforce_unique_mapping = false, - const unsigned int rtree_level = 0); + RemotePointEvaluation( + const double tolerance = 1e-6, + const bool enforce_unique_mapping = false, + const unsigned int rtree_level = 0, + const std::function()> &marked_vertices = {}); /** * Destructor. @@ -193,6 +197,12 @@ namespace Utilities */ const unsigned int rtree_level; + /** + * Function that marks relevant vertices to make search of active cells + * around point more efficient. + */ + const std::function()> marked_vertices; + /** * Storage for the status of the triangulation signal. */ diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index f78bfce162..ea340ebe04 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -1160,6 +1160,7 @@ namespace GridTools const GridTools::Cache & cache, const std::vector> & points, const std::vector>> &global_bboxes, + const std::vector & marked_vertices, const double tolerance, const bool perform_handshake, const bool enforce_unique_mapping = false); diff --git a/source/base/mpi_remote_point_evaluation.cc b/source/base/mpi_remote_point_evaluation.cc index 5caf30a611..404f15e6b0 100644 --- a/source/base/mpi_remote_point_evaluation.cc +++ b/source/base/mpi_remote_point_evaluation.cc @@ -38,12 +38,14 @@ namespace Utilities { template RemotePointEvaluation::RemotePointEvaluation( - const double tolerance, - const bool enforce_unique_mapping, - const unsigned int rtree_level) + const double tolerance, + const bool enforce_unique_mapping, + const unsigned int rtree_level, + const std::function()> &marked_vertices) : tolerance(tolerance) , enforce_unique_mapping(enforce_unique_mapping) , rtree_level(rtree_level) + , marked_vertices(marked_vertices) , ready_flag(false) {} @@ -103,6 +105,7 @@ namespace Utilities cache, points, global_bboxes, + marked_vertices ? marked_vertices() : std::vector(), tolerance, true, enforce_unique_mapping); diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index b60c4cdab8..9523f71252 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -5695,7 +5695,7 @@ namespace GridTools { // run internal function ... const auto all = internal::distributed_compute_point_locations( - cache, points, global_bboxes, tolerance, false, true) + cache, points, global_bboxes, {}, tolerance, false, true) .send_components; // ... and reshuffle the data @@ -5881,6 +5881,7 @@ namespace GridTools const GridTools::Cache & cache, const std::vector> & points, const std::vector>> &global_bboxes, + const std::vector & marked_vertices, const double tolerance, const bool perform_handshake, const bool enforce_unique_mapping) @@ -5901,7 +5902,6 @@ namespace GridTools const auto &potential_owners_ptrs = std::get<1>(potential_owners); const auto &potential_owners_indices = std::get<2>(potential_owners); - const std::vector marked_vertices; auto cell_hint = cache.get_triangulation().begin_active(); const auto translate = [&](const unsigned int other_rank) { diff --git a/source/grid/grid_tools.inst.in b/source/grid/grid_tools.inst.in index 170164eae3..7b01f27fe7 100644 --- a/source/grid/grid_tools.inst.in +++ b/source/grid/grid_tools.inst.in @@ -146,6 +146,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) const Cache &, const std::vector> &, const std::vector>> &, + const std::vector &marked_vertices, const double, const bool, const bool);