]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Simplify generating output.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 13 Apr 2012 09:55:05 +0000 (09:55 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 13 Apr 2012 09:55:05 +0000 (09:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@25411 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 3a111251fb86040bba96053f40bea35328a1792f..c5bfa569b8f2b3a945a69ec7e9c4c9316de8b80c 100644 (file)
@@ -19,6 +19,7 @@
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
 #include <deal.II/base/logstream.h>
+#include <deal.II/base/utilities.h>
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/sparse_matrix.h>
@@ -607,25 +608,13 @@ void Step15<dim>::run ()
 
                Assert (refinement < 100, ExcNotImplemented());
 
-               DataOutBase::EpsFlags vtk_flags;
-
                DataOut<dim> data_out;
-               data_out.set_flags (vtk_flags);
 
                data_out.attach_dof_handler (dof_handler);
                data_out.add_data_vector (newton_update, "update");
                data_out.add_data_vector (present_solution, "solution");
-               data_out.build_patches (6);
-               std::string filename = "solution-";
-               if(refinement<10)
-               {
-                 filename += ('0' + refinement);
-               }
-               else{
-                 filename += ('0' + refinement/10);
-                 filename += ('0' + refinement%10);
-               }
-               filename += ".vtk";
+               data_out.build_patches ();
+               const std::string filename = "solution-" + Utilities::int_to_string (refinement, 2) + ".vtk";
                std::ofstream output (filename.c_str());
                data_out.write_vtk (output);
 

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.