]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reduce duplication of information. 12849/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 19 Oct 2021 16:10:09 +0000 (10:10 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 20 Oct 2021 19:16:58 +0000 (13:16 -0600)
Instead, use ReferenceCell as the one normative place to draw vertex orders from.

source/fe/fe_pyramid_p.cc
source/fe/fe_wedge_p.cc

index 92d516e0bd67d5d8c6ab72e0988cea01005521ba..0d0df5be11b75f29676d8fd6ebfd024270154b16 100644 (file)
@@ -95,15 +95,14 @@ FE_PyramidPoly<dim, spacedim>::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<dim>(i));
     }
+  else
+    Assert(false, ExcNotImplemented());
 }
 
 
index 33a6b62abaa26a5823ef2388779736d6b20f1372..33072f17ea50d4ddf55b654bc04c6e8dd2f1e7d3 100644 (file)
@@ -80,6 +80,8 @@ namespace
   }
 } // namespace
 
+
+
 template <int dim, int spacedim>
 FE_WedgePoly<dim, spacedim>::FE_WedgePoly(
   const unsigned int                                degree,
@@ -105,12 +107,16 @@ FE_WedgePoly<dim, spacedim>::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<dim>(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.
     }
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.