From: Peter Munch Date: Sat, 2 Jan 2021 22:38:22 +0000 (+0100) Subject: Generalize GridGenerator::flatten_triangulation for simplex meshes X-Git-Tag: v9.3.0-rc1~685^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eb5b0d8e7901d19381275c050e0fc5742d6d403;p=dealii.git Generalize GridGenerator::flatten_triangulation for simplex meshes --- diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 852f918279..1c346a464e 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -7026,7 +7026,8 @@ namespace GridGenerator for (unsigned int id = 0; cell != endc; ++cell, ++id) { - for (const unsigned int i : GeometryInfo::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::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::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 =