From 8978fa3753ade64e21b56491471d6f1f450012b0 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 12 Sep 2022 19:46:46 +0200 Subject: [PATCH] GT::distributed_compute_point_locations(): project reference points onto cell --- doc/news/changes/minor/20220912Munch_2 | 6 ++++++ source/grid/grid_tools.cc | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 doc/news/changes/minor/20220912Munch_2 diff --git a/doc/news/changes/minor/20220912Munch_2 b/doc/news/changes/minor/20220912Munch_2 new file mode 100644 index 0000000000..27256ac3ea --- /dev/null +++ b/doc/news/changes/minor/20220912Munch_2 @@ -0,0 +1,6 @@ +Fixed: The function GridTools::internal::distributed_compute_point_locations() +now projects reference points outside of a cell (but within a tolerance) onto +the unit cell. This enables the use of FE_Q_iso_Q1 in +Utilities::MPI::RemotePointEvaluation. +
+(Peter Munch, Magdalena Schreter, 2022/09/12) diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index f6f642ab1f..86d0e96363 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -6089,13 +6089,22 @@ namespace GridTools for (const auto &cell_and_reference_position : cells_and_reference_positions) { + const auto cell = cell_and_reference_position.first; + auto reference_position = + cell_and_reference_position.second; + + // TODO: we need to implement + // ReferenceCell::project_to_unit_cell() + if (cell->reference_cell().is_hyper_cube()) + reference_position = + GeometryInfo::project_to_unit_cell( + reference_position); + send_components.emplace_back( - std::pair( - cell_and_reference_position.first->level(), - cell_and_reference_position.first->index()), + std::pair(cell->level(), cell->index()), other_rank, index_and_point.first, - cell_and_reference_position.second, + reference_position, index_and_point.second, numbers::invalid_unsigned_int); } -- 2.39.5