]> https://gitweb.dealii.org/ - dealii.git/commitdiff
convert_hypercube_to_simplex_mesh(): combine the two templates.
authorDavid Wells <drwells@email.unc.edu>
Mon, 12 May 2025 21:27:56 +0000 (17:27 -0400)
committerDavid Wells <drwells@email.unc.edu>
Mon, 12 May 2025 21:27:56 +0000 (17:27 -0400)
include/deal.II/grid/grid_generator.h
source/grid/grid_generator.cc

index c081235abc16e724992de926b1d0b67b231f3f12..f2861d27a5bdcf35ba3947fee7465749b128d074 100644 (file)
@@ -2411,25 +2411,15 @@ namespace GridGenerator
    *
    * @note This function is available through the python interface as
    * `in_tria.convert_hypercube_to_simplex_mesh(out_tria)`.
+   *
+   * @note in 1d this function copies @p in_tria into @p out_tria since 1d
+   * elements (lines) are both hypercubes and simplices.
    */
   template <int dim, int spacedim>
   void
   convert_hypercube_to_simplex_mesh(const Triangulation<dim, spacedim> &in_tria,
                                     Triangulation<dim, spacedim> &out_tria);
 
-  // Doxygen will not show the function above if we include the
-  // specialization.
-#ifndef DOXYGEN
-  /**
-   * Specialization of the above function for 1d: simply copy triangulation.
-   */
-  template <int spacedim>
-  void
-  convert_hypercube_to_simplex_mesh(const Triangulation<1, spacedim> &in_tria,
-                                    Triangulation<1, spacedim>       &out_tria);
-#endif
-
-
   /**
    * Perform an Alfeld split (also called barycentric refinement) of a simplex
    * mesh.
index 139d78e6e236a78a452872a77aeb9879a5d1387b..20ca4031afc6af592d4992b413efee467beceeb4 100644 (file)
@@ -7993,7 +7993,12 @@ namespace GridGenerator
   convert_hypercube_to_simplex_mesh(const Triangulation<dim, spacedim> &in_tria,
                                     Triangulation<dim, spacedim> &out_tria)
   {
-    Assert(dim > 1, ExcNotImplemented());
+    if (dim == 1)
+      {
+        out_tria.copy_triangulation(in_tria);
+        return;
+      }
+
     AssertThrow(in_tria.all_reference_cells_are_hyper_cube(),
                 ExcMessage(
                   "GridGenerator::convert_hypercube_to_simplex_mesh() expects "
@@ -8410,17 +8415,6 @@ namespace GridGenerator
 
 
 
-  template <int spacedim>
-  void
-  convert_hypercube_to_simplex_mesh(const Triangulation<1, spacedim> &in_tria,
-                                    Triangulation<1, spacedim>       &out_tria)
-  {
-    out_tria.copy_triangulation(in_tria);
-    return;
-  }
-
-
-
   template <int dim, int spacedim>
   void
   alfeld_split_of_simplex_mesh(const Triangulation<dim, spacedim> &in_tria,

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.