From: Wolfgang Bangerth Date: Tue, 19 Oct 2021 16:10:09 +0000 (-0600) Subject: Reduce duplication of information. X-Git-Tag: v9.4.0-rc1~915^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12849%2Fhead;p=dealii.git Reduce duplication of information. Instead, use ReferenceCell as the one normative place to draw vertex orders from. --- diff --git a/source/fe/fe_pyramid_p.cc b/source/fe/fe_pyramid_p.cc index 92d516e0bd..0d0df5be11 100644 --- a/source/fe/fe_pyramid_p.cc +++ b/source/fe/fe_pyramid_p.cc @@ -95,15 +95,14 @@ FE_PyramidPoly::FE_PyramidPoly( { AssertDimension(dim, 3); - if (degree == 1) { - this->unit_support_points.emplace_back(-1.0, -1.0, 0.0); - this->unit_support_points.emplace_back(+1.0, -1.0, 0.0); - this->unit_support_points.emplace_back(-1.0, +1.0, 0.0); - this->unit_support_points.emplace_back(+1.0, +1.0, 0.0); - this->unit_support_points.emplace_back(+0.0, +0.0, 1.0); + for (const unsigned int i : ReferenceCells::Pyramid.vertex_indices()) + this->unit_support_points.emplace_back( + ReferenceCells::Pyramid.vertex(i)); } + else + Assert(false, ExcNotImplemented()); } diff --git a/source/fe/fe_wedge_p.cc b/source/fe/fe_wedge_p.cc index 33a6b62aba..33072f17ea 100644 --- a/source/fe/fe_wedge_p.cc +++ b/source/fe/fe_wedge_p.cc @@ -80,6 +80,8 @@ namespace } } // namespace + + template FE_WedgePoly::FE_WedgePoly( const unsigned int degree, @@ -105,12 +107,16 @@ FE_WedgePoly::FE_WedgePoly( if (degree == 1) { - this->unit_support_points.emplace_back(0.0, 0.0, 0.0); - this->unit_support_points.emplace_back(1.0, 0.0, 0.0); - this->unit_support_points.emplace_back(0.0, 1.0, 0.0); - this->unit_support_points.emplace_back(0.0, 0.0, 1.0); - this->unit_support_points.emplace_back(1.0, 0.0, 1.0); - this->unit_support_points.emplace_back(0.0, 1.0, 1.0); + for (const unsigned int i : ReferenceCells::Wedge.vertex_indices()) + this->unit_support_points.emplace_back( + ReferenceCells::Wedge.vertex(i)); + } + else + { + // TODO: Wedge elements work for higher degrees, but we don't currently + // fill their support points. Leaving the array empty is valid, however, + // and will simply result in an error when someone tries to access the + // array. } }