]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify code. 11645/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 22 Jan 2021 03:46:53 +0000 (20:46 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 28 Jan 2021 18:52:15 +0000 (11:52 -0700)
source/grid/reference_cell.cc

index b4db7849e16f68430cfa961fc9204478eb2462cb..a5caf7fd599bbe70359b56d55741be2e845d63f0 100644 (file)
@@ -96,6 +96,8 @@ namespace ReferenceCell
   void
   Type::make_triangulation(Triangulation<dim, spacedim> &tria) const
   {
+    AssertDimension(dim, this->get_dimension());
+
     if (this->is_hyper_cube())
       {
         GridGenerator::hyper_cube(tria, 0, 1);
@@ -172,9 +174,9 @@ namespace ReferenceCell
   {
     AssertDimension(dim, get_dimension());
 
-    if (*this == Type::get_hypercube<dim>())
+    if (is_hyper_cube())
       return std::make_unique<MappingQGeneric<dim, spacedim>>(degree);
-    else if (*this == Type::Tri || *this == Type::Tet)
+    else if (is_simplex())
       return std::make_unique<MappingFE<dim, spacedim>>(
         Simplex::FE_P<dim, spacedim>(degree));
     else if (*this == Type::Pyramid)
@@ -199,11 +201,11 @@ namespace ReferenceCell
   {
     AssertDimension(dim, get_dimension());
 
-    if (*this == Type::get_hypercube<dim>())
+    if (is_hyper_cube())
       {
         return StaticMappingQ1<dim, spacedim>::mapping;
       }
-    else if (*this == Type::Tri || *this == Type::Tet)
+    else if (is_simplex())
       {
         static const MappingFE<dim, spacedim> mapping(
           Simplex::FE_P<dim, spacedim>(1));

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.