From a84a10c005b5b6975c436bce2817e0f8227b546f Mon Sep 17 00:00:00 2001 From: tcclevenger Date: Wed, 15 Apr 2020 14:04:18 -0400 Subject: [PATCH] extract_constant_modes fix --- source/dofs/dof_tools.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 55f4c3553c..05b451da93 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -1265,6 +1265,14 @@ namespace DoFTools const ComponentMask & component_mask, std::vector> &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>(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())); -- 2.39.5