From: wolf Date: Wed, 1 Sep 1999 07:38:59 +0000 (+0000) Subject: Change the 'Text' output format a little but such as to allow for the X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64e04fb954fe5b710d23dc49b64203c3b54cf511;p=dealii-svn.git Change the 'Text' output format a little but such as to allow for the later use as input again. git-svn-id: https://svn.dealii.org/trunk@1716 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/parameter_handler.h b/deal.II/base/include/base/parameter_handler.h index 1ba627fc22..a90ce0b4db 100644 --- a/deal.II/base/include/base/parameter_handler.h +++ b/deal.II/base/include/base/parameter_handler.h @@ -575,19 +575,23 @@ struct Patterns { * * Listing of Parameters * --------------------- - * Equation 1 = Poisson - * Equation 2 = Navier-Stokes - * Output file= out + * set Equation 1 = Poisson # Laplace + * set Equation 2 = Navier-Stokes # Elasticity + * set Output file = out * subsection Equation 1 - * Matrix type = 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 + * set Matrix type = Full # Sparse * subsection Linear solver - * Maximum number of iterations = 100 <20> - * Solver = 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); diff --git a/deal.II/base/source/parameter_handler.cc b/deal.II/base/source/parameter_handler.cc index bfb2ae2579..553ef7d13e 100644 --- a/deal.II/base/source/parameter_handler.cc +++ b/deal.II/base/source/parameter_handler.cc @@ -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}"