From 25fcf3c8d7a4b7847012cffcb57df96e51fdcb16 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Fri, 16 Oct 2020 14:17:56 -0400 Subject: [PATCH] improve error message in make_hanging_node_constraints() Without this, it fails with an internal error deep inside the constraints computation. --- source/dofs/dof_tools_constraints.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index ae4f919a88..06bc59730f 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -1768,6 +1768,11 @@ namespace DoFTools make_hanging_node_constraints(const DoFHandler &dof_handler, AffineConstraints & constraints) { + Assert(dof_handler.has_active_dofs(), + ExcMessage( + "The given DoFHandler does not have any DoFs. Did you forget to " + "call dof_handler.distribute_dofs()?")); + // Decide whether to use the new or old make_hanging_node_constraints // function. If all the FiniteElement or all elements in a FECollection // support the new face constraint matrix, the new code will be used. -- 2.39.5