From bdd751294ae5ef6dc177e93496300f1088ea99c3 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 6 Oct 2011 20:21:36 +0000 Subject: [PATCH] Bump time only at the very end of the time step. This makes sure that the timer output appears only *after* each 100th time step, not before. git-svn-id: https://svn.dealii.org/trunk@24542 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-32/step-32.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index 0cd1611cc5..cda74f4ff6 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -4324,9 +4324,6 @@ namespace Step32 (timestep_number % parameters.graphical_output_interval == 0)) output_results (); - time += time_step; - ++timestep_number; - // In order to speed up linear // solvers, we extrapolate the // solutions from the old time levels @@ -4338,12 +4335,16 @@ namespace Step32 // last iteration, so if we reached // the final time, we stop here. // - // As the last thing during a time step, - // we check whether the current time - // step number is divisible by 100, - // which is when we let the computing - // timer print a summary of CPU times - // spent up to that point. + // As the last thing during a + // time step (before actually + // bumping up the number of + // the time step), we check + // whether the current time + // step number is divisible + // by 100, and if so we let + // the computing timer print + // a summary of CPU times + // spent so far. if (time > parameters.end_time * EquationData::year_in_seconds) break; @@ -4361,8 +4362,11 @@ namespace Step32 old_old_temperature_solution); } - if (timestep_number % 100 == 0) + if ((timestep_number > 0) && (timestep_number % 100 == 0)) computing_timer.print_summary (); + + time += time_step; + ++timestep_number; } while (true); -- 2.39.5