From e6046d78c65f395840f7eca8154e3f20a8eb05c0 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 21 Dec 2022 12:06:12 +0100 Subject: [PATCH] Make sure to clear a variable that gets set --- source/multigrid/mg_level_global_transfer.cc | 6 ++++++ source/multigrid/mg_transfer_matrix_free.cc | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/multigrid/mg_level_global_transfer.cc b/source/multigrid/mg_level_global_transfer.cc index f0c18c1357..6592169300 100644 --- a/source/multigrid/mg_level_global_transfer.cc +++ b/source/multigrid/mg_level_global_transfer.cc @@ -387,14 +387,20 @@ MGLevelGlobalTransfer>::clear() { sizes.resize(0); copy_indices.clear(); + solution_copy_indices.clear(); copy_indices_global_mine.clear(); + solution_copy_indices_global_mine.clear(); copy_indices_level_mine.clear(); + solution_copy_indices_level_mine.clear(); component_to_block_map.resize(0); mg_constrained_dofs = nullptr; ghosted_global_vector.reinit(0); + solution_ghosted_global_vector.reinit(0); ghosted_level_vector.resize(0, 0); + solution_ghosted_level_vector.resize(0, 0); perform_plain_copy = false; perform_renumbered_plain_copy = false; + initialize_dof_vector = nullptr; } diff --git a/source/multigrid/mg_transfer_matrix_free.cc b/source/multigrid/mg_transfer_matrix_free.cc index a131d8846b..1859913180 100644 --- a/source/multigrid/mg_transfer_matrix_free.cc +++ b/source/multigrid/mg_transfer_matrix_free.cc @@ -109,10 +109,9 @@ MGTransferMatrixFree::build( "probably close to where you already call distribute_dofs().")); if (external_partitioners.size() > 0) { - Assert( - this->initialize_dof_vector == nullptr, - ExcMessage( - "A initialize_dof_vector function has already been registered in the constructor!")); + Assert(this->initialize_dof_vector == nullptr, + ExcMessage("An initialize_dof_vector function has already " + "been registered in the constructor!")); this->initialize_dof_vector = [external_partitioners]( -- 2.39.5