From 6af54f58497d1b26ca1473c222e05531cab35975 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 15 Jan 2025 13:59:03 -0700 Subject: [PATCH] Avoid the use of GeometryInfo in particle_handler.cc. --- source/particles/particle_handler.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index a73bb65abc..62fb5c8a1f 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -1266,8 +1266,8 @@ namespace Particles for (const auto &p_unit : reference_locations) { if (numbers::is_finite(p_unit[0]) && - GeometryInfo::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::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::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 p_unit = mapping->transform_real_to_unit_cell( child, particle->get_location()); - if (GeometryInfo::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::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. -- 2.39.5