]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add comments ans provide fallback implementation
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 10 Jan 2023 23:56:06 +0000 (23:56 +0000)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 10 Jan 2023 23:56:06 +0000 (23:56 +0000)
source/grid/grid_tools.cc
source/particles/particle_handler.cc

index ffa7317bea7ec8b7268e2cc798bc78c24f8e8335..36e2d8bcc77ef1c9ad2babf23739817a1d35b266 100644 (file)
@@ -3012,7 +3012,10 @@ namespace GridTools
           }
         else
           {
-            // Fixed in
+            // For some clang-based compilers and boost versions the call to
+            // RTree::query doesn't compile. Since using an rtree here is just a
+            // performance improvement disabling this branch is OK.
+            // This is fixed in boost in
             // https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a
 #if defined(FEATURE_BOOST_BUNDLED_CONFIGURED) ||          \
   !(defined(__clang_major__) && __clang_major__ >= 16) || \
index 28b9694cd28ba6316c90a18994c1b9d67d63a8c6..1acfb2b42bce513b0f0cb17846f0e892e2c1b7cd 100644 (file)
@@ -1372,7 +1372,7 @@ namespace Particles
                     });
 
           // Search all of the cells adjacent to the closest vertex of the
-          // previous cell Most likely we will find the particle in them.
+          // previous cell. Most likely we will find the particle in them.
           for (unsigned int i = 0; i < n_neighbor_cells; ++i)
             {
               typename std::set<typename Triangulation<dim, spacedim>::
@@ -1393,13 +1393,16 @@ namespace Particles
                 }
             }
 
-            // Fixed in
-            // https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a
+          if (!found_cell)
+            {
+              // For some clang-based compilers and boost versions the call to
+              // RTree::query doesn't compile. We use a slower implementation as
+              // workaround.
+              // This is fixed in boost in
+              // https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a
 #if defined(FEATURE_BOOST_BUNDLED_CONFIGURED) ||          \
   !(defined(__clang_major__) && __clang_major__ >= 16) || \
   BOOST_VERSION >= 108100
-          if (!found_cell)
-            {
               // The particle is not in a neighbor of the old cell.
               // Look for the new cell in the whole local domain.
               // This case is rare.
@@ -1414,6 +1417,12 @@ namespace Particles
               AssertDimension(closest_vertex_in_domain.size(), 1);
               const unsigned int closest_vertex_index_in_domain =
                 closest_vertex_in_domain[0].second;
+#else
+              const unsigned int closest_vertex_index_in_domain =
+                GridTools::find_closest_vertex(*mapping,
+                                               *triangulation,
+                                               out_particle->get_location());
+#endif
 
               // Search all of the cells adjacent to the closest vertex of the
               // domain. Most likely we will find the particle in them.
@@ -1432,7 +1441,6 @@ namespace Particles
                     }
                 }
             }
-#endif
 
           if (!found_cell)
             {

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.