From: Wolfgang Bangerth Date: Mon, 30 Mar 2020 17:00:42 +0000 (-0600) Subject: Output time and time step in step-26. X-Git-Tag: v9.2.0-rc1~323^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbb18d03158ebddafbf7f20ab1ed2a3e6f60e720;p=dealii.git Output time and time step in step-26. --- diff --git a/examples/step-26/step-26.cc b/examples/step-26/step-26.cc index cc09e8e835..8c2f7ef4a3 100644 --- a/examples/step-26/step-26.cc +++ b/examples/step-26/step-26.cc @@ -291,7 +291,9 @@ namespace Step26 // @sect4{HeatEquation::output_results} // - // Neither is there anything new in generating graphical output: + // Neither is there anything new in generating graphical output other than the + // fact that we tell the DataOut object what the current time and time step + // number is, so that this can be written into the output file: template void HeatEquation::output_results() const { @@ -302,6 +304,8 @@ namespace Step26 data_out.build_patches(); + data_out.set_flags(DataOutBase::VtkFlags(time, timestep_number)); + const std::string filename = "solution-" + Utilities::int_to_string(timestep_number, 3) + ".vtk"; std::ofstream output(filename);