From 50a761e49bfd1562a00d94f7ebd085b29ed0313c Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 8 Jun 2023 14:04:00 -0400 Subject: [PATCH] find_active_cell_around_point(): avoid GeometryInfo. --- source/grid/grid_tools_dof_handlers.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index 58269f9024..c7a2f513c1 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -508,10 +508,11 @@ namespace GridTools const Point p_cell = mapping.transform_real_to_unit_cell(cell, p); - // calculate the infinity norm of + // calculate the Euclidean norm of // the distance vector to the unit cell. const double dist = - GeometryInfo::distance_to_unit_cell(p_cell); + cell->reference_cell().closest_point(p_cell).distance( + p_cell); // We compare if the point is inside the // unit cell (or at least not too far @@ -731,7 +732,7 @@ namespace GridTools } const double original_distance_to_unit_cell = - GeometryInfo::distance_to_unit_cell(unit_point); + my_cell->reference_cell().closest_point(unit_point).distance(unit_point); for (const auto &cell : cells_to_add) { if (cell != my_cell) @@ -739,8 +740,8 @@ namespace GridTools { const Point p_unit = mapping.transform_real_to_unit_cell(cell, p); - if (GeometryInfo::distance_to_unit_cell(p_unit) < - original_distance_to_unit_cell + tolerance) + if (cell->reference_cell().closest_point(p_unit).distance( + p_unit) < original_distance_to_unit_cell + tolerance) cells_and_points.emplace_back(cell, p_unit); } catch (typename Mapping::ExcTransformationFailed &) @@ -1369,10 +1370,11 @@ namespace GridTools .transform_real_to_unit_cell(cell, p); - // calculate the infinity norm of + // calculate the Euclidean norm of // the distance vector to the unit cell. const double dist = - GeometryInfo::distance_to_unit_cell(p_cell); + cell->reference_cell().closest_point(p_cell).distance( + p_cell); // We compare if the point is inside the // unit cell (or at least not too far -- 2.39.5