From: Wolfgang Bangerth Date: Sun, 26 Dec 2021 16:20:50 +0000 (-0700) Subject: More minor changes to GridGenerator::flatten_triangulation(). X-Git-Tag: v9.4.0-rc1~697^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be2c0fbdccbe80460c2458d6e38b9b5ab2ce0447;p=dealii.git More minor changes to GridGenerator::flatten_triangulation(). --- diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index b47c8a7a6e..98d965d395 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -7535,42 +7535,40 @@ namespace GridGenerator case 2: { - unsigned int f = 0; - subcelldata.boundary_lines.resize(in_tria.n_active_faces()); for (const auto &face : in_tria.active_face_iterators() | IteratorFilters::AtBoundary()) { - subcelldata.boundary_lines[f].vertices.resize( - face->n_vertices()); + CellData<1> boundary_line; + + boundary_line.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 = face->boundary_id(); - subcelldata.boundary_lines[f].manifold_id = face->manifold_id(); - ++f; + boundary_line.vertices[i] = face->vertex_index(i); + boundary_line.boundary_id = face->boundary_id(); + boundary_line.manifold_id = face->manifold_id(); + + subcelldata.boundary_lines.emplace_back( + std::move(boundary_line)); } - subcelldata.boundary_lines.resize(f); break; } case 3: { - unsigned int f = 0; - subcelldata.boundary_quads.resize(in_tria.n_active_faces()); for (const auto &face : in_tria.active_face_iterators() | IteratorFilters::AtBoundary()) { - subcelldata.boundary_quads[f].vertices.resize( - face->n_vertices()); + CellData<2> boundary_face; + + boundary_face.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 = face->boundary_id(); - subcelldata.boundary_quads[f].manifold_id = face->manifold_id(); - ++f; + boundary_face.vertices[i] = face->vertex_index(i); + boundary_face.boundary_id = face->boundary_id(); + boundary_face.manifold_id = face->manifold_id(); + + subcelldata.boundary_quads.emplace_back( + std::move(boundary_face)); } - subcelldata.boundary_quads.resize(f); break; }