From: bangerth Date: Mon, 6 Nov 2006 04:27:57 +0000 (+0000) Subject: Don't stack output; the results are huge and not very illuminating. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2576a3bfb2e80b82ab89a45547ceae99612d31d7;p=dealii-svn.git Don't stack output; the results are huge and not very illuminating. git-svn-id: https://svn.dealii.org/trunk@14156 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-25/step-25.cc b/deal.II/examples/step-25/step-25.cc index 428ff70a7c..c59d449278 100644 --- a/deal.II/examples/step-25/step-25.cc +++ b/deal.II/examples/step-25/step-25.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -46,10 +47,10 @@ #include #include #include -#include + #include #include -#include + // The last step is as in all // previous programs: @@ -107,8 +108,6 @@ class SineGordonProblem Vector massmatxvel; Vector system_rhs; - DataOutStack data_out_stack; - static const unsigned int output_timestep_skip = 1; static const int n_global_refinements = 6; }; @@ -661,45 +660,12 @@ void SineGordonProblem::output_results (const unsigned int timestep_number) data_out.add_data_vector (solution, "u"); data_out.build_patches (); - std::ostringstream filename; - filename << "solution-" << dim << "d-"; - - // Pad the time step number in - // filename with zeros in the - // beginning so that the files are - // ordered correctly in the shell - // and we can generate a good - // animation using convert. - if (timestep_number<10) - filename << "0000" << timestep_number; - else if (timestep_number<100) - filename << "000" << timestep_number; - else if (timestep_number<1000) - filename << "00" << timestep_number; - else if (timestep_number<10000) - filename << "0" << timestep_number; - else - filename << timestep_number; - - // We output the solution at the - // desired times in - // vtk format, so that - // we can use VisIt to make plots - // and/or animations. - filename << ".vtk"; - std::ofstream output (filename.str().c_str()); - data_out.write_vtk (output); + const std::string filename = "solution-" + + Utilities::int_to_string (timestep_number, 3) + + ".vtk"; - // We also store the current - // solution in our instantiation of - // a DataOutStack - // object, so that we can make a - // space-time plot of the solution. - data_out_stack.new_parameter_value (time, time_step*output_timestep_skip); - data_out_stack.attach_dof_handler (dof_handler); - data_out_stack.add_data_vector (solution, "solution"); - data_out_stack.build_patches (1); - data_out_stack.finish_parameter_value (); + std::ofstream output (filename.c_str()); + data_out.write_vtk (output); } // @sect4{SineGordonProblem::run} @@ -713,9 +679,6 @@ void SineGordonProblem::output_results (const unsigned int timestep_number) template void SineGordonProblem::run () { - data_out_stack.declare_data_vector ("solution", - DataOutStack::dof_vector); - std::cout << "Solving problem in " << dim << " space dimensions." << std::endl; @@ -865,15 +828,6 @@ void SineGordonProblem::run () compute_nl_term (old_solution, solution, tmp_vector); massmatxvel.add (-time_step, tmp_vector); } - - // Finally, we output the sequence - // of solutions stored - // data_out_stack to a - // file of the appropriate format. - std::ostringstream filename; - filename << "solution-" << dim << "d-" << "stacked" << ".vtk"; - std::ofstream output (filename.str().c_str()); - data_out_stack.write_vtk (output); } // @sect3{The main function}