]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use preincrement consistently
authorDaniel Arndt <arndtd@ornl.gov>
Sat, 11 May 2019 17:34:53 +0000 (13:34 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 11 May 2019 17:35:40 +0000 (13:35 -0400)
examples/step-42/step-42.cc

index 23db5134cb65d8a18fd18a546f7bd9ade1721d72..ad4b53b5a8c48b70c30190f4f701ee5b8dfce970 100644 (file)
@@ -461,7 +461,7 @@ namespace Step42
 
       AssertThrow(nx > 0 && ny > 0, ExcMessage("Invalid file format."));
 
-      for (int k = 0; k < nx * ny; k++)
+      for (int k = 0; k < nx * ny; ++k)
         {
           double val;
           f >> val;
@@ -1048,7 +1048,7 @@ namespace Step42
 
       const unsigned int start = (newton_rhs.local_range().first),
                          end   = (newton_rhs.local_range().second);
-      for (unsigned int j = start; j < end; j++)
+      for (unsigned int j = start; j < end; ++j)
         diag_mass_matrix_vector(j) = mass_matrix.diag_element(j);
       diag_mass_matrix_vector.compress(VectorOperation::insert);
 
@@ -1175,7 +1175,7 @@ namespace Step42
 
               cell->get_dof_indices(local_dof_indices);
 
-              for (unsigned int i = 0; i < dofs_per_cell; i++)
+              for (unsigned int i = 0; i < dofs_per_cell; ++i)
                 mass_matrix.add(local_dof_indices[i],
                                 local_dof_indices[i],
                                 cell_matrix(i, i));
@@ -1814,7 +1814,7 @@ namespace Step42
           }
         else
           {
-            for (unsigned int i = 0; i < 5; i++)
+            for (unsigned int i = 0; i < 5; ++i)
               {
                 distributed_solution = solution;
 

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.