]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
prepare for use of parameters
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 28 May 2014 17:52:32 +0000 (17:52 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 28 May 2014 17:52:32 +0000 (17:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@32986 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/numerics/dof_output_operator.h
deal.II/include/deal.II/numerics/dof_output_operator.templates.h

index b9f55a04a21ccdc043e6abc42e42de6e8a8c4751..983bec97a8e22b13a398be6870688f932e90d557 100644 (file)
 
 #include <deal.II/base/config.h>
 #include <deal.II/base/named_data.h>
+#include <deal.II/algorithms/any_data.h>
 #include <deal.II/base/event.h>
 #include <deal.II/algorithms/operator.h>
 #include <deal.II/dofs/dof_handler.h>
+#include <deal.II/numerics/data_out.h>
 
 #include <fstream>
 
@@ -58,9 +60,11 @@ namespace Algorithms
   private:
     SmartPointer<DoFHandler<dim, spacedim>,
                  DoFOutputOperator<VECTOR, dim, spacedim> > dof;
-
+      
       const std::string filename_base;
       const unsigned int digits;
+      
+      DataOut<dim> out;
   };
 
   template <class VECTOR, int dim, int spacedim>
index 2bdb0f72e3d9a9dcd2af654e7c3160c63aa1be5e..76285b16e41efe052eb5db2f544add9000691cce 100644 (file)
@@ -16,7 +16,6 @@
 
 
 #include <deal.II/numerics/dof_output_operator.h>
-#include <deal.II/numerics/data_out.h>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -29,7 +28,9 @@ namespace Algorithms
                  :
                  filename_base(filename_base),
                  digits(digits)
-  {}
+  {
+    out.set_default_format(DataOutBase::gnuplot);
+  }
   
 
   template <class VECTOR, int dim, int spacedim>
@@ -38,8 +39,6 @@ namespace Algorithms
     const AnyData &data)
   {
     Assert ((dof!=0), ExcNotInitialized());
-    DataOut<dim> out;
-    out.set_default_format(DataOutBase::gnuplot);
     out.attach_dof_handler (*dof);
     for (unsigned int i=0;i<data.size();++i)
       {
@@ -56,6 +55,7 @@ namespace Algorithms
     std::ofstream out_filename (streamOut.str().c_str());
     out.build_patches (2);
     out.write_gnuplot (out_filename);
+    out.clear ();
     return *this;
   }
 }

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.