]> https://gitweb.dealii.org/ - dealii.git/commitdiff
specify maked verts and unique mapping in distributed_compute_point_locations 15101/head
authorJohannes Heinz <johannes.heinz@tuwien.ac.at>
Fri, 14 Apr 2023 10:50:29 +0000 (12:50 +0200)
committerJohannes Heinz <johannes.heinz@tuwien.ac.at>
Fri, 14 Apr 2023 17:03:51 +0000 (19:03 +0200)
Co-authored-by: Martin Kronbichler <martin.kronbichler@uni-a.de>
include/deal.II/grid/grid_tools.h
source/grid/grid_tools.cc
source/grid/grid_tools.inst.in

index f78f1e2c22d23f2695c7a9e8081e9e40a0e1ed28..adff6853e948a87958fbf4859468e96032f38cb7 100644 (file)
@@ -1108,6 +1108,16 @@ namespace GridTools
    *   of the cells adjacent to a vertex or an edge/face this function returns.
    *   Consequently, algorithms that call this function need to take into
    *   account that the returned cell will only contain the point approximately.
+   * @param[in] enforce_unique_mapping Enforce a one to one mapping between
+   points
+   *   in real and reference space.
+   * @param[in] marked_vertices An array of bools indicating which
+   * vertices of @p mesh will be considered within the search
+   * as the potentially closest vertex. On receiving a non-empty
+   * @p marked_vertices, the function will
+   * only search among @p marked_vertices for the closest vertex,
+   * otherwise on all vertices in the mesh.
+
    * @return A tuple containing the quadrature information
    *
    * The elements of the output tuple are:
@@ -1164,7 +1174,9 @@ namespace GridTools
     const GridTools::Cache<dim, spacedim> &                cache,
     const std::vector<Point<spacedim>> &                   local_points,
     const std::vector<std::vector<BoundingBox<spacedim>>> &global_bboxes,
-    const double                                           tolerance = 1e-10);
+    const double                                           tolerance = 1e-10,
+    const std::vector<bool> &                              marked_vertices = {},
+    const bool enforce_unique_mapping = true);
 
   namespace internal
   {
index c6854b732d27f6ce23a0da3258486c563c95de12..4196e29fa8fb9e517fe2d0c7cd0ab212ae5e7d56 100644 (file)
@@ -5924,12 +5924,20 @@ namespace GridTools
     const GridTools::Cache<dim, spacedim> &                cache,
     const std::vector<Point<spacedim>> &                   points,
     const std::vector<std::vector<BoundingBox<spacedim>>> &global_bboxes,
-    const double                                           tolerance)
+    const double                                           tolerance,
+    const std::vector<bool> &                              marked_vertices,
+    const bool enforce_unique_mapping)
   {
     // run internal function ...
-    const auto all = internal::distributed_compute_point_locations(
-                       cache, points, global_bboxes, {}, tolerance, false, true)
-                       .send_components;
+    const auto all =
+      internal::distributed_compute_point_locations(cache,
+                                                    points,
+                                                    global_bboxes,
+                                                    marked_vertices,
+                                                    tolerance,
+                                                    false,
+                                                    enforce_unique_mapping)
+        .send_components;
 
     // ... and reshuffle the data
     std::tuple<
index 4d22dc0060326ef836608d6a608a23d913b9bd96..ec06814639da6ce96b6c9e52520969dec8576038 100644 (file)
@@ -137,7 +137,9 @@ 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 double tolerance);
+        const double             tolerance,
+        const std::vector<bool> &marked_vertices,
+        const bool               enforce_unique_mapping);
 
       template internal::DistributedComputePointLocationsInternal<
         deal_II_dimension,

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.