From: Wolfgang Bangerth Date: Wed, 27 Dec 2023 22:45:07 +0000 (-0700) Subject: Avoid 'continue' in one place. X-Git-Tag: relicensing~221^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16377%2Fhead;p=dealii.git Avoid 'continue' in one place. --- diff --git a/source/grid/tria_description.cc b/source/grid/tria_description.cc index f9949f09d6..dd55686641 100644 --- a/source/grid/tria_description.cc +++ b/source/grid/tria_description.cc @@ -975,25 +975,28 @@ namespace TriangulationDescription // Make sure we know about all of the owners of the active cells, // whether locally owned or not. Then we traverse the triangulation - // from the finest level to the coarsest level: + // from the finest level to the coarsest level. + // + // On each level, traverse the cell. If the cell is not locally + // owned, we don't care about it. If it is active, we copy the + // owner process from the cell's non-level owner. Otherwise, + // use the owner of the first cell. partition.update_ghost_values(); for (int level = tria.n_global_levels() - 1; level >= 0; --level) { - // On each level, traverse the cell. If the cell is not locally - // owned, we don't care about it. If it is active, we copy the - // owner process from the cell's non-level owner. Otherwise, - // use the owner of the first cell for (const auto &cell : tria.cell_iterators_on_level(level)) { - if (cell->is_locally_owned_on_level() == false) - continue; - else if (cell->is_active()) - partitions_mg[level][cell->global_level_cell_index()] = - partition[cell->global_active_cell_index()]; - else - partitions_mg[level][cell->global_level_cell_index()] = - partitions_mg[level + 1] - [cell->child(0)->global_level_cell_index()]; + if (cell->is_locally_owned_on_level()) + { + if (cell->is_active()) + partitions_mg[level][cell->global_level_cell_index()] = + partition[cell->global_active_cell_index()]; + else + partitions_mg[level][cell->global_level_cell_index()] = + partitions_mg[level + 1] + [cell->child(0) + ->global_level_cell_index()]; + } } // Having touched all of the locally owned cells on the