]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-69: Use commonly used name for time step number. 14862/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 9 Mar 2023 03:30:32 +0000 (20:30 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 9 Mar 2023 03:30:32 +0000 (20:30 -0700)
examples/step-69/step-69.cc

index c013a95546c01d5ee39a13cd9f145562e9493772..12b474bdcf75498226221f082200b1480eff4193 100644 (file)
@@ -2567,15 +2567,17 @@ namespace Step69
 
     print_head(pcout, "enter main loop");
 
-    for (unsigned int cycle = 1; t < t_final; ++cycle)
+    unsigned int timestep_number = 1;
+    while (t < t_final)
       {
         // We first print an informative status message
 
         std::ostringstream head;
         std::ostringstream secondary;
 
-        head << "Cycle  " << Utilities::int_to_string(cycle, 6) << "  (" //
-             << std::fixed << std::setprecision(1) << t / t_final * 100  //
+        head << "Cycle  " << Utilities::int_to_string(timestep_number, 6)
+             << "  ("                                                   //
+             << std::fixed << std::setprecision(1) << t / t_final * 100 //
              << "%)";
         secondary << "at time t = " << std::setprecision(8) << std::fixed << t;
 
@@ -2601,6 +2603,8 @@ namespace Step69
             output(U, base_name, t, output_cycle);
             ++output_cycle;
           }
+
+        ++timestep_number;
       }
 
     // We wait for any remaining background output thread to finish before

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.