From a451c19d5928f8dab96779f1d1a72f1f318b6a03 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 14 Mar 2022 21:24:30 +0100 Subject: [PATCH] Add asserts to MGTwoLevelTransfer --- .../mg_transfer_global_coarsening.templates.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index 41fb457810..eb4e0e98e7 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -2467,9 +2467,13 @@ MGTwoLevelTransfer>:: const bool use_dst_inplace = this->vec_fine.size() == 0; const auto vec_fine_ptr = use_dst_inplace ? &dst : &this->vec_fine; + Assert(vec_fine_ptr->get_partitioner().get() == partitioner_fine.get(), + ExcInternalError()); const bool use_src_inplace = this->vec_coarse.size() == 0; const auto vec_coarse_ptr = use_src_inplace ? &src : &this->vec_coarse; + Assert(vec_coarse_ptr->get_partitioner().get() == partitioner_coarse.get(), + ExcInternalError()); if (use_src_inplace == false) vec_coarse.copy_locally_owned_data_from(src); @@ -2611,9 +2615,13 @@ MGTwoLevelTransfer>:: const bool use_src_inplace = this->vec_fine.size() == 0; const auto vec_fine_ptr = use_src_inplace ? &src : &this->vec_fine; + Assert(vec_fine_ptr->get_partitioner().get() == partitioner_fine.get(), + ExcInternalError()); const bool use_dst_inplace = this->vec_coarse.size() == 0; const auto vec_coarse_ptr = use_dst_inplace ? &dst : &this->vec_coarse; + Assert(vec_coarse_ptr->get_partitioner().get() == partitioner_coarse.get(), + ExcInternalError()); if (use_src_inplace == false) this->vec_fine.copy_locally_owned_data_from(src); @@ -2765,9 +2773,13 @@ MGTwoLevelTransfer>:: const bool use_src_inplace = this->vec_fine.size() == 0; const auto vec_fine_ptr = use_src_inplace ? &src : &this->vec_fine; + Assert(vec_fine_ptr->get_partitioner().get() == partitioner_fine.get(), + ExcInternalError()); const bool use_dst_inplace = this->vec_coarse.size() == 0; const auto vec_coarse_ptr = use_dst_inplace ? &dst : &this->vec_coarse; + Assert(vec_coarse_ptr->get_partitioner().get() == partitioner_coarse.get(), + ExcInternalError()); if (use_src_inplace == false) this->vec_fine.copy_locally_owned_data_from(src); -- 2.39.5