]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Output time and time step in step-26.
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 30 Mar 2020 17:00:42 +0000 (11:00 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 30 Mar 2020 17:00:42 +0000 (11:00 -0600)
examples/step-26/step-26.cc

index cc09e8e8358575e340dff13a27c041ef9e4decb2..8c2f7ef4a358cdab898ab614713128340eacf2fb 100644 (file)
@@ -291,7 +291,9 @@ namespace Step26
 
   // @sect4{<code>HeatEquation::output_results</code>}
   //
-  // 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 <int dim>
   void HeatEquation<dim>::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);

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.