]> https://gitweb.dealii.org/ - dealii.git/commitdiff
RemotePointEvalution: pass marked_vertices 13178/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 6 Jan 2022 12:47:27 +0000 (13:47 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 6 Jan 2022 16:26:50 +0000 (17:26 +0100)
include/deal.II/base/mpi_remote_point_evaluation.h
include/deal.II/grid/grid_tools.h
source/base/mpi_remote_point_evaluation.cc
source/grid/grid_tools.cc
source/grid/grid_tools.inst.in

index 4734b19bd04f28f67aef5f16ee5cd48c3e0f5db5..f79eda5a12b2f84763c7bd1fa188a58bbe2d30e2 100644 (file)
@@ -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<std::vector<bool>()> &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<std::vector<bool>()> marked_vertices;
+
       /**
        * Storage for the status of the triangulation signal.
        */
index f78bfce16294643a3172813454fd3f4eaa8d017d..ea340ebe04297c8d0cad39eeece8281d998a8b46 100644 (file)
@@ -1160,6 +1160,7 @@ namespace GridTools
       const GridTools::Cache<dim, spacedim> &                cache,
       const std::vector<Point<spacedim>> &                   points,
       const std::vector<std::vector<BoundingBox<spacedim>>> &global_bboxes,
+      const std::vector<bool> &                              marked_vertices,
       const double                                           tolerance,
       const bool                                             perform_handshake,
       const bool enforce_unique_mapping = false);
index 5caf30a61117c14115d6c864830a704fa21e34b0..404f15e6b062f26673e52aebebbd0997a9231272 100644 (file)
@@ -38,12 +38,14 @@ namespace Utilities
   {
     template <int dim, int spacedim>
     RemotePointEvaluation<dim, spacedim>::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<std::vector<bool>()> &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<bool>(),
           tolerance,
           true,
           enforce_unique_mapping);
index b60c4cdab8f252d273bd6be5c51be298b77fd2cb..9523f71252846e44b33fc8d72cc20638a9270835 100644 (file)
@@ -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<dim, spacedim> &                cache,
       const std::vector<Point<spacedim>> &                   points,
       const std::vector<std::vector<BoundingBox<spacedim>>> &global_bboxes,
+      const std::vector<bool> &                              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<bool> marked_vertices;
       auto cell_hint = cache.get_triangulation().begin_active();
 
       const auto translate = [&](const unsigned int other_rank) {
index 170164eae3943b7ea3201d9974bf7f2883ae7010..7b01f27fe78a7571febb2f6d39312b9c112cd326 100644 (file)
@@ -146,6 +146,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
         const Cache<deal_II_dimension, deal_II_space_dimension> &,
         const std::vector<Point<deal_II_space_dimension>> &,
         const std::vector<std::vector<BoundingBox<deal_II_space_dimension>>> &,
+        const std::vector<bool> &marked_vertices,
         const double,
         const bool,
         const bool);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.