]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bump time only at the very end of the time step. This makes sure that the timer outpu...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 6 Oct 2011 20:21:36 +0000 (20:21 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 6 Oct 2011 20:21:36 +0000 (20:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@24542 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-32/step-32.cc

index 0cd1611cc510306a07bcadc93da9e42315c1e80c..cda74f4ff670e4a3195266f28725177fa495958f 100644 (file)
@@ -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);
 

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.