]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Turn ReferenceCell::get_hypercube/simplex() into templates.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 21 Jan 2021 19:22:56 +0000 (12:22 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 22 Jan 2021 00:07:01 +0000 (17:07 -0700)
26 files changed:
include/deal.II/base/qprojector.h
include/deal.II/fe/fe_poly_face.h
include/deal.II/grid/grid_tools.h
include/deal.II/grid/grid_tools_cache.h
include/deal.II/grid/reference_cell.h
include/deal.II/matrix_free/mapping_info.templates.h
include/deal.II/matrix_free/matrix_free.templates.h
include/deal.II/matrix_free/shape_info.templates.h
include/deal.II/numerics/vector_tools_constraints.h
include/deal.II/numerics/vector_tools_project.templates.h
include/deal.II/particles/generators.h
source/base/data_out_base.cc
source/base/qprojector.cc
source/fe/fe_nedelec.cc
source/fe/fe_nothing.cc
source/fe/fe_q_base.cc
source/fe/mapping_cartesian.cc
source/fe/mapping_fe_field.cc
source/fe/mapping_manifold.cc
source/fe/mapping_q_generic.cc
source/grid/manifold.cc
source/grid/reference_cell.cc
source/grid/tria.cc
source/multigrid/mg_tools.cc
source/numerics/data_out.cc
tests/simplex/cell_measure_01.cc

index 7ec022daf9c25abab81a9d5f23b24d9128a3106f..4036d1b4e1a4745b6fed1af1d81ad5265476a8ef 100644 (file)
@@ -602,7 +602,7 @@ template <int dim>
 Quadrature<dim> inline QProjector<dim>::project_to_all_faces(
   const Quadrature<dim - 1> &quadrature)
 {
-  return project_to_all_faces(ReferenceCell::get_hypercube(dim), quadrature);
+  return project_to_all_faces(ReferenceCell::get_hypercube<dim>(), quadrature);
 }
 
 
index ba4ffe6d54912b93f58aea2b5cf0fccfa4b873ac..3038921d24837c057a1aed9d542029975202d20b 100644 (file)
@@ -178,7 +178,7 @@ protected:
       update_flags,
       mapping,
       hp::QCollection<dim - 1>(QProjector<dim - 1>::project_to_all_children(
-        ReferenceCell::get_hypercube(dim - 1), quadrature)),
+        ReferenceCell::get_hypercube<dim - 1>(), quadrature)),
       output_data);
   }
 
index 6ac979c16035d0c4018b127841ff1b006df2d571..3f70a9e3025f1b2fca1516157c912369a502aa43 100644 (file)
@@ -177,7 +177,7 @@ namespace GridTools
   volume(const Triangulation<dim, spacedim> &tria,
          const Mapping<dim, spacedim> &      mapping =
            ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-             ReferenceCell::get_hypercube(dim)));
+             ReferenceCell::get_hypercube<dim>()));
 
   /**
    * Return an approximation of the diameter of the smallest active cell of a
@@ -195,7 +195,7 @@ namespace GridTools
     const Triangulation<dim, spacedim> &triangulation,
     const Mapping<dim, spacedim> &      mapping =
       ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-        ReferenceCell::get_hypercube(dim)));
+        ReferenceCell::get_hypercube<dim>()));
 
   /**
    * Return an approximation of the diameter of the largest active cell of a
@@ -213,7 +213,7 @@ namespace GridTools
     const Triangulation<dim, spacedim> &triangulation,
     const Mapping<dim, spacedim> &      mapping =
       ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-        ReferenceCell::get_hypercube(dim)));
+        ReferenceCell::get_hypercube<dim>()));
 
   /**
    * Given a list of vertices (typically obtained using
@@ -1045,7 +1045,7 @@ namespace GridTools
     const Triangulation<dim, spacedim> &container,
     const Mapping<dim, spacedim> &      mapping =
       ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-        ReferenceCell::get_hypercube(dim)));
+        ReferenceCell::get_hypercube<dim>()));
 
   /**
    * Find and return the index of the closest vertex to a given point in the
@@ -1873,7 +1873,7 @@ namespace GridTools
     const Point<spacedim> &                                            position,
     const Mapping<dim, spacedim> &                                     mapping =
       ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-        ReferenceCell::get_hypercube(dim)));
+        ReferenceCell::get_hypercube<dim>()));
 
   /**
    * Compute a globally unique index for each vertex and hanging node
@@ -3261,7 +3261,7 @@ namespace GridTools
                 !cell->face(face)->at_boundary())
               {
                 Assert(cell->reference_cell_type() ==
-                         ReferenceCell::get_hypercube(dim),
+                         ReferenceCell::get_hypercube<dim>(),
                        ExcNotImplemented());
 
                 // this line has children
@@ -3281,7 +3281,7 @@ namespace GridTools
                 !cell->face(face)->at_boundary())
               {
                 Assert(cell->reference_cell_type() ==
-                         ReferenceCell::get_hypercube(dim),
+                         ReferenceCell::get_hypercube<dim>(),
                        ExcNotImplemented());
 
                 // this face has hanging nodes
index e2fbe37a485bc298f2ae94950740fd8fed74f952..e3dd0b8b20d7b87b3c5a51e1f4e4a56915e7779d 100644 (file)
@@ -77,7 +77,7 @@ namespace GridTools
     Cache(const Triangulation<dim, spacedim> &tria,
           const Mapping<dim, spacedim> &      mapping =
             ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-              ReferenceCell::get_hypercube(dim)));
+              ReferenceCell::get_hypercube<dim>()));
 
     /**
      * Destructor.
index 12a6b8cd407840d1e241ebc7665eb4bf416515d2..0a33f62393d25be81b6420b2767f57702f666a08 100644 (file)
@@ -366,8 +366,9 @@ namespace ReferenceCell
    * Return the correct simplex reference cell type for the given dimension
    * @p dim.
    */
-  inline Type
-  get_simplex(const unsigned int dim)
+  template <int dim>
+  inline const Type &
+  get_simplex()
   {
     switch (dim)
       {
@@ -389,8 +390,9 @@ namespace ReferenceCell
    * Return the correct hypercube reference cell type for the given dimension
    * @p dim.
    */
-  inline Type
-  get_hypercube(const unsigned int dim)
+  template <int dim>
+  inline const Type &
+  get_hypercube()
   {
     switch (dim)
       {
@@ -445,7 +447,7 @@ namespace ReferenceCell
                                 const unsigned int i) const
   {
     AssertDimension(dim, get_dimension());
-    if (*this == get_hypercube(dim))
+    if (*this == get_hypercube<dim>())
       return GeometryInfo<dim>::d_linear_shape_function(xi, i);
 
     if (*this == Type::Tri) // see also Simplex::ScalarPolynomial::compute_value
@@ -533,7 +535,7 @@ namespace ReferenceCell
                                          const unsigned int i) const
   {
     AssertDimension(dim, get_dimension());
-    if (*this == get_hypercube(dim))
+    if (*this == get_hypercube<dim>())
       return GeometryInfo<dim>::d_linear_shape_function_gradient(xi, i);
 
     if (*this == Type::Tri) // see also Simplex::ScalarPolynomial::compute_grad
@@ -563,7 +565,7 @@ namespace ReferenceCell
     AssertDimension(dim, get_dimension());
     AssertIndexRange(i, dim - 1);
 
-    if (*this == get_hypercube(dim))
+    if (*this == get_hypercube<dim>())
       {
         AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
         return GeometryInfo<dim>::unit_tangential_vectors[face_no][i];
@@ -638,7 +640,7 @@ namespace ReferenceCell
   {
     AssertDimension(dim, reference_cell.get_dimension());
 
-    if (reference_cell == get_hypercube(dim))
+    if (reference_cell == get_hypercube<dim>())
       {
         AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
         return GeometryInfo<dim>::unit_normal_vector[face_no];
index 98c48fe75606c8e4a7108766b40f051e1ab22d8e..29c506c4545d7d7cc0921e4430fc2202f7b9eaa2 100644 (file)
@@ -1756,7 +1756,8 @@ namespace internal
         Assert(index < dim, ExcInternalError());
 
         if ((reference_cell_type == ReferenceCell::Type::Invalid ||
-             reference_cell_type == ReferenceCell::get_hypercube(dim)) == false)
+             reference_cell_type == ReferenceCell::get_hypercube<dim>()) ==
+            false)
           {
 #ifdef DEAL_II_WITH_SIMPLEX_SUPPORT
             return index;
index 32ad86d9fc01f58eee9c46b8c65f8e30367b1b77..bf45d40edbc02911892ea1444edfd5db38ba8797 100644 (file)
@@ -1481,7 +1481,7 @@ MatrixFree<dim, Number, VectorizedArrayType>::initialize_indices(
              ++fe_no)
           shape_info_dummy(c, fe_no).reinit(
             dof_handlers[no]->get_fe(fe_no).reference_cell_type() ==
-                ReferenceCell::get_hypercube(dim) ?
+                ReferenceCell::get_hypercube<dim>() ?
               quad :
               quad_simplex,
             dof_handlers[no]->get_fe(fe_no),
index 9a0bcf9b71eddad1328a137eea4fa22100c48a84..6b36dc12bc3c85462227f3ad495e0d52e0127c0e 100644 (file)
@@ -316,7 +316,8 @@ namespace internal
 
           try
             {
-              const auto reference_cell_type = ReferenceCell::get_simplex(dim);
+              const auto reference_cell_type =
+                ReferenceCell::get_simplex<dim>();
 
               const auto quad_face  = get_face_quadrature(quad);
               this->n_q_points_face = quad_face.size();
index b952a11fc22bb29ef865ac3d67cd94a433505805..1c948d1b12edbc5ff8bbb278575c3b9587b7984a 100644 (file)
@@ -281,7 +281,7 @@ namespace VectorTools
     AffineConstraints<double> &   constraints,
     const Mapping<dim, spacedim> &mapping =
       ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-        ReferenceCell::get_hypercube(dim)));
+        ReferenceCell::get_hypercube<dim>()));
 
   /**
    * This function does the same as the
@@ -304,7 +304,7 @@ namespace VectorTools
     AffineConstraints<double> &         constraints,
     const Mapping<dim, spacedim> &      mapping =
       ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-        ReferenceCell::get_hypercube(dim)));
+        ReferenceCell::get_hypercube<dim>()));
 
   /**
    * Compute the constraints that correspond to boundary conditions of the
@@ -333,7 +333,7 @@ namespace VectorTools
     AffineConstraints<double> &   constraints,
     const Mapping<dim, spacedim> &mapping =
       ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-        ReferenceCell::get_hypercube(dim)));
+        ReferenceCell::get_hypercube<dim>()));
 
   /**
    * Same as above for homogeneous tangential-flux constraints.
@@ -352,7 +352,7 @@ namespace VectorTools
     AffineConstraints<double> &         constraints,
     const Mapping<dim, spacedim> &      mapping =
       ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-        ReferenceCell::get_hypercube(dim)));
+        ReferenceCell::get_hypercube<dim>()));
 
   //@}
 } // namespace VectorTools
index 3fdf7a4d6fc5df04d30924c075c79f70685212dc..0f0c5a6ae2275bd3ab6ff44fec8d9cca13e3ed72 100644 (file)
@@ -184,7 +184,7 @@ namespace VectorTools
       Quadrature<dim> quadrature_mf;
 
       if (dof.get_fe(0).reference_cell_type() ==
-          ReferenceCell::get_hypercube(dim))
+          ReferenceCell::get_hypercube<dim>())
         quadrature_mf = QGauss<dim>(dof.get_fe().degree + 2);
       else
         // TODO: since we have currently only implemented a handful quadrature
index 994ef896ed146eb2c160dd9d2db41a6165a7c702..ca1c12d62170cff656c629e527a65013ced96c4a 100644 (file)
@@ -70,7 +70,7 @@ namespace Particles
       ParticleHandler<dim, spacedim> &    particle_handler,
       const Mapping<dim, spacedim> &      mapping =
         ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-          ReferenceCell::get_hypercube(dim)));
+          ReferenceCell::get_hypercube<dim>()));
 
     /**
      * A function that generates one particle at a random location in cell @p cell and with
@@ -109,7 +109,7 @@ namespace Particles
       std::mt19937 &                random_number_generator,
       const Mapping<dim, spacedim> &mapping =
         ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-          ReferenceCell::get_hypercube(dim)));
+          ReferenceCell::get_hypercube<dim>()));
 
     /**
      * A function that generates particles randomly in the domain with a
@@ -165,7 +165,7 @@ namespace Particles
       ParticleHandler<dim, spacedim> &    particle_handler,
       const Mapping<dim, spacedim> &      mapping =
         ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-          ReferenceCell::get_hypercube(dim)),
+          ReferenceCell::get_hypercube<dim>()),
       const unsigned int random_number_seed = 5432);
 
 
@@ -212,7 +212,7 @@ namespace Particles
       ParticleHandler<dim, spacedim> &particle_handler,
       const Mapping<dim, spacedim> &  mapping =
         ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-          ReferenceCell::get_hypercube(dim)),
+          ReferenceCell::get_hypercube<dim>()),
       const ComponentMask &                   components = ComponentMask(),
       const std::vector<std::vector<double>> &properties = {});
 
@@ -257,7 +257,7 @@ namespace Particles
       ParticleHandler<dim, spacedim> &particle_handler,
       const Mapping<dim, spacedim> &  mapping =
         ReferenceCell::get_default_linear_mapping<dim, spacedim>(
-          ReferenceCell::get_hypercube(dim)),
+          ReferenceCell::get_hypercube<dim>()),
       const std::vector<std::vector<double>> &properties = {});
   } // namespace Generators
 } // namespace Particles
index 5e266f128b0a35c9688f24c5be890778bb474e2d..300918747cbfb2c305af7cbfff3979d28cb6b4e9 100644 (file)
@@ -294,7 +294,7 @@ namespace DataOutBase
                                         n_data_sets,
                                       patch.data.n_rows()));
           Assert(patch.reference_cell_type !=
-                     ReferenceCell::get_hypercube(dim) ||
+                     ReferenceCell::get_hypercube<dim>() ||
                    (n_data_sets == 0) ||
                    (patch.data.n_cols() ==
                     Utilities::fixed_power<dim>(n_subdivisions + 1)),
@@ -616,7 +616,7 @@ namespace
 
     if (write_higher_order_cells)
       {
-        if (patch.reference_cell_type == ReferenceCell::get_hypercube(dim))
+        if (patch.reference_cell_type == ReferenceCell::get_hypercube<dim>())
           {
             const std::array<unsigned int, 4> cell_type_by_dim{
               {VTK_VERTEX,
@@ -667,7 +667,7 @@ namespace
         vtk_cell_id[0] = VTK_PYRAMID;
         vtk_cell_id[1] = 1;
       }
-    else if (patch.reference_cell_type == ReferenceCell::get_hypercube(dim))
+    else if (patch.reference_cell_type == ReferenceCell::get_hypercube<dim>())
       {
         const std::array<unsigned int, 4> cell_type_by_dim{
           {VTK_VERTEX, VTK_LINE, VTK_QUAD, VTK_HEXAHEDRON}};
@@ -679,7 +679,7 @@ namespace
         Assert(false, ExcNotImplemented());
       }
 
-    if (patch.reference_cell_type != ReferenceCell::get_hypercube(dim) ||
+    if (patch.reference_cell_type != ReferenceCell::get_hypercube<dim>() ||
         write_higher_order_cells)
       vtk_cell_id[2] = patch.data.n_cols();
     else
@@ -915,7 +915,7 @@ namespace
     for (const auto &patch : patches)
       {
         // The following formula doesn't hold for non-tensor products.
-        if (patch.reference_cell_type == ReferenceCell::get_hypercube(dim))
+        if (patch.reference_cell_type == ReferenceCell::get_hypercube<dim>())
           {
             n_nodes += Utilities::fixed_power<dim>(patch.n_subdivisions + 1);
             n_cells += Utilities::fixed_power<dim>(patch.n_subdivisions);
@@ -946,7 +946,7 @@ namespace
     for (const auto &patch : patches)
       {
         // The following formulas don't hold for non-tensor products.
-        if (patch.reference_cell_type == ReferenceCell::get_hypercube(dim))
+        if (patch.reference_cell_type == ReferenceCell::get_hypercube<dim>())
           {
             n_nodes += Utilities::fixed_power<dim>(patch.n_subdivisions + 1);
 
@@ -1862,7 +1862,7 @@ namespace DataOutBase
     : patch_index(no_neighbor)
     , n_subdivisions(1)
     , points_are_available(false)
-    , reference_cell_type(ReferenceCell::get_hypercube(dim))
+    , reference_cell_type(ReferenceCell::get_hypercube<dim>())
   // all the other data has a constructor of its own, except for the "neighbors"
   // field, which we set to invalid values.
   {
@@ -1964,7 +1964,7 @@ namespace DataOutBase
   Patch<0, spacedim>::Patch()
     : patch_index(no_neighbor)
     , points_are_available(false)
-    , reference_cell_type(ReferenceCell::get_hypercube(0))
+    , reference_cell_type(ReferenceCell::get_hypercube<0>())
   {
     Assert(spacedim <= 3, ExcNotImplemented());
   }
@@ -2627,7 +2627,7 @@ namespace DataOutBase
         // special treatment of simplices since they are not subdivided, such
         // that no new nodes have to be created, but the precomputed ones can be
         // used
-        if (patch.reference_cell_type != ReferenceCell::get_hypercube(dim))
+        if (patch.reference_cell_type != ReferenceCell::get_hypercube<dim>())
           {
             Point<spacedim> node;
 
@@ -2671,7 +2671,7 @@ namespace DataOutBase
     for (const auto &patch : patches)
       {
         // special treatment of simplices since they are not subdivided
-        if (patch.reference_cell_type != ReferenceCell::get_hypercube(dim))
+        if (patch.reference_cell_type != ReferenceCell::get_hypercube<dim>())
           {
             out.write_cell_single(count++,
                                   first_vertex_of_patch,
@@ -8643,8 +8643,25 @@ namespace
 std::string
 XDMFEntry::get_xdmf_content(const unsigned int indent_level) const
 {
-  return get_xdmf_content(indent_level,
-                          ReferenceCell::get_hypercube(dimension));
+  switch (dimension)
+    {
+      case 0:
+        return get_xdmf_content(indent_level,
+                                ReferenceCell::get_hypercube<0>());
+      case 1:
+        return get_xdmf_content(indent_level,
+                                ReferenceCell::get_hypercube<1>());
+      case 2:
+        return get_xdmf_content(indent_level,
+                                ReferenceCell::get_hypercube<2>());
+      case 3:
+        return get_xdmf_content(indent_level,
+                                ReferenceCell::get_hypercube<3>());
+      default:
+        Assert(false, ExcNotImplemented());
+    }
+
+  return "";
 }
 
 
index 6f96aed15ce83a10452f7974c8f3b61f5cf11d61..1b0a60e397f2125cc4033c225ff833bb78219dd4 100644 (file)
@@ -1159,7 +1159,7 @@ Quadrature<dim>
 QProjector<dim>::project_to_child(const Quadrature<dim> &quadrature,
                                   const unsigned int     child_no)
 {
-  return project_to_child(ReferenceCell::get_hypercube(dim),
+  return project_to_child(ReferenceCell::get_hypercube<dim>(),
                           quadrature,
                           child_no);
 }
@@ -1172,7 +1172,7 @@ QProjector<dim>::project_to_child(const ReferenceCell::Type reference_cell_type,
                                   const Quadrature<dim> &   quadrature,
                                   const unsigned int        child_no)
 {
-  Assert(reference_cell_type == ReferenceCell::get_hypercube(dim),
+  Assert(reference_cell_type == ReferenceCell::get_hypercube<dim>(),
          ExcNotImplemented());
   (void)reference_cell_type;
 
@@ -1202,7 +1202,8 @@ template <int dim>
 Quadrature<dim>
 QProjector<dim>::project_to_all_children(const Quadrature<dim> &quadrature)
 {
-  return project_to_all_children(ReferenceCell::get_hypercube(dim), quadrature);
+  return project_to_all_children(ReferenceCell::get_hypercube<dim>(),
+                                 quadrature);
 }
 
 
@@ -1213,7 +1214,7 @@ QProjector<dim>::project_to_all_children(
   const ReferenceCell::Type reference_cell_type,
   const Quadrature<dim> &   quadrature)
 {
-  Assert(reference_cell_type == ReferenceCell::get_hypercube(dim),
+  Assert(reference_cell_type == ReferenceCell::get_hypercube<dim>(),
          ExcNotImplemented());
   (void)reference_cell_type;
 
@@ -1245,7 +1246,10 @@ QProjector<dim>::project_to_line(const Quadrature<1> &quadrature,
                                  const Point<dim> &   p1,
                                  const Point<dim> &   p2)
 {
-  return project_to_line(ReferenceCell::get_hypercube(dim), quadrature, p1, p2);
+  return project_to_line(ReferenceCell::get_hypercube<dim>(),
+                         quadrature,
+                         p1,
+                         p2);
 }
 
 
@@ -1257,7 +1261,7 @@ QProjector<dim>::project_to_line(const ReferenceCell::Type reference_cell_type,
                                  const Point<dim> &        p1,
                                  const Point<dim> &        p2)
 {
-  Assert(reference_cell_type == ReferenceCell::get_hypercube(dim),
+  Assert(reference_cell_type == ReferenceCell::get_hypercube<dim>(),
          ExcNotImplemented());
   (void)reference_cell_type;
 
@@ -1286,7 +1290,7 @@ QProjector<dim>::DataSetDescriptor::face(const unsigned int face_no,
                                          const bool         face_rotation,
                                          const unsigned int n_quadrature_points)
 {
-  return face(ReferenceCell::get_hypercube(dim),
+  return face(ReferenceCell::get_hypercube<dim>(),
               face_no,
               face_orientation,
               face_flip,
@@ -1319,7 +1323,7 @@ QProjector<dim>::DataSetDescriptor::face(
         }
     }
 
-  Assert(reference_cell_type == ReferenceCell::get_hypercube(dim),
+  Assert(reference_cell_type == ReferenceCell::get_hypercube<dim>(),
          ExcNotImplemented());
 
   Assert(face_no < GeometryInfo<dim>::faces_per_cell, ExcInternalError());
@@ -1438,7 +1442,7 @@ QProjector<dim>::DataSetDescriptor::face(
         }
     }
 
-  Assert(reference_cell_type == ReferenceCell::get_hypercube(dim),
+  Assert(reference_cell_type == ReferenceCell::get_hypercube<dim>(),
          ExcNotImplemented());
 
   Assert(face_no < GeometryInfo<dim>::faces_per_cell, ExcInternalError());
@@ -1901,7 +1905,7 @@ Quadrature<dim>
 QProjector<dim>::project_to_face(const SubQuadrature &quadrature,
                                  const unsigned int   face_no)
 {
-  return project_to_face(ReferenceCell::get_hypercube(dim),
+  return project_to_face(ReferenceCell::get_hypercube<dim>(),
                          quadrature,
                          face_no);
 }
@@ -1914,7 +1918,7 @@ QProjector<dim>::project_to_face(const ReferenceCell::Type reference_cell_type,
                                  const SubQuadrature &     quadrature,
                                  const unsigned int        face_no)
 {
-  Assert(reference_cell_type == ReferenceCell::get_hypercube(dim),
+  Assert(reference_cell_type == ReferenceCell::get_hypercube<dim>(),
          ExcNotImplemented());
   (void)reference_cell_type;
 
@@ -1932,7 +1936,7 @@ QProjector<dim>::project_to_subface(const SubQuadrature &          quadrature,
                                     const unsigned int             subface_no,
                                     const RefinementCase<dim - 1> &ref_case)
 {
-  return project_to_subface(ReferenceCell::get_hypercube(dim),
+  return project_to_subface(ReferenceCell::get_hypercube<dim>(),
                             quadrature,
                             face_no,
                             subface_no,
@@ -1950,7 +1954,7 @@ QProjector<dim>::project_to_subface(
   const unsigned int             subface_no,
   const RefinementCase<dim - 1> &ref_case)
 {
-  Assert(reference_cell_type == ReferenceCell::get_hypercube(dim),
+  Assert(reference_cell_type == ReferenceCell::get_hypercube<dim>(),
          ExcNotImplemented());
   (void)reference_cell_type;
 
index 56974a0d9bc51b8fe4c6b3ce1415eb1d013efca0..b8c57c48bfcc7776a0528871fba54d0d4952c447 100644 (file)
@@ -380,9 +380,8 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order)
   const QGauss<1>            reference_edge_quadrature(order + 1);
   const unsigned int         n_edge_points = reference_edge_quadrature.size();
   const Quadrature<dim - 1> &edge_quadrature =
-    QProjector<dim - 1>::project_to_all_faces(ReferenceCell::get_hypercube(dim -
-                                                                           1),
-                                              reference_edge_quadrature);
+    QProjector<dim - 1>::project_to_all_faces(
+      ReferenceCell::get_hypercube<dim - 1>(), reference_edge_quadrature);
 
   if (order > 0)
     {
@@ -415,7 +414,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order)
                                                          q_point] =
               edge_quadrature.point(
                 QProjector<dim - 1>::DataSetDescriptor::face(
-                  ReferenceCell::get_hypercube(dim - 1),
+                  ReferenceCell::get_hypercube<dim - 1>(),
                   line,
                   true,
                   false,
@@ -516,7 +515,7 @@ FE_Nedelec<3>::initialize_support_points(const unsigned int order)
                                                          q_point] =
               edge_quadrature.point(
                 QProjector<dim - 1>::DataSetDescriptor::face(
-                  ReferenceCell::get_hypercube(dim - 1),
+                  ReferenceCell::get_hypercube<dim - 1>(),
                   line,
                   true,
                   false,
index 99b7e325be7c679be05e44146b17eb9c07f1bcd3..70936e79cec7d3a53b1d5cf0a9796325f0448c01 100644 (file)
@@ -51,7 +51,7 @@ FE_Nothing<dim, spacedim>::FE_Nothing(const ReferenceCell::Type &type,
 template <int dim, int spacedim>
 FE_Nothing<dim, spacedim>::FE_Nothing(const unsigned int n_components,
                                       const bool         dominate)
-  : FE_Nothing<dim, spacedim>(ReferenceCell::get_hypercube(dim),
+  : FE_Nothing<dim, spacedim>(ReferenceCell::get_hypercube<dim>(),
                               n_components,
                               dominate)
 {}
@@ -75,7 +75,7 @@ FE_Nothing<dim, spacedim>::get_name() const
   namebuf << "FE_Nothing<" << Utilities::dim_string(dim, spacedim) << ">(";
 
   std::vector<std::string> name_components;
-  if (this->reference_cell_type() != ReferenceCell::get_hypercube(dim))
+  if (this->reference_cell_type() != ReferenceCell::get_hypercube<dim>())
     name_components.push_back(this->reference_cell_type().to_string());
   if (this->n_components() > 1)
     name_components.push_back(std::to_string(this->n_components()));
index 890ef9ed136ddfc8a66dff863b29cbc730332969..4b61a9fc0e40efe4d8d3ae35bb87d7453ca24e80 100644 (file)
@@ -263,22 +263,22 @@ struct FE_Q_Base<PolynomialType, xdim, xspacedim>::Implementation
 
         // line 5: use line 9
         QProjector<dim - 1>::project_to_subface(
-          ReferenceCell::get_hypercube(dim - 1), qline, 0, 0, p_line);
+          ReferenceCell::get_hypercube<dim - 1>(), qline, 0, 0, p_line);
         for (unsigned int i = 0; i < n; ++i)
           constraint_points.push_back(p_line[i] + Point<dim - 1>(0.5, 0));
         // line 6: use line 10
         QProjector<dim - 1>::project_to_subface(
-          ReferenceCell::get_hypercube(dim - 1), qline, 0, 1, p_line);
+          ReferenceCell::get_hypercube<dim - 1>(), qline, 0, 1, p_line);
         for (unsigned int i = 0; i < n; ++i)
           constraint_points.push_back(p_line[i] + Point<dim - 1>(0.5, 0));
         // line 7: use line 13
         QProjector<dim - 1>::project_to_subface(
-          ReferenceCell::get_hypercube(dim - 1), qline, 2, 0, p_line);
+          ReferenceCell::get_hypercube<dim - 1>(), qline, 2, 0, p_line);
         for (unsigned int i = 0; i < n; ++i)
           constraint_points.push_back(p_line[i] + Point<dim - 1>(0, 0.5));
         // line 8: use line 14
         QProjector<dim - 1>::project_to_subface(
-          ReferenceCell::get_hypercube(dim - 1), qline, 2, 1, p_line);
+          ReferenceCell::get_hypercube<dim - 1>(), qline, 2, 1, p_line);
         for (unsigned int i = 0; i < n; ++i)
           constraint_points.push_back(p_line[i] + Point<dim - 1>(0, 0.5));
 
@@ -291,7 +291,7 @@ struct FE_Q_Base<PolynomialType, xdim, xspacedim>::Implementation
                ++subface)
             {
               QProjector<dim - 1>::project_to_subface(
-                ReferenceCell::get_hypercube(dim - 1),
+                ReferenceCell::get_hypercube<dim - 1>(),
                 qline,
                 face,
                 subface,
index 745a44ebdb5df6af042928e87180cd6065add537..70cfc44890f25d0cf3b0aae53c62630e8e4e8508 100644 (file)
@@ -118,7 +118,7 @@ MappingCartesian<dim, spacedim>::get_face_data(
 
   std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
     std::make_unique<InternalData>(
-      QProjector<dim>::project_to_all_faces(ReferenceCell::get_hypercube(dim),
+      QProjector<dim>::project_to_all_faces(ReferenceCell::get_hypercube<dim>(),
                                             quadrature[0]));
   auto &data = dynamic_cast<InternalData &>(*data_ptr);
 
@@ -144,7 +144,7 @@ MappingCartesian<dim, spacedim>::get_subface_data(
 {
   std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
     std::make_unique<InternalData>(QProjector<dim>::project_to_all_subfaces(
-      ReferenceCell::get_hypercube(dim), quadrature));
+      ReferenceCell::get_hypercube<dim>(), quadrature));
   auto &data = dynamic_cast<InternalData &>(*data_ptr);
 
   // verify that we have computed the transitive hull of the required
@@ -227,7 +227,7 @@ MappingCartesian<dim, spacedim>::maybe_update_face_quadrature_points(
   if (data.update_each & update_quadrature_points)
     {
       const auto offset = QProjector<dim>::DataSetDescriptor::face(
-        ReferenceCell::get_hypercube(dim),
+        ReferenceCell::get_hypercube<dim>(),
         face_no,
         cell->face_orientation(face_no),
         cell->face_flip(face_no),
@@ -260,7 +260,7 @@ MappingCartesian<dim, spacedim>::maybe_update_subface_quadrature_points(
   if (data.update_each & update_quadrature_points)
     {
       const auto offset = QProjector<dim>::DataSetDescriptor::subface(
-        ReferenceCell::get_hypercube(dim),
+        ReferenceCell::get_hypercube<dim>(),
         face_no,
         sub_no,
         cell->face_orientation(face_no),
index bb21ab4fa8d4e33429693db180d98720196f1dfc..bf64cef3058a36e46b2903e218ad87423f5692e1 100644 (file)
@@ -625,7 +625,7 @@ MappingFEField<dim, spacedim, VectorType, void>::get_face_data(
     std::make_unique<InternalData>(euler_dof_handler->get_fe(), fe_mask);
   auto &                data = dynamic_cast<InternalData &>(*data_ptr);
   const Quadrature<dim> q(
-    QProjector<dim>::project_to_all_faces(ReferenceCell::get_hypercube(dim),
+    QProjector<dim>::project_to_all_faces(ReferenceCell::get_hypercube<dim>(),
                                           quadrature[0]));
   this->compute_face_data(update_flags, q, quadrature[0].size(), data);
 
@@ -642,9 +642,8 @@ MappingFEField<dim, spacedim, VectorType, void>::get_subface_data(
   std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
     std::make_unique<InternalData>(euler_dof_handler->get_fe(), fe_mask);
   auto &                data = dynamic_cast<InternalData &>(*data_ptr);
-  const Quadrature<dim> q(
-    QProjector<dim>::project_to_all_subfaces(ReferenceCell::get_hypercube(dim),
-                                             quadrature));
+  const Quadrature<dim> q(QProjector<dim>::project_to_all_subfaces(
+    ReferenceCell::get_hypercube<dim>(), quadrature));
   this->compute_face_data(update_flags, q, quadrature.size(), data);
 
   return data_ptr;
@@ -1695,25 +1694,25 @@ MappingFEField<dim, spacedim, VectorType, void>::fill_fe_face_values(
 
   update_internal_dofs(cell, data);
 
-  internal::MappingFEFieldImplementation::do_fill_fe_face_values<dim,
-                                                                 spacedim,
-                                                                 VectorType>(
-    *this,
-    cell,
-    face_no,
-    numbers::invalid_unsigned_int,
-    QProjector<dim>::DataSetDescriptor::face(ReferenceCell::get_hypercube(dim),
-                                             face_no,
-                                             cell->face_orientation(face_no),
-                                             cell->face_flip(face_no),
-                                             cell->face_rotation(face_no),
-                                             quadrature[0].size()),
-    quadrature[0],
-    data,
-    euler_dof_handler->get_fe(),
-    fe_mask,
-    fe_to_real,
-    output_data);
+  internal::MappingFEFieldImplementation::
+    do_fill_fe_face_values<dim, spacedim, VectorType>(
+      *this,
+      cell,
+      face_no,
+      numbers::invalid_unsigned_int,
+      QProjector<dim>::DataSetDescriptor::face(
+        ReferenceCell::get_hypercube<dim>(),
+        face_no,
+        cell->face_orientation(face_no),
+        cell->face_flip(face_no),
+        cell->face_rotation(face_no),
+        quadrature[0].size()),
+      quadrature[0],
+      data,
+      euler_dof_handler->get_fe(),
+      fe_mask,
+      fe_to_real,
+      output_data);
 }
 
 
@@ -1736,28 +1735,27 @@ MappingFEField<dim, spacedim, VectorType, void>::fill_fe_subface_values(
 
   update_internal_dofs(cell, data);
 
-  internal::MappingFEFieldImplementation::do_fill_fe_face_values<dim,
-                                                                 spacedim,
-                                                                 VectorType>(
-    *this,
-    cell,
-    face_no,
-    numbers::invalid_unsigned_int,
-    QProjector<dim>::DataSetDescriptor::subface(ReferenceCell::get_hypercube(
-                                                  dim),
-                                                face_no,
-                                                subface_no,
-                                                cell->face_orientation(face_no),
-                                                cell->face_flip(face_no),
-                                                cell->face_rotation(face_no),
-                                                quadrature.size(),
-                                                cell->subface_case(face_no)),
-    quadrature,
-    data,
-    euler_dof_handler->get_fe(),
-    fe_mask,
-    fe_to_real,
-    output_data);
+  internal::MappingFEFieldImplementation::
+    do_fill_fe_face_values<dim, spacedim, VectorType>(
+      *this,
+      cell,
+      face_no,
+      numbers::invalid_unsigned_int,
+      QProjector<dim>::DataSetDescriptor::subface(
+        ReferenceCell::get_hypercube<dim>(),
+        face_no,
+        subface_no,
+        cell->face_orientation(face_no),
+        cell->face_flip(face_no),
+        cell->face_rotation(face_no),
+        quadrature.size(),
+        cell->subface_case(face_no)),
+      quadrature,
+      data,
+      euler_dof_handler->get_fe(),
+      fe_mask,
+      fe_to_real,
+      output_data);
 }
 
 
index 95fe8a941985fda656d836d57a5c8467437445a4..bc67670abb91c592f1c3a472f867c2caae2de03d 100644 (file)
@@ -292,7 +292,7 @@ MappingManifold<dim, spacedim>::get_face_data(
   auto &data = dynamic_cast<InternalData &>(*data_ptr);
   data.initialize_face(this->requires_update_flags(update_flags),
                        QProjector<dim>::project_to_all_faces(
-                         ReferenceCell::get_hypercube(dim), quadrature[0]),
+                         ReferenceCell::get_hypercube<dim>(), quadrature[0]),
                        quadrature[0].size());
 
   return data_ptr;
@@ -311,7 +311,7 @@ MappingManifold<dim, spacedim>::get_subface_data(
   auto &data = dynamic_cast<InternalData &>(*data_ptr);
   data.initialize_face(this->requires_update_flags(update_flags),
                        QProjector<dim>::project_to_all_subfaces(
-                         ReferenceCell::get_hypercube(dim), quadrature),
+                         ReferenceCell::get_hypercube<dim>(), quadrature),
                        quadrature.size());
 
   return data_ptr;
@@ -1227,12 +1227,13 @@ MappingManifold<dim, spacedim>::fill_fe_face_values(
     cell,
     face_no,
     numbers::invalid_unsigned_int,
-    QProjector<dim>::DataSetDescriptor::face(ReferenceCell::get_hypercube(dim),
-                                             face_no,
-                                             cell->face_orientation(face_no),
-                                             cell->face_flip(face_no),
-                                             cell->face_rotation(face_no),
-                                             quadrature[0].size()),
+    QProjector<dim>::DataSetDescriptor::face(
+      ReferenceCell::get_hypercube<dim>(),
+      face_no,
+      cell->face_orientation(face_no),
+      cell->face_flip(face_no),
+      cell->face_rotation(face_no),
+      quadrature[0].size()),
     quadrature[0],
     data,
     output_data);
@@ -1261,15 +1262,15 @@ MappingManifold<dim, spacedim>::fill_fe_subface_values(
     cell,
     face_no,
     subface_no,
-    QProjector<dim>::DataSetDescriptor::subface(ReferenceCell::get_hypercube(
-                                                  dim),
-                                                face_no,
-                                                subface_no,
-                                                cell->face_orientation(face_no),
-                                                cell->face_flip(face_no),
-                                                cell->face_rotation(face_no),
-                                                quadrature.size(),
-                                                cell->subface_case(face_no)),
+    QProjector<dim>::DataSetDescriptor::subface(
+      ReferenceCell::get_hypercube<dim>(),
+      face_no,
+      subface_no,
+      cell->face_orientation(face_no),
+      cell->face_flip(face_no),
+      cell->face_rotation(face_no),
+      quadrature.size(),
+      cell->subface_case(face_no)),
     quadrature,
     data,
     output_data);
index ee9ea85dc25ed8b2a6b8a7e699b73a1c15b8d27a..d52f46d86b86e365d2464f66d3e4321965a02675 100644 (file)
@@ -885,7 +885,7 @@ MappingQGeneric<dim, spacedim>::get_face_data(
   auto &data = dynamic_cast<InternalData &>(*data_ptr);
   data.initialize_face(this->requires_update_flags(update_flags),
                        QProjector<dim>::project_to_all_faces(
-                         ReferenceCell::get_hypercube(dim), quadrature[0]),
+                         ReferenceCell::get_hypercube<dim>(), quadrature[0]),
                        quadrature[0].size());
 
   return data_ptr;
@@ -904,7 +904,7 @@ MappingQGeneric<dim, spacedim>::get_subface_data(
   auto &data = dynamic_cast<InternalData &>(*data_ptr);
   data.initialize_face(this->requires_update_flags(update_flags),
                        QProjector<dim>::project_to_all_subfaces(
-                         ReferenceCell::get_hypercube(dim), quadrature),
+                         ReferenceCell::get_hypercube<dim>(), quadrature),
                        quadrature.size());
 
   return data_ptr;
@@ -1169,12 +1169,13 @@ MappingQGeneric<dim, spacedim>::fill_fe_face_values(
     cell,
     face_no,
     numbers::invalid_unsigned_int,
-    QProjector<dim>::DataSetDescriptor::face(ReferenceCell::get_hypercube(dim),
-                                             face_no,
-                                             cell->face_orientation(face_no),
-                                             cell->face_flip(face_no),
-                                             cell->face_rotation(face_no),
-                                             quadrature[0].size()),
+    QProjector<dim>::DataSetDescriptor::face(
+      ReferenceCell::get_hypercube<dim>(),
+      face_no,
+      cell->face_orientation(face_no),
+      cell->face_flip(face_no),
+      cell->face_rotation(face_no),
+      quadrature[0].size()),
     quadrature[0],
     data,
     output_data);
@@ -1216,15 +1217,15 @@ MappingQGeneric<dim, spacedim>::fill_fe_subface_values(
     cell,
     face_no,
     subface_no,
-    QProjector<dim>::DataSetDescriptor::subface(ReferenceCell::get_hypercube(
-                                                  dim),
-                                                face_no,
-                                                subface_no,
-                                                cell->face_orientation(face_no),
-                                                cell->face_flip(face_no),
-                                                cell->face_rotation(face_no),
-                                                quadrature.size(),
-                                                cell->subface_case(face_no)),
+    QProjector<dim>::DataSetDescriptor::subface(
+      ReferenceCell::get_hypercube<dim>(),
+      face_no,
+      subface_no,
+      cell->face_orientation(face_no),
+      cell->face_flip(face_no),
+      cell->face_rotation(face_no),
+      quadrature.size(),
+      cell->subface_case(face_no)),
     quadrature,
     data,
     output_data);
index 4dba26b001103160499274dfeba2fdb639255b8f..db3fe29da4b3478d620e32d0535cd44a7d95576e 100644 (file)
@@ -895,7 +895,7 @@ FlatManifold<dim, spacedim>::normal_vector(
 
   const auto face_reference_cell_type = face->reference_cell_type();
 
-  if (face_reference_cell_type == ReferenceCell::get_hypercube(facedim))
+  if (face_reference_cell_type == ReferenceCell::get_hypercube<facedim>())
     {
       for (unsigned int i = 0; i < facedim; ++i)
         xi[i] = 1. / 2;
index 9e473a05923de5f9ebc4483ecb659ba5e8aa4ce4..e0c923af1fcaaa691b2c3ab5e389a27f5425f2e0 100644 (file)
@@ -50,7 +50,7 @@ namespace ReferenceCell
   {
     AssertDimension(dim, reference_cell.get_dimension());
 
-    if (reference_cell == get_hypercube(dim))
+    if (reference_cell == get_hypercube<dim>())
       {
         GridGenerator::hyper_cube(tria, 0, 1);
       }
@@ -123,7 +123,7 @@ namespace ReferenceCell
   {
     AssertDimension(dim, reference_cell.get_dimension());
 
-    if (reference_cell == get_hypercube(dim))
+    if (reference_cell == get_hypercube<dim>())
       return std::make_unique<MappingQGeneric<dim, spacedim>>(degree);
     else if (reference_cell == Type::Tri || reference_cell == Type::Tet)
       return std::make_unique<MappingFE<dim, spacedim>>(
@@ -149,7 +149,7 @@ namespace ReferenceCell
   {
     AssertDimension(dim, reference_cell.get_dimension());
 
-    if (reference_cell == get_hypercube(dim))
+    if (reference_cell == get_hypercube<dim>())
       {
         return StaticMappingQ1<dim, spacedim>::mapping;
       }
@@ -208,7 +208,7 @@ namespace ReferenceCell
   {
     AssertDimension(dim, reference_cell.get_dimension());
 
-    if (reference_cell == get_hypercube(dim))
+    if (reference_cell == get_hypercube<dim>())
       return QGauss<dim>(n_points_1D);
     else if (reference_cell == Type::Tri || reference_cell == Type::Tet)
       return Simplex::QGauss<dim>(n_points_1D);
@@ -235,7 +235,7 @@ namespace ReferenceCell
       return Quadrature<dim>(tria.get_vertices());
     };
 
-    if (reference_cell == get_hypercube(dim))
+    if (reference_cell == get_hypercube<dim>())
       {
         static Quadrature<dim> quadrature = create_quadrature(reference_cell);
         return quadrature;
index cf30f4e3565175c9da92c881c623933c6d51f595..09bd146f76404948142da19c400208b8798d39a9 100644 (file)
@@ -13535,7 +13535,7 @@ Triangulation<dim, spacedim>::all_reference_cell_types_are_hyper_cube() const
 {
   return (this->reference_cell_types.size() == 0) ||
          (this->reference_cell_types.size() == 1 &&
-          this->reference_cell_types[0] == ReferenceCell::get_hypercube(dim));
+          this->reference_cell_types[0] == ReferenceCell::get_hypercube<dim>());
 }
 
 
index 09d532ae6ff2f64c811f37e767ecc8c6ff05ca1d..c52eee597e3b5c91a81d21d19bae11d3b3ba995e 100644 (file)
@@ -165,7 +165,7 @@ namespace MGTools
         // TODO: This assumes that the dofs per face on all faces coincide!
         const unsigned int face_no = 0;
 
-        Assert(fe.reference_cell_type() == ReferenceCell::get_hypercube(dim),
+        Assert(fe.reference_cell_type() == ReferenceCell::get_hypercube<dim>(),
                ExcNotImplemented());
 
         unsigned int increment =
@@ -345,7 +345,7 @@ namespace MGTools
 
         // TODO: This assumes that the dofs per face on all faces coincide!
         const unsigned int face_no = 0;
-        Assert(fe.reference_cell_type() == ReferenceCell::get_hypercube(dim),
+        Assert(fe.reference_cell_type() == ReferenceCell::get_hypercube<dim>(),
                ExcNotImplemented());
 
         Assert(couplings.n_rows() == fe.n_components(),
index 3b3dd505ed70ce1d5e26f8a7d177aa86b8e834c2..6798abcb1f46a3ffc279e9cb938aa65eca8e8fb1 100644 (file)
@@ -148,7 +148,7 @@ DataOut<dim, DoFHandlerType>::build_one_patch(
        (cell_and_index->first->at_boundary() ||
         (DoFHandlerType::dimension != DoFHandlerType::space_dimension))) ||
       (cell_and_index->first->reference_cell_type() !=
-       ReferenceCell::get_hypercube(dim)))
+       ReferenceCell::get_hypercube<dim>()))
     {
       Assert(patch.space_dim == DoFHandlerType::space_dimension,
              ExcInternalError());
index 883087fd21b03bf40f9dbda63feb18525cae355f..712ca481fefd8d45237d9153bd5940d448d0efcc 100644 (file)
@@ -47,7 +47,7 @@ process(const std::vector<Point<spacedim>> &vertices,
 
   AssertDimension(reference_cell_types.size(), 1);
 
-  if (reference_cell_types[0] == ReferenceCell::get_simplex(dim))
+  if (reference_cell_types[0] == ReferenceCell::get_simplex<dim>())
     mapping = std::make_shared<MappingFE<dim>>(Simplex::FE_P<dim>(1));
   else if (reference_cell_types[0] == ReferenceCell::Type::Wedge)
     mapping = std::make_shared<MappingFE<dim>>(Simplex::FE_WedgeP<dim>(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.