]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Also produce output after the last time step.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 13 Feb 2011 23:08:16 +0000 (23:08 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 13 Feb 2011 23:08:16 +0000 (23:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@23352 0785d39b-7218-0410-832d-ea1e28bc413d

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

index cc5339806017c25968368d2dfb5b85800c028e46..22f48f9a1ba63a28e19329c7ff2784684cc76626 100644 (file)
@@ -3555,6 +3555,13 @@ void BoussinesqFlowProblem<dim>::run (const std::string parameter_filename)
       time += time_step;
       ++timestep_number;
 
+                                      // if we are at the end of
+                                      // time, stop now
+      if (time > parameters.end_time * EquationData::year_in_seconds)
+       break;
+
+                                      // otherwise prepare for the
+                                      // next time step
       TrilinosWrappers::MPI::BlockVector old_old_stokes_solution (stokes_rhs);
       old_old_stokes_solution.block(0).reinit(old_stokes_solution.block(0),false,true);
       old_old_stokes_solution.block(1).reinit(old_stokes_solution.block(1),false,true);
@@ -3585,7 +3592,17 @@ void BoussinesqFlowProblem<dim>::run (const std::string parameter_filename)
          temperature_solution.reinit(distributed_temperature_solution, false, true);
        }
     }
-  while (time <= parameters.end_time * EquationData::year_in_seconds);
+  while (true);
+
+                                  // if we are generating graphical
+                                  // output, do so also for the last
+                                  // time step unless we had just
+                                  // done so before we left the
+                                  // do-while loop
+  if ((parameters.generate_graphical_output == true)
+      &&
+      (timestep_number % parameters.graphical_output_interval != 1))
+    output_results ();
 }
 
 

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.