]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change the 'Text' output format a little but such as to allow for the
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 1 Sep 1999 07:38:59 +0000 (07:38 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 1 Sep 1999 07:38:59 +0000 (07:38 +0000)
later use as input again.

git-svn-id: https://svn.dealii.org/trunk@1716 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 1ba627fc22148731382eb46513ed2d733c8aa4ca..a90ce0b4dbde3372db242abddaed1c7e6c284e2e 100644 (file)
@@ -575,19 +575,23 @@ struct Patterns {
  *
  *     Listing of Parameters
  *     ---------------------
- *       Equation 1  = Poisson  <Laplace>
- *       Equation 2  = Navier-Stokes  <Elasticity>
- *       Output file= out
+ *       set Equation 1  = Poisson  # Laplace
+ *       set Equation 2  = Navier-Stokes  # Elasticity
+ *       set Output file = out
  *       subsection Equation 1
- *         Matrix type = Sparse  <Sparse>
+ *         set Matrix type = Sparse  # Sparse
  *         subsection Linear solver
- *           Maximum number of iterations = 40  <20>
- *           Solver                      = CG
+ *           set Maximum number of iterations = 40  # 20
+ *           set Solver                       = CG
+ *         end
+ *       end
  *       subsection Equation 2
- *         Matrix type = Full  <Sparse>
+ *         set Matrix type = Full  # Sparse
  *         subsection Linear solver
- *           Maximum number of iterations = 100  <20>
- *           Solver                       = CG  <CG>
+ *           set Maximum number of iterations = 100  # 20
+ *           set Solver                       = CG   # CG
+ *         end
+ *       end
  *
  *
  *     Getting parameters:
@@ -719,10 +723,21 @@ class ParameterHandler
                                      * #bool#.
                                      */
     bool           get_bool (const string &entry_string) const;
+
                                     /**
                                      * Print all parameters with the given style
-                                     * to #out#. Presently only Text and LaTeX
+                                     * to #out#. Presently only #Text# and #LaTeX#
                                      * are implemented.
+                                     *
+                                     * In #Text# format, the output is formatted
+                                     * in such a way that it is possible to
+                                     * use it for later input again. This is most
+                                     * useful to record the parameters set for
+                                     * a specific run, since if you output the
+                                     * parameters using this function into a log
+                                     * file, you can always recover the results
+                                     * by simply copying the output to your
+                                     * input file.
                                      */
     ostream & print_parameters (ostream &out, const OutputStyle style);
 
index bfb2ae2579df4d27a2ede9438a263547a18a7a01..553ef7d13e7abe0ceafff2d8c0ea3d0841af0217 100644 (file)
@@ -484,8 +484,8 @@ ostream & ParameterHandler::print_parameters (ostream &out, OutputStyle style) {
 
 
 
-void ParameterHandler::print_parameters_section (ostream &out,
-                                                const OutputStyle style,
+void ParameterHandler::print_parameters_section (ostream           &out,
+                                                const OutputStyle  style,
                                                 const unsigned int indent_level) {
                                   // assert that only known formats are
                                   // given as "style"
@@ -515,12 +515,12 @@ void ParameterHandler::print_parameters_section (ostream &out,
          {
            case Text:
                  out << setw(indent_level*2) << ""
+                     << "set "
                      << ptr->first
                      << setw(longest_entry-ptr->first.length()+3) << " = "
                      << pc->entries[ptr->first].first
-                     << "  <"
+                     << "  #"
                      << pd->entries[ptr->first].first
-                     << ">"
                      << endl;
                  break;
            case LaTeX:
@@ -540,6 +540,7 @@ void ParameterHandler::print_parameters_section (ostream &out,
          {
            case Text:
                  out << setw(indent_level*2) << ""
+                     << "set "
                      << ptr->first
                      << setw(longest_entry-ptr->first.length()+2) << "= "
                      << ptr->second.first << endl;
@@ -582,6 +583,8 @@ void ParameterHandler::print_parameters_section (ostream &out,
       switch (style) 
        {
          case Text:
+               out << setw(indent_level*2) << ""
+                   << "end" << endl;
                break;
          case LaTeX:
                out << "\\end{itemize}"

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.