From: Wolfgang Bangerth Date: Mon, 20 May 2024 19:58:15 +0000 (-0600) Subject: Add one more forgotten simplification. X-Git-Tag: v9.6.0-rc1~251^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2be14e060cf18309ef7c1cb9cec1f2a15fef806;p=dealii.git Add one more forgotten simplification. --- diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 851bc31ae7..33d25c70ad 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -223,20 +223,20 @@ namespace FETools const FiniteElement *fe5, const unsigned int N5) { - std::vector *> fes; - fes.push_back(fe1); - fes.push_back(fe2); - fes.push_back(fe3); - fes.push_back(fe4); - fes.push_back(fe5); - - std::vector mult; - mult.push_back(N1); - mult.push_back(N2); - mult.push_back(N3); - mult.push_back(N4); - mult.push_back(N5); - return multiply_dof_numbers(fes, mult); + std::vector *> fe_list = { + fe1, fe2, fe3, fe4, fe5}; + std::vector multiplicities = {N1, N2, N3, N4, N5}; + + // This function is occasionally called with nullptr values for the + // finite elements. Drop those again. + while ((fe_list.size() > 0) && (fe_list.back() == nullptr)) + { + Assert(multiplicities.back() == 0, ExcInternalError()); + fe_list.pop_back(); + multiplicities.pop_back(); + } + + return multiply_dof_numbers(fe_list, multiplicities); }