From 4004fa5395e318970139c4ae949e68eb4e5dab22 Mon Sep 17 00:00:00 2001
From: Wolfgang Bangerth <bangerth@colostate.edu>
Date: Thu, 21 Jan 2021 20:46:53 -0700
Subject: [PATCH] Simplify code.

---
 source/grid/reference_cell.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc
index b4db7849e1..a5caf7fd59 100644
--- a/source/grid/reference_cell.cc
+++ b/source/grid/reference_cell.cc
@@ -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));
-- 
2.39.5