]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use range-based for loop 8665/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 29 Aug 2019 04:18:31 +0000 (00:18 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 29 Aug 2019 04:22:14 +0000 (00:22 -0400)
source/distributed/tria.cc

index bb9473154d31c43419f19c7c4709c16b5937ae89..b12a32101b98ba536b560ada1b9295b38b2c304e 100644 (file)
@@ -4592,18 +4592,12 @@ namespace parallel
       Assert(this->n_levels() == 1,
              ExcMessage("The triangulation is refined!"));
 
-      using FaceVector =
-        std::vector<dealii::GridTools::PeriodicFacePair<cell_iterator>>;
-      typename FaceVector::const_iterator it, periodic_end;
-      it           = periodicity_vector.begin();
-      periodic_end = periodicity_vector.end();
-
-      for (; it < periodic_end; ++it)
+      for (const auto &face_pair : periodicity_vector)
         {
-          const cell_iterator first_cell  = it->cell[0];
-          const cell_iterator second_cell = it->cell[1];
-          const unsigned int  face_left   = it->face_idx[0];
-          const unsigned int  face_right  = it->face_idx[1];
+          const cell_iterator first_cell  = face_pair.cell[0];
+          const cell_iterator second_cell = face_pair.cell[1];
+          const unsigned int  face_left   = face_pair.face_idx[0];
+          const unsigned int  face_right  = face_pair.face_idx[1];
 
           // respective cells of the matching faces in p4est
           const unsigned int tree_left =
@@ -4620,7 +4614,7 @@ namespace parallel
 
           unsigned int p4est_orientation = 0;
           if (dim == 2)
-            p4est_orientation = it->orientation[1];
+            p4est_orientation = face_pair.orientation[1];
           else
             {
               const unsigned int  face_idx_list[] = {face_left, face_right};
@@ -4681,9 +4675,9 @@ namespace parallel
                                                             {1, 0, 3, 2},
                                                             {1, 3, 0, 2}};
               const unsigned int     second_dealii_idx_on_face =
-                lower_idx == 0 ? left_to_right[it->orientation.to_ulong()]
+                lower_idx == 0 ? left_to_right[face_pair.orientation.to_ulong()]
                                               [first_dealii_idx_on_face] :
-                                 right_to_left[it->orientation.to_ulong()]
+                                 right_to_left[face_pair.orientation.to_ulong()]
                                               [first_dealii_idx_on_face];
               const unsigned int second_dealii_idx_on_cell =
                 GeometryInfo<dim>::face_to_cell_vertices(

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.