]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Generalize GridGenerator::flatten_triangulation for simplex meshes 11454/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 2 Jan 2021 22:38:22 +0000 (23:38 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 2 Jan 2021 22:38:22 +0000 (23:38 +0100)
source/grid/grid_generator.cc

index 852f91827956e6be12a6ffc0cffebdd3cf2ada38..1c346a464e77ea95317453533c8aa2cd80036b41 100644 (file)
@@ -7026,7 +7026,8 @@ namespace GridGenerator
 
     for (unsigned int id = 0; cell != endc; ++cell, ++id)
       {
-        for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
+        cells[id].vertices.resize(cell->n_vertices());
+        for (const auto i : cell->vertex_indices())
           cells[id].vertices[i] = cell->vertex_index(i);
         cells[id].material_id = cell->material_id();
         cells[id].manifold_id = cell->manifold_id();
@@ -7048,9 +7049,9 @@ namespace GridGenerator
                 for (; face != endf; ++face)
                   if (face->at_boundary())
                     {
-                      for (unsigned int i = 0;
-                           i < GeometryInfo<dim>::vertices_per_face;
-                           ++i)
+                      subcelldata.boundary_lines[f].vertices.resize(
+                        face->n_vertices());
+                      for (const auto i : face->vertex_indices())
                         subcelldata.boundary_lines[f].vertices[i] =
                           face->vertex_index(i);
                       subcelldata.boundary_lines[f].boundary_id =
@@ -7068,9 +7069,9 @@ namespace GridGenerator
                 for (; face != endf; ++face)
                   if (face->at_boundary())
                     {
-                      for (unsigned int i = 0;
-                           i < GeometryInfo<dim>::vertices_per_face;
-                           ++i)
+                      subcelldata.boundary_quads[f].vertices.resize(
+                        face->n_vertices());
+                      for (const auto i : face->vertex_indices())
                         subcelldata.boundary_quads[f].vertices[i] =
                           face->vertex_index(i);
                       subcelldata.boundary_quads[f].boundary_id =

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.