]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Revert "Move make_triangulation into ReferenceCell::Type"
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 28 Jan 2021 17:46:40 +0000 (10:46 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 29 Jan 2021 18:31:57 +0000 (11:31 -0700)
This reverts commit c14ccdb17608b9bfbcc8db4773b14c28a51a3c8a.

include/deal.II/fe/fe_tools.templates.h
include/deal.II/grid/reference_cell.h
source/grid/reference_cell.cc
source/grid/reference_cell.inst.in
tests/simplex/orientation_02.cc

index eb13a193d4865f61ed2a0af1675fd59f0a4ac54b..4e3edf8a9274d875a8ccfa8f4807e0ac7f49c04f 100644 (file)
@@ -1605,7 +1605,7 @@ namespace FETools
 
     // First, create a local mass matrix for the unit cell
     Triangulation<dim, spacedim> tr;
-    reference_cell_type.make_triangulation(tr);
+    ReferenceCell::make_triangulation(reference_cell_type, tr);
 
     const auto &mapping =
       reference_cell_type.template get_default_linear_mapping<dim, spacedim>();
@@ -1814,7 +1814,7 @@ namespace FETools
         // Set up meshes, one with a single
         // reference cell and refine it once
         Triangulation<dim, spacedim> tria;
-        reference_cell_type.make_triangulation(tria);
+        ReferenceCell::make_triangulation(reference_cell_type, tria);
         tria.begin_active()->set_refine_flag(RefinementCase<dim>(ref_case));
         tria.execute_coarsening_and_refinement();
 
index 5266ad11602deb0b2b2d8af375cac75472bbe3ce..d54ed6352dde65891587f4e4139079e29a289c7e 100644 (file)
@@ -240,14 +240,6 @@ namespace ReferenceCell
     ArrayView<const unsigned int>
     faces_for_given_vertex(const unsigned int vertex) const;
 
-    /*
-     * Create a (coarse) grid with a single cell of the shape of this
-     * reference cell.
-     */
-    template <int dim, int spacedim>
-    void
-    make_triangulation(Triangulation<dim, spacedim> &tria) const;
-
   private:
     /**
      * The variable that stores what this object actually corresponds to.
@@ -720,6 +712,15 @@ namespace ReferenceCell
     return {};
   }
 
+  /*
+   * Create a (coarse) grid with a single cell of the shape of the provided
+   * reference cell.
+   */
+  template <int dim, int spacedim>
+  void
+  make_triangulation(const Type &                  reference_cell,
+                     Triangulation<dim, spacedim> &tria);
+
   /**
    * Return a default linear mapping that works for the given triangulation.
    * Internally, this function calls the function above for the reference
index a5caf7fd599bbe70359b56d55741be2e845d63f0..85c33d5b3fbeb01dfc25c242b4001d1f6876c828 100644 (file)
@@ -94,15 +94,16 @@ namespace ReferenceCell
 
   template <int dim, int spacedim>
   void
-  Type::make_triangulation(Triangulation<dim, spacedim> &tria) const
+  make_triangulation(const Type &                  reference_cell,
+                     Triangulation<dim, spacedim> &tria)
   {
-    AssertDimension(dim, this->get_dimension());
+    AssertDimension(dim, reference_cell.get_dimension());
 
-    if (this->is_hyper_cube())
+    if (reference_cell == Type::get_hypercube<dim>())
       {
         GridGenerator::hyper_cube(tria, 0, 1);
       }
-    else if ((dim == 2) && (*this == Tri))
+    else if ((dim == 2) && (reference_cell == Type::Tri))
       {
         const std::vector<Point<spacedim>> vertices = {
           Point<spacedim>(),               // the origin
@@ -115,7 +116,7 @@ namespace ReferenceCell
 
         tria.create_triangulation(vertices, cells, {});
       }
-    else if ((dim == 3) && (*this == Tet))
+    else if ((dim == 3) && (reference_cell == Type::Tet))
       {
         AssertDimension(spacedim, 3);
 
@@ -127,7 +128,7 @@ namespace ReferenceCell
 
         tria.create_triangulation(vertices, cells, {});
       }
-    else if ((dim == 3) && (*this == Pyramid))
+    else if ((dim == 3) && (reference_cell == Type::Pyramid))
       {
         AssertDimension(spacedim, 3);
 
@@ -143,7 +144,7 @@ namespace ReferenceCell
 
         tria.create_triangulation(vertices, cells, {});
       }
-    else if ((dim == 3) && (*this == Wedge))
+    else if ((dim == 3) && (reference_cell == Type::Wedge))
       {
         AssertDimension(spacedim, 3);
 
@@ -284,7 +285,7 @@ namespace ReferenceCell
 
     const auto create_quadrature = [](const Type &reference_cell) {
       Triangulation<dim> tria;
-      reference_cell.make_triangulation(tria);
+      make_triangulation(reference_cell, tria);
 
       return Quadrature<dim>(tria.get_vertices());
     };
index 51149bca8b12737d8b0b7a5b47264dbdd941fceb..b232ba517a5a07cab6a37b3b6e50a421c55cf4e6 100644 (file)
@@ -16,8 +16,9 @@
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
-    template void Type::make_triangulation(
-      Triangulation<deal_II_dimension, deal_II_space_dimension> & tria) const;
+    template void make_triangulation(
+      const Type &                                               reference_cell,
+      Triangulation<deal_II_dimension, deal_II_space_dimension> &tria);
 
     template std::unique_ptr<
       Mapping<deal_II_dimension, deal_II_space_dimension>>
index 7916800d7f942790da97b2ade66f7783271339c0..c81eb0903f629e796ead306513da953e938f211a 100644 (file)
@@ -29,7 +29,7 @@ test(const unsigned int orientation)
 
 
   Triangulation<3> dummy, tria;
-  ReferenceCell::Type::Tet.make_triangulation(dummy);
+  ReferenceCell::make_triangulation(ReferenceCell::Type::Tet, dummy);
 
   auto vertices = dummy.get_vertices();
 

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.