From: Peter Munch Date: Tue, 9 Mar 2021 07:39:42 +0000 (+0100) Subject: MGTransferGlobalCoarsening: add assert X-Git-Tag: v9.3.0-rc1~352^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11873%2Fhead;p=dealii.git MGTransferGlobalCoarsening: add assert --- diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.h index ea86730e57..aaf96ed803 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.h @@ -481,6 +481,13 @@ MGTransferGlobalCoarsening::copy_to_mg( { (void)dof_handler; + Assert( + initialize_dof_vector, + ExcMessage( + "To be able to use this function, a function to initialize an internal " + "DoF vector has to be provided in the constructor of " + "MGTransferGlobalCoarsening.")); + for (unsigned int level = dst.min_level(); level <= dst.max_level(); ++level) initialize_dof_vector(level, dst[level]); @@ -514,6 +521,13 @@ MGTransferGlobalCoarsening::interpolate_to_mg( { (void)dof_handler; + Assert( + initialize_dof_vector, + ExcMessage( + "To be able to use this function, a function to initialize an internal " + "DoF vector has to be provided in the constructor of " + "MGTransferGlobalCoarsening.")); + const unsigned int min_level = transfer.min_level(); const unsigned int max_level = transfer.max_level();