From 4243e59b13ab829558def91853a7615bbee88fe2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 16 May 2024 20:22:06 -0600 Subject: [PATCH] Provide an error message that is more meaningful for global MG transfer operator. --- .../mg_transfer_global_coarsening.templates.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 099632b7ac..04918c3309 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -1438,13 +1438,21 @@ namespace internal dof_handler_fine.get_triangulation().create_cell_iterator( cell_id); - if (cell_fine->has_children() == false) + if (cell_fine->is_active()) { if (cell_fine->subdomain_id() != cell->subdomain_id()) flag = false; } else { + Assert( + cell_fine->child(0)->is_active(), + ExcMessage( + "In building a transfer operator, we are " + "expecting that a cell is not or at most once refined " + "on the other multigrid level. But it is refined more than once. " + "Are you trying to build a transfer operator across " + "more than one level of mesh refinement?")); if (cell_fine->child(0)->subdomain_id() != cell->subdomain_id()) flag = false; -- 2.39.5