From: Wolfgang Bangerth Date: Sun, 13 Feb 2011 23:08:16 +0000 (+0000) Subject: Also produce output after the last time step. X-Git-Tag: v8.0.0~4346 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4cc238d9113fbf1d0d028167e2526ea28b9df7c;p=dealii.git Also produce output after the last time step. git-svn-id: https://svn.dealii.org/trunk@23352 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index cc53398060..22f48f9a1b 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -3555,6 +3555,13 @@ void BoussinesqFlowProblem::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::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 (); }