]> https://gitweb.dealii.org/ - dealii.git/commitdiff
improve error message in make_hanging_node_constraints() 11049/head
authorTimo Heister <timo.heister@gmail.com>
Fri, 16 Oct 2020 18:17:56 +0000 (14:17 -0400)
committerTimo Heister <timo.heister@gmail.com>
Fri, 16 Oct 2020 18:17:56 +0000 (14:17 -0400)
Without this, it fails with an internal error deep inside the
constraints computation.

source/dofs/dof_tools_constraints.cc

index ae4f919a880d04140bdb156b19780a788923f336..06bc59730fdf62b9ff7acf960c0c6700eb3d1ab4 100644 (file)
@@ -1768,6 +1768,11 @@ namespace DoFTools
   make_hanging_node_constraints(const DoFHandler<dim, spacedim> &dof_handler,
                                 AffineConstraints<number> &      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.

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.