From: schrage
The parameter handler allows you to specify that any parameter @@ -213,7 +213,7 @@ be of a distinct type. Upon reading a file the value of this parameter is checked against the type and an exception is thrown if they do not match. An exception is also thrown if the default -parameter if the default parameter does not match the specified type. +parameter does not match the specified type. Below we show a list of the types available. The first column gives an explanation, the second lists the corresponding C++ type and the third column shows how to use this type in deal.II. @@ -281,20 +281,79 @@ multiple lines.
Leading and trailing whitespace is ignored and multiple whitespace is condensed into one. Entry or subsection -declarations in your code should therefore +declarations within your code should therefore not contain multiple whitespace, which will not be recognized.
+You can obtain data from three different kinds of source:
+istream
+It is possible to use different sources successively. Parameters +that are entered more than once will be overwritten, i.e. the +value encountered last of the parameter in question is used. +
+ +
+Example:
+We read parameters successively
+from three different sources. This example was taken from
+the ParameterHandler
class documentation.
+
+
+ParameterHandler prm;
+...
+// declaration of entries
+...
+prm.read_input (cin); // read input from standard in,
+// or
+prm.read_input ("simulation.in");
+// or
+char *in = "set Time step size = 0.3 \n ...";
+prm.read_input (in);
+...
+
+
+You can, for example for logging purposes, write all the parameters
+your code knows about to an ostream
in a given format.
+The formats supported at present are text and LaTeX.
+The method handling this is called:
+
+ostream & ParameterHandler::print_parameters(ostream &out, const OutputStyle style)
+
+
+You can also write the parameters of a single subsection to an
+ostream
using
+
+void ParameterHandler::print_parameters_section (ostream &out,
+ const OutputStyle style,
+ const unsigned int indent_level);
+
+In both cases out
is the ostream
+the parameters are written to, style
is
+the output format, either
+text or LaTeX. In the case of subsections
+the indent_level
is the level of indentation.
+