]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Cleanup and clarify documentation of ParameterHandler and DataOut and simplify the...
authorTimo Heister <timo.heister@gmail.com>
Wed, 2 Mar 2011 16:49:33 +0000 (16:49 +0000)
committerTimo Heister <timo.heister@gmail.com>
Wed, 2 Mar 2011 16:49:33 +0000 (16:49 +0000)
git-svn-id: https://svn.dealii.org/trunk@23453 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-29/step-29.cc
deal.II/include/deal.II/base/data_out_base.h
deal.II/include/deal.II/base/parameter_handler.h

index cfe23252d3fd473dd0a951831a90a7b2ade3d2ad..ae8cb91c2663f2e0638dde102751ea575e4374ee 100644 (file)
@@ -1359,30 +1359,20 @@ void UltrasoundProblem<dim>::output_results () const
                                   // DataOut object accordingly.
   prm.enter_subsection("Output parameters");
 
-  const std::string output_file    = prm.get("Output file"),
-                   output_format  = prm.get("Output format");
+  const std::string output_file    = prm.get("Output file");
   data_out.parse_parameters(prm);
 
   prm.leave_subsection ();
 
-                                  // Since the ParameterHandler
-                                  // provides the output format
-                                  // parameter as a string, we need
-                                  // to convert it to a format flag
-                                  // that can be understood by the
-                                  // DataOut object.  The following
-                                  // function takes care of this:
-  DataOutBase::OutputFormat  format = DataOutBase::parse_output_format(output_format);
-
-                                  // Now we put together the filename
-                                  // from the base name provided by
-                                  // the ParameterHandler and the
-                                  // suffix which is derived from the
-                                  // format by the
-                                  // DataOutBase::default_suffix
-                                  // function:
+                                  // Now we put together the filename from
+                                  // the base name provided by the
+                                  // ParameterHandler and the suffix which is
+                                  // provided by the DataOut class (the
+                                  // default suffix is set to the right type
+                                  // that matches the one set in the .prm
+                                  // file through parse_parameters()):
   const std::string filename = output_file +
-                              DataOutBase::default_suffix(format);
+                              data_out.default_suffix();
 
   std::ofstream output (filename.c_str());
 
@@ -1411,7 +1401,7 @@ void UltrasoundProblem<dim>::output_results () const
                                   // the output format without having to
                                   // re-compile this program:
   data_out.build_patches ();
-  data_out.write (output, format);
+  data_out.write (output);
 
   timer.stop ();
   deallog << "done (" 
index 52235e9100cc4aa9c161297d98e9e7f10af63911..7a40abcc8a586d24ae99699611234a0ee7e6358f 100644 (file)
@@ -2425,7 +2425,12 @@ class DataOutInterface : private DataOutBase
                                      * the base class does; the only
                                      * exception being that if the parameter
                                      * is omitted, then the value for the
-                                     * present default format is returned.
+                                     * present default format is returned,
+                                     * i.e. the correct suffix for the format
+                                     * that was set through
+                                     * set_default_format() or
+                                     * parse_parameters() before calling this
+                                     * function.
                                      */
     std::string
     default_suffix (const OutputFormat output_format = default_format) const;
index 46ca2d6b9a7dd5185ce9b0c0305ea1c183228eea..f97c05df3c4a5e05f0877b34d30a80bf63305624 100644 (file)
@@ -113,7 +113,7 @@ namespace Patterns
                                        * bytes) of this object. To
                                        * avoid unnecessary
                                        * overhead, we do not force
-                                       * derivd classes to provide
+                                       * derived classes to provide
                                        * this function as a virtual
                                        * overloaded one, but rather
                                        * try to cast the present
@@ -778,7 +778,7 @@ namespace Patterns
   {
     public:
                                       /**
-                                       * Constrcuctor.
+                                       * Constructor.
                                        */
       Bool ();
 
@@ -1044,10 +1044,10 @@ namespace Patterns
  *   which provides at run-time for program parameters such as time step
  *   sizes, geometries, right hand sides etc. The input for the program is
  *   given in files, streams or strings in memory using text like
- *   @verbatim
+ *   @code
  *     set Time step size = 0.3
  *     set Geometry       = [0,1]x[0,3]
- *   @endverbatim
+ *   @endcode
  *   Input may be sorted into subsection trees in order to give the input a
  *   logical structure.
  *
@@ -1165,21 +1165,22 @@ namespace Patterns
  *   <h3>Input files and special characters</h3>
  *
  *   For the first example above the input file would look like the following:
- *   @verbatim
+ *   @code
  *     ...
  *     subsection Nonlinear solver
  *       set Nonlinear method = Gradient
+ *       # this is a comment
  *       subsection Linear solver
  *         set Solver                        = CG
  *         set Maxmimum number of iterations = 30
  *       end
  *     end
  *     ...                       # other stuff
- *   @endverbatim
+ *   @endcode
  *   The words <tt>subsection</tt>, <tt>set</tt> and <tt>end</tt> may be either written in lowercase or uppercase
  *   letters. Leading and trailing whitespace is removed, multiple whitespace is condensed into
  *   only one. Since the latter applies also to the name of an entry, an entry name will not
- *   be recognised if in the declaration multiple whitespace is used.
+ *   be recognized if in the declaration multiple whitespace is used.
  *
  *   In entry names and values the following characters are not allowed: <tt>\#</tt>, <tt>{</tt>,
  *   <tt>}</tt>, <tt>|</tt>. Their use is reserved for the MultipleParameterLoop class.
@@ -1197,7 +1198,7 @@ namespace Patterns
  *   In order to read input you can use three possibilities: reading from an
  *   <tt>std::istream</tt> object, reading from a file of which the name is
  *   given and reading from a string in memory in which the lines are
- *   separated by <tt>@\n</tt> characters. These possibilites are used as
+ *   separated by <tt>@\n</tt> characters. These possibilities are used as
  *   follows:
  *   @code
  *     ParameterHandler prm;
@@ -1466,7 +1467,7 @@ namespace Patterns
  *
  *
  *   This is the input file (named "prmtest.prm"):
- *   @verbatim
+ *   @code
  *                                 # first declare the types of equations
  *     set Equation 1 = Poisson
  *     set Equation 2 = Navier-Stokes
@@ -1486,10 +1487,10 @@ namespace Patterns
  *         set Maximum number of iterations = 100
  *       end
  *     end
- *   @endverbatim
+ *   @endcode
  *
- *   And here is the ouput of the program:
- *   @verbatim
+ *   And here is the output of the program:
+ *   @code
  *     Line 8:
  *         The entry value
  *             Gauss-Seidel
@@ -1526,7 +1527,7 @@ namespace Patterns
  *       Problem: outfile=out
  *                eq1=Poisson, eq2=Navier-Stokes
  *                Matrix1=Sparse, Matrix2=Full
- *   @endverbatim
+ *   @endcode
  *
  *
  *
@@ -1644,7 +1645,7 @@ namespace Patterns
  *
  *
  *   @ingroup input
- *   @author Wolfgang Bangerth, October 1997, revised February 1998, 2010
+ *   @author Wolfgang Bangerth, October 1997, revised February 1998, 2010, 2011
  */
 class ParameterHandler : public Subscriptor
 {

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.