]> https://gitweb.dealii.org/ - dealii.git/commitdiff
extract_constant_modes fix 9896/head
authortcclevenger <tcleven@clemson.edu>
Wed, 15 Apr 2020 18:04:18 +0000 (14:04 -0400)
committertcclevenger <tcleven@clemson.edu>
Wed, 15 Apr 2020 18:47:01 +0000 (14:47 -0400)
source/dofs/dof_tools.cc

index 55f4c3553c670499eaf539d9585df370cedf29a8..05b451da9395c09e22a0078908d5831bac77a13c 100644 (file)
@@ -1265,6 +1265,14 @@ namespace DoFTools
                          const ComponentMask &           component_mask,
                          std::vector<std::vector<bool>> &constant_modes)
   {
+    // If there are no locally owned DoFs, return with an empty
+    // constant_modes object:
+    if (dof_handler.n_locally_owned_dofs() == 0)
+      {
+        constant_modes = std::vector<std::vector<bool>>(0);
+        return;
+      }
+
     const unsigned int n_components = dof_handler.get_fe(0).n_components();
     Assert(component_mask.represents_n_components(n_components),
            ExcDimensionMismatch(n_components, component_mask.size()));

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.