From c6a61deaba39037ff10898702ce691dc1a5b7322 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 4 Feb 2024 10:16:16 -0700 Subject: [PATCH] More minor edits to tria_description.cc. --- source/grid/tria_description.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/source/grid/tria_description.cc b/source/grid/tria_description.cc index 5da8f51d3e..3fea01049a 100644 --- a/source/grid/tria_description.cc +++ b/source/grid/tria_description.cc @@ -463,26 +463,27 @@ namespace TriangulationDescription else (void)comm; - // helper function, which collects all vertices belonging to a cell - // (also taking into account periodicity) + // A helper function that marks the indices of all vertices belonging + // to a cell (also taking into account their periodic breathren) in + // the bit vector passed as second argument. const auto add_vertices_of_cell_to_vertices_owned_by_locally_owned_cells = [&coinciding_vertex_groups, &vertex_to_coinciding_vertex_group]( - const auto &cell, - std::vector &vertices_owned_by_locally_owned_cells) { - // add local vertices - for (const auto v : cell->vertex_indices()) + const typename dealii::Triangulation::cell_iterator + &cell, + std::vector &vertices_on_locally_owned_cells) { + for (const unsigned int v : cell->vertex_indices()) { - vertices_owned_by_locally_owned_cells[cell->vertex_index(v)] = - true; + const auto global_vertex_index = cell->vertex_index(v); + vertices_on_locally_owned_cells[global_vertex_index] = true; + const auto coinciding_vertex_group = - vertex_to_coinciding_vertex_group.find( - cell->vertex_index(v)); + vertex_to_coinciding_vertex_group.find(global_vertex_index); if (coinciding_vertex_group != vertex_to_coinciding_vertex_group.end()) for (const auto &co_vertex : coinciding_vertex_groups.at( coinciding_vertex_group->second)) - vertices_owned_by_locally_owned_cells[co_vertex] = true; + vertices_on_locally_owned_cells[co_vertex] = true; } }; -- 2.39.5