From: David Wells Date: Mon, 7 Jun 2021 18:12:12 +0000 (-0400) Subject: Fix another GCC11 warning. X-Git-Tag: v9.4.0-rc1~1259^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12404%2Fhead;p=dealii.git Fix another GCC11 warning. --- diff --git a/source/fe/fe_simplex_p.cc b/source/fe/fe_simplex_p.cc index 684ce3c73f..ca7851bbc6 100644 --- a/source/fe/fe_simplex_p.cc +++ b/source/fe/fe_simplex_p.cc @@ -35,26 +35,38 @@ namespace std::vector get_dpo_vector_fe_p(const unsigned int dim, const unsigned int degree) { - std::vector dpo(dim + 1, 0U); + Assert(degree == 1 || degree == 2, ExcNotImplemented()); - if (degree == 1) - { - // one dof at each vertex - dpo[0] = 1; - } - else if (degree == 2) - { - // one dof at each vertex and in the middle of each line - dpo[0] = 1; - dpo[1] = 1; - dpo[2] = 0; - } - else + switch (dim) { - Assert(false, ExcNotImplemented()); + case 1: + switch (degree) + { + case 1: + return {1, 0}; + case 2: + return {1, 1}; + } + case 2: + switch (degree) + { + case 1: + return {1, 0, 0}; + case 2: + return {1, 1, 0}; + } + case 3: + switch (degree) + { + case 1: + return {1, 0, 0, 0}; + case 2: + return {1, 1, 0, 0}; + } } - return dpo; + Assert(false, ExcNotImplemented()); + return {}; } /**