]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix grid/distributed_compute_point_locations_02 7555/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 28 Dec 2018 20:34:04 +0000 (21:34 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 28 Dec 2018 20:35:14 +0000 (21:35 +0100)
tests/grid/distributed_compute_point_locations_02.cc

index 14a406ee2accb700f044e16ed603c157ba483d23..13a7377b3cad6b3ff11bee0c5ce8805e65fa14b2 100644 (file)
@@ -93,34 +93,42 @@ test_compute_pt_loc(unsigned int ref_cube, unsigned int ref_sphere)
       // Store the point only if it is inside a locally owned sphere cell
       if (cell->subdomain_id() == my_rank)
         loc_owned_points.emplace_back(center_pt);
-      // Find the cube cell where center pt lies
-      auto my_pair = GridTools::find_active_cell_around_point(cache, center_pt);
-      // If it is inside a locally owned cell it shall be returned
-      // from distributed compute point locations
-      if (my_pair.first->is_locally_owned())
+      try
         {
-          computed_pts++;
-          auto cells_it = std::find(computed_cells.begin(),
-                                    computed_cells.end(),
-                                    my_pair.first);
-
-          if (cells_it == computed_cells.end())
+          // Find the cube cell where center pt lies
+          auto my_pair =
+            GridTools::find_active_cell_around_point(cache, center_pt);
+          // If it is inside a locally owned cell it shall be returned
+          // from distributed compute point locations
+          if (my_pair.first->is_locally_owned())
             {
-              // Cell not found: adding a new cell
-              computed_cells.emplace_back(my_pair.first);
-              computed_qpoints.emplace_back(1, my_pair.second);
-              computed_points.emplace_back(1, center_pt);
-              computed_ranks.emplace_back(1, cell->subdomain_id());
-            }
-          else
-            {
-              // Cell found: just adding the point index and qpoint to the list
-              unsigned int current_cell = cells_it - computed_cells.begin();
-              computed_qpoints[current_cell].emplace_back(my_pair.second);
-              computed_points[current_cell].emplace_back(center_pt);
-              computed_ranks[current_cell].emplace_back(cell->subdomain_id());
+              computed_pts++;
+              auto cells_it = std::find(computed_cells.begin(),
+                                        computed_cells.end(),
+                                        my_pair.first);
+
+              if (cells_it == computed_cells.end())
+                {
+                  // Cell not found: adding a new cell
+                  computed_cells.emplace_back(my_pair.first);
+                  computed_qpoints.emplace_back(1, my_pair.second);
+                  computed_points.emplace_back(1, center_pt);
+                  computed_ranks.emplace_back(1, cell->subdomain_id());
+                }
+              else
+                {
+                  // Cell found: just adding the point index and qpoint to the
+                  // list
+                  unsigned int current_cell = cells_it - computed_cells.begin();
+                  computed_qpoints[current_cell].emplace_back(my_pair.second);
+                  computed_points[current_cell].emplace_back(center_pt);
+                  computed_ranks[current_cell].emplace_back(
+                    cell->subdomain_id());
+                }
             }
         }
+      catch (const GridTools::ExcPointNotFound<dim> &)
+        {}
     }
 
   // Computing bounding boxes describing the locally owned part of the mesh

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.