From 5f32e0cf587d95e812f7022f273346accac211f2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 8 Mar 2023 20:30:32 -0700 Subject: [PATCH] step-69: Use commonly used name for time step number. --- examples/step-69/step-69.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/step-69/step-69.cc b/examples/step-69/step-69.cc index c013a95546..12b474bdcf 100644 --- a/examples/step-69/step-69.cc +++ b/examples/step-69/step-69.cc @@ -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 -- 2.39.5