]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid 'continue' in one place. 16377/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 27 Dec 2023 22:45:07 +0000 (15:45 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 27 Dec 2023 22:45:07 +0000 (15:45 -0700)
source/grid/tria_description.cc

index f9949f09d6b4142d4633e70d2c8b40cff8ed3fd7..dd55686641b6e5d308c64c6722594b92ed06c33b 100644 (file)
@@ -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

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.