]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Systematize vertex construction. 12843/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 19 Oct 2021 01:56:00 +0000 (19:56 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 19 Oct 2021 01:56:00 +0000 (19:56 -0600)
include/deal.II/grid/reference_cell.h

index 025abf9e67889f8f1a3d494925c1604927625a34..9b4e89efefb255dad7bd341ee24fbe7082b4971c 100644 (file)
@@ -884,10 +884,12 @@ ReferenceCell::vertex(const unsigned int v) const
     }
   else if ((dim == 3) && (*this == ReferenceCells::Tetrahedron))
     {
-      static const Point<dim> vertices[4] = {Point<dim>{0.0, 0.0, 0.0},
-                                             Point<dim>{1.0, 0.0, 0.0},
-                                             Point<dim>{0.0, 1.0, 0.0},
-                                             Point<dim>{0.0, 0.0, 1.0}};
+      static const Point<dim> vertices[4] = {
+        Point<dim>(),               // the origin
+        Point<dim>::unit_vector(0), // unit point along x-axis
+        Point<dim>::unit_vector(1), // unit point along y-axis
+        Point<dim>::unit_vector(2)  // unit point along z-axis
+      };
       return vertices[v];
     }
   else if ((dim == 3) && (*this == ReferenceCells::Pyramid))

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.