From f9e352ebaea411cca41c4dbc69a2ae1c3b1267b5 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Fri, 20 Aug 2021 17:19:08 -0400 Subject: [PATCH] actually fix the problem --- source/multigrid/mg_level_global_transfer.cc | 16 +++++++---- ...ix_free_14.with_p4est=true.mpirun=2.output | 28 +++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/source/multigrid/mg_level_global_transfer.cc b/source/multigrid/mg_level_global_transfer.cc index 2e45f359fa..f0c18c1357 100644 --- a/source/multigrid/mg_level_global_transfer.cc +++ b/source/multigrid/mg_level_global_transfer.cc @@ -330,16 +330,22 @@ MGLevelGlobalTransfer>:: solution_ghosted_level_vector = ghosted_level_vector; } - bool my_perform_renumbered_plain_copy = + // Check if we can perform a cheaper "plain copy" (with or without + // renumbering) instead of having to translate individual entries + // using copy_indices*. This only works if a) we don't have to send + // or receive any DoFs and we have all locally owned DoFs in our + // copy_indices (so no adaptive refinement) and b) all processors + // agree on the choice (see below). + const bool my_perform_renumbered_plain_copy = (this->copy_indices.back().n_cols() == - mg_dof.locally_owned_dofs().n_elements()); + mg_dof.locally_owned_dofs().n_elements()) && + (this->copy_indices_global_mine.back().n_rows() == 0) && + (this->copy_indices_level_mine.back().n_rows() == 0); + bool my_perform_plain_copy = false; if (my_perform_renumbered_plain_copy) { my_perform_plain_copy = true; - AssertDimension(this->copy_indices_global_mine.back().n_rows(), 0); - AssertDimension(this->copy_indices_level_mine.back().n_rows(), 0); - // check whether there is a renumbering of degrees of freedom on // either the finest level or the global dofs, which means that we // cannot apply a plain copy diff --git a/tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output b/tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output index ee2f46465a..cde307a16c 100644 --- a/tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output +++ b/tests/multigrid/transfer_matrix_free_14.with_p4est=true.mpirun=2.output @@ -1,19 +1,11 @@ -DEAL::n_dofs = 50 -DEAL::OK -DEAL::n_dofs = 18 -DEAL::OK -DEAL::n_dofs = 8 -DEAL::OK -DEAL::n_dofs = 8 -DEAL::OK -DEAL:: -DEAL::n_dofs = 375 -DEAL::OK -DEAL::n_dofs = 81 -DEAL::OK -DEAL::n_dofs = 24 -DEAL::OK -DEAL::n_dofs = 24 -DEAL::OK -DEAL:: +DEAL:0::n_dofs = 9 +DEAL:0::OK +DEAL:0::n_dofs = 84 +DEAL:0::OK + +DEAL:1::n_dofs = 9 +DEAL:1::OK +DEAL:1::n_dofs = 84 +DEAL:1::OK + -- 2.39.5