From: tcclevenger Date: Wed, 15 Apr 2020 18:04:18 +0000 (-0400) Subject: extract_constant_modes fix X-Git-Tag: v9.2.0-rc1~224^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a84a10c005b5b6975c436bce2817e0f8227b546f;p=dealii.git extract_constant_modes fix --- 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()));