]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid the use of GeometryInfo in particle_handler.cc.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 15 Jan 2025 20:59:03 +0000 (13:59 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 15 Jan 2025 21:36:12 +0000 (14:36 -0700)
source/particles/particle_handler.cc

index a73bb65abcd0539ecb96166f892faf3048f30331..62fb5c8a1f56622b1dd686fa065a430f65d1e4c0 100644 (file)
@@ -1266,8 +1266,8 @@ namespace Particles
         for (const auto &p_unit : reference_locations)
           {
             if (numbers::is_finite(p_unit[0]) &&
-                GeometryInfo<dim>::is_inside_unit_cell(p_unit,
-                                                       tolerance_inside_cell))
+                cell->reference_cell().contains_point(p_unit,
+                                                      tolerance_inside_cell))
               particle->set_reference_location(p_unit);
             else
               particles_out_of_cell.push_back(particle);
@@ -1399,8 +1399,10 @@ namespace Particles
                                                           real_locations,
                                                           reference_locations);
 
-              if (GeometryInfo<dim>::is_inside_unit_cell(reference_locations[0],
-                                                         tolerance_inside_cell))
+              if ((*candidate_cell)
+                    ->reference_cell()
+                    .contains_point(reference_locations[0],
+                                    tolerance_inside_cell))
                 {
                   current_cell = *candidate_cell;
                   found_cell   = true;
@@ -1448,7 +1450,7 @@ namespace Particles
                   mapping->transform_points_real_to_unit_cell(
                     cell, real_locations, reference_locations);
 
-                  if (GeometryInfo<dim>::is_inside_unit_cell(
+                  if (cell->reference_cell().contains_point(
                         reference_locations[0], tolerance_inside_cell))
                     {
                       current_cell = cell;
@@ -2410,7 +2412,7 @@ namespace Particles
                         const Point<dim> p_unit =
                           mapping->transform_real_to_unit_cell(
                             child, particle->get_location());
-                        if (GeometryInfo<dim>::is_inside_unit_cell(
+                        if (cell->reference_cell().contains_point(
                               p_unit, tolerance_inside_cell))
                           {
                             found_new_cell = true;
@@ -2446,7 +2448,7 @@ namespace Particles
                     // If we get here, we did not find the particle in any
                     // child. This case may happen for particles that are at the
                     // boundary for strongly curved cells. We apply a tolerance
-                    // in the call to GeometryInfo<dim>::is_inside_unit_cell to
+                    // in the call to ReferenceCell::contains_point() to
                     // account for this, but if that is not enough, we still
                     // need to prevent an endless loop here. Delete the particle
                     // and move on.

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.