From 953b7fa0183cb0b4e2b81f33f4c18352f2a0d026 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Tue, 21 May 2024 16:44:50 +0200 Subject: [PATCH] Move communication of future FE indices into pre-transfer-action. Update documentation for dominated_future_fe_on_children. --- include/deal.II/dofs/dof_handler.h | 2 +- source/dofs/dof_handler.cc | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index 78ba6c03c7..73473ffbca 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -1782,7 +1782,7 @@ namespace internal * @note This function can only be called on direct parent cells, i.e., * non-active cells whose children are all active. * - * @note On parallel::shared::Triangulation objects where sibling cells + * @note On parallel Triangulation objects where sibling cells * can be ghost cells, make sure that future FE indices have been properly * communicated with communicate_future_fe_indices() first. Otherwise, * results might differ on different processors. There is no check for diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index c3d4a2e8ae..af18a2aaf9 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -1658,7 +1658,7 @@ namespace internal "You ask for information on children of this cell which is only " "available for active cells. One of its children is not active.")); - // Ghost siblings might occur on parallel::shared::Triangulation + // Ghost siblings might occur on parallel Triangulation // objects. The public interface does not allow to access future // FE indices on ghost cells. However, we need this information // here and thus call the internal function that does not check @@ -2770,11 +2770,6 @@ void DoFHandler::connect_to_triangulation_signals() })); // refinement signals - this->tria_listeners_for_transfer.push_back( - this->tria->signals.pre_refinement.connect([this]() { - internal::hp::DoFHandlerImplementation::Implementation:: - communicate_future_fe_indices(*this); - })); this->tria_listeners_for_transfer.push_back( this->tria->signals.pre_refinement.connect( [this]() { this->pre_transfer_action(); })); @@ -2893,6 +2888,9 @@ void DoFHandler::pre_transfer_action() this->active_fe_index_transfer = std::make_unique(); + internal::hp::DoFHandlerImplementation::Implementation:: + communicate_future_fe_indices(*this); + dealii::internal::hp::DoFHandlerImplementation::Implementation:: collect_fe_indices_on_cells_to_be_refined(*this); } @@ -2930,10 +2928,18 @@ void DoFHandler::pre_distributed_transfer_action() active_fe_index_transfer->active_fe_indices.resize( get_triangulation().n_active_cells(), numbers::invalid_fe_index); + // Collect future FE indices on locally owned and ghost cells. + // The public interface does not allow to access future FE indices + // on ghost cells. However, we need this information here and thus + // call the internal function that does not check for cell ownership. + internal::hp::DoFHandlerImplementation::Implementation:: + communicate_future_fe_indices(*this); + for (const auto &cell : active_cell_iterators()) - if (cell->is_locally_owned()) + if (cell->is_artificial() == false) active_fe_index_transfer->active_fe_indices[cell->active_cell_index()] = - cell->future_fe_index(); + dealii::internal::DoFCellAccessorImplementation::Implementation:: + future_fe_index(*cell); // Create transfer object and attach to it. const auto *distributed_tria = -- 2.39.5