]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid undefined reference when spacedim==1
authorMarco Feder <marco.feder@sissa.it>
Thu, 6 Jul 2023 18:09:35 +0000 (20:09 +0200)
committerMarco Feder <marco.feder@sissa.it>
Fri, 14 Jul 2023 07:58:27 +0000 (09:58 +0200)
source/grid/grid_tools.cc

index c2b37a345e252862682f4f1f0b1691c570cb0867..2b5dea22face839d28d49e38e190d2aa6ad8e4e9 100644 (file)
@@ -5954,27 +5954,34 @@ namespace GridTools
       unsigned int idx = (global_bboxes.size() == 1) ?
                            0 :
                            Utilities::MPI::this_mpi_process(comm);
+      if constexpr (spacedim != 1)
+        {
+          ArborXWrappers::DistributedTree distributed_tree(comm,
+                                                           global_bboxes[idx]);
 
-      ArborXWrappers::DistributedTree distributed_tree(comm,
-                                                       global_bboxes[idx]);
+          if constexpr (std::is_same<T, Point<spacedim>>::value)
+            {
+              ArborXWrappers::PointIntersectPredicate bb_intersect(entities);
 
-      if constexpr (std::is_same<T, Point<spacedim>>::value)
-        {
-          ArborXWrappers::PointIntersectPredicate bb_intersect(entities);
+              const auto &[indices_ranks, offsets] =
+                distributed_tree.query(bb_intersect);
+              fill_ranks_and_indices(offsets, indices_ranks);
+            }
+          else if constexpr (std::is_same<T, BoundingBox<spacedim>>::value)
+            {
+              ArborXWrappers::BoundingBoxIntersectPredicate bb_intersect(
+                entities);
 
-          const auto &[indices_ranks, offsets] =
-            distributed_tree.query(bb_intersect);
-          fill_ranks_and_indices(offsets, indices_ranks);
+              const auto &[indices_ranks, offsets] =
+                distributed_tree.query(bb_intersect);
+              fill_ranks_and_indices(offsets, indices_ranks);
+            }
         }
-      else if constexpr (std::is_same<T, BoundingBox<spacedim>>::value)
+      else
         {
-          ArborXWrappers::BoundingBoxIntersectPredicate bb_intersect(entities);
-
-          const auto &[indices_ranks, offsets] =
-            distributed_tree.query(bb_intersect);
-          fill_ranks_and_indices(offsets, indices_ranks);
+          AssertThrow(false, ExcInternalError());
+          return {};
         }
-
 #endif
 
       // convert to CRS

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.