]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Move some of the dimension-independent functions into the DataOutBase base class.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Jul 2005 15:06:38 +0000 (15:06 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Jul 2005 15:06:38 +0000 (15:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@11041 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/data_out_base.h
deal.II/base/source/data_out_base.cc

index b022d67d6e1eca5b68f24e83ff1f8a847b74493e..138d4a1f1171bdbc2c945286db8213b9562e237e 100644 (file)
@@ -1396,6 +1396,63 @@ class DataOutBase
     };
     
                                     /**
+                                     * Provide a data type specifying
+                                     * the presently supported output
+                                     * formats.
+                                     */
+    enum OutputFormat {
+         default_format,
+                                          /**
+                                           * Output for IBM OpenDX.
+                                           */
+         dx,
+                                          /**
+                                           * Output in AVS UCD format.
+                                           */
+         ucd,
+                                          /**
+                                           * Output for the gnuplot tool.
+                                           */
+         gnuplot,
+                                          /**
+                                           * Output for the povray raytracer.
+                                           */
+         povray,
+                                          /**
+                                           * Output in encapsulated
+                                           * PostScript.
+                                           */
+         eps,
+                                          /**
+                                           * Output for GMV.
+                                           */
+         gmv,
+                                          /**
+                                           * Output for tecplot in
+                                           * text format.
+                                           */
+         
+         tecplot,
+                                          /**
+                                           * Output for tecplot in
+                                           * binaryformat. Faster and
+                                           * smaller than text
+                                           * format.
+                                           */
+         tecplot_binary,
+                                          /**
+                                           * Output in VTK format.
+                                           */
+         vtk,
+                                          /**
+                                           * Output in deal.II
+                                           * intermediate format.
+                                           */
+         deal_II_intermediate
+    };
+
+
+                                    /**
                                      * Write the given list of patches
                                      * to the output stream in OpenDX
                                      * format. See the general
@@ -1557,6 +1614,45 @@ class DataOutBase
     std::pair<unsigned int, unsigned int>
     determine_intermediate_format_dimensions (std::istream &input);
     
+                                    /**
+                                     * Return the <tt>OutputFormat</tt>
+                                     * value corresponding to the
+                                     * given string. If the string
+                                     * does not match any known
+                                     * format, an exception is
+                                     * thrown.
+                                     *
+                                     * Since this function does not
+                                     * need data from this object, it
+                                     * is static and can thus be
+                                     * called without creating an
+                                     * object of this class. Its main
+                                     * purpose is to allow a program
+                                     * to use any implemented output
+                                     * format without the need to
+                                     * extend the program's parser
+                                     * each time a new format is
+                                     * implemented.
+                                     *
+                                     * To get a list of presently
+                                     * available format names,
+                                     * e.g. to give it to the
+                                     * ParameterHandler class,
+                                     * use the function
+                                     * get_output_format_names().
+                                     */
+    static OutputFormat parse_output_format (const std::string &format_name);
+
+                                    /**
+                                     * Return a list of implemented
+                                     * output formats. The different
+                                     * names are separated by
+                                     * vertical bar signs (<tt>`|'</tt>)
+                                     * as used by the
+                                     * ParameterHandler classes.
+                                     */
+    static std::string get_output_format_names ();
+
                                     /**
                                      * Determine an estimate for
                                      * the memory consumption (in
@@ -1793,62 +1889,6 @@ template <int dim, int spacedim=dim>
 class DataOutInterface : private DataOutBase
 {
   public:
-                                    /**
-                                     * Provide a data type specifying
-                                     * the presently supported output
-                                     * formats.
-                                     */
-    enum OutputFormat {
-         default_format,
-                                          /**
-                                           * Output for IBM OpenDX.
-                                           */
-         dx,
-                                          /**
-                                           * Output in AVS UCD format.
-                                           */
-         ucd,
-                                          /**
-                                           * Output for the gnuplot tool.
-                                           */
-         gnuplot,
-                                          /**
-                                           * Output for the povray raytracer.
-                                           */
-         povray,
-                                          /**
-                                           * Output in encapsulated
-                                           * PostScript.
-                                           */
-         eps,
-                                          /**
-                                           * Output for GMV.
-                                           */
-         gmv,
-                                          /**
-                                           * Output for tecplot in
-                                           * text format.
-                                           */
-         
-         tecplot,
-                                          /**
-                                           * Output for tecplot in
-                                           * binaryformat. Faster and
-                                           * smaller than text
-                                           * format.
-                                           */
-         tecplot_binary,
-                                          /**
-                                           * Output in VTK format.
-                                           */
-         vtk,
-                                          /**
-                                           * Output in deal.II
-                                           * intermediate format.
-                                           */
-         deal_II_intermediate
-    };
-
                                      /**
                                       * Destructor. Does nothing, but is
                                       * declared virtual since this class has
@@ -2045,45 +2085,6 @@ class DataOutInterface : private DataOutBase
                                      */
     std::string default_suffix (const OutputFormat output_format = default_format) const;
 
-                                    /**
-                                     * Return the <tt>OutputFormat</tt>
-                                     * value corresponding to the
-                                     * given string. If the string
-                                     * does not match any known
-                                     * format, an exception is
-                                     * thrown.
-                                     *
-                                     * Since this function does not
-                                     * need data from this object, it
-                                     * is static and can thus be
-                                     * called without creating an
-                                     * object of this class. Its main
-                                     * purpose is to allow a program
-                                     * to use any implemented output
-                                     * format without the need to
-                                     * extend the program's parser
-                                     * each time a new format is
-                                     * implemented.
-                                     *
-                                     * To get a list of presently
-                                     * available format names,
-                                     * e.g. to give it to the
-                                     * ParameterHandler class,
-                                     * use the function
-                                     * get_output_format_names().
-                                     */
-    static OutputFormat parse_output_format (const std::string &format_name);
-
-                                    /**
-                                     * Return a list of implemented
-                                     * output formats. The different
-                                     * names are separated by
-                                     * vertical bar signs (<tt>`|'</tt>)
-                                     * as used by the
-                                     * ParameterHandler classes.
-                                     */
-    static std::string get_output_format_names ();
-
                                     /**
                                      * Declare parameters for all
                                      * output formats by declaring
index 281a45f02c1185d753e1c0666fad2a8b7514f359..20a5843d7ae33d5d8529b3fee02e4f9d2685b364 100644 (file)
@@ -557,6 +557,59 @@ unsigned int DataOutBase::memory_consumption ()
 
 
 
+
+DataOutBase::OutputFormat
+DataOutBase::
+parse_output_format (const std::string &format_name)
+{
+  if (format_name == "dx")
+    return dx;
+
+  if (format_name == "ucd")
+    return ucd;
+
+  if (format_name == "gnuplot")
+    return gnuplot;
+
+  if (format_name == "povray")
+    return povray;
+
+  if (format_name == "eps")
+    return eps;
+
+  if (format_name == "gmv")
+    return gmv;
+
+  if (format_name == "tecplot")
+    return tecplot;
+  
+  if (format_name == "tecplot_binary")
+    return tecplot_binary;
+  
+  if (format_name == "vtk")
+    return vtk;
+  
+  if (format_name == "deal.II intermediate")
+    return deal_II_intermediate;
+  
+  AssertThrow (false,
+               ExcMessage ((std::string("The format <") + format_name +
+                            std::string("> is not recognized")).c_str()));
+
+                                  // return something invalid
+  return OutputFormat(-1);
+}
+
+
+
+std::string
+DataOutBase::get_output_format_names ()
+{
+  return "dx|ucd|gnuplot|povray|eps|gmv|tecplot|vtk|deal.II intermediate";
+}
+
+
+
 template <int dim, int spacedim>
 void DataOutBase::write_ucd (const std::vector<Patch<dim,spacedim> > &patches,
                             const std::vector<std::string>          &data_names,
@@ -4382,60 +4435,6 @@ default_suffix (const OutputFormat output_format_) const
 
 
 
-template <int dim, int spacedim>
-typename DataOutInterface<dim,spacedim>::OutputFormat
-DataOutInterface<dim,spacedim>::
-parse_output_format (const std::string &format_name)
-{
-  if (format_name == "dx")
-    return dx;
-
-  if (format_name == "ucd")
-    return ucd;
-
-  if (format_name == "gnuplot")
-    return gnuplot;
-
-  if (format_name == "povray")
-    return povray;
-
-  if (format_name == "eps")
-    return eps;
-
-  if (format_name == "gmv")
-    return gmv;
-
-  if (format_name == "tecplot")
-    return tecplot;
-  
-  if (format_name == "tecplot_binary")
-    return tecplot_binary;
-  
-  if (format_name == "vtk")
-    return vtk;
-  
-  if (format_name == "deal.II intermediate")
-    return deal_II_intermediate;
-  
-  AssertThrow (false,
-               ExcMessage ((std::string("The format <") + format_name +
-                            std::string("> is not recognized")).c_str()));
-
-                                  // return something invalid
-  return OutputFormat(-1);
-}
-
-
-
-template <int dim, int spacedim>
-std::string
-DataOutInterface<dim,spacedim>::get_output_format_names ()
-{
-  return "dx|ucd|gnuplot|povray|eps|gmv|tecplot|vtk|deal.II intermediate";
-}
-
-
-
 template <int dim, int spacedim>
 void
 DataOutInterface<dim,spacedim>::declare_parameters (ParameterHandler &prm) 

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.