dune-fem 2.8.0
|
#include <dune/fem/io/parameter/container.hh>
Classes | |
struct | DGFBlock |
Public Types | |
typedef BasicParameterReader< ParameterContainerData > | ThisType |
Public Member Functions | |
operator ParameterReader () const | |
cast into ParameterReader | |
void | append (int &argc, char **argv) |
add parameters from the command line | |
void | append (const std::string &filename) |
add parameters from a file | |
void | append (const std::string &key, const std::string &value, bool force=false) |
add a single parameter to the container | |
template<class T > | |
std::string | toString (const T &value) |
A helper function to convert numbers to scientific strings. | |
template<class NumberType , std::enable_if_t< std::is_floating_point< NumberType >::value||std::is_integral< NumberType >::value, int > = 0> | |
void | append (const std::string &key, NumberType value, bool force=false) |
add a single Floating number parameter to the container | |
void | appendDGF (const std::string &filename) |
add parameters from a DGF file | |
void | clear () |
clear all parameters | |
bool | verbose () const |
obtain the cached value for fem.verbose | |
std::string | commonInputPath () const |
std::string | commonOutputPath () const |
void | write (std::ostream &out, bool writeAll=true) const |
write the parameter database to a stream | |
bool | exists (const std::string &key) const |
check, whether a parameter is defined | |
void | get (const std::string &key, T &value) const |
get mandatory parameter | |
void | get (const std::string &key, const T &defaultValue, T &value) const |
get optional parameter | |
void | get (const std::string &key, const char *defaultValue, std::string &value) const |
get optional parameter (special case for string) | |
void | getValid (const std::string &key, const Validator &validator, T &value) const |
get mandatory parameter | |
void | getValid (const std::string &key, const T &defaultValue, const Validator &validator, T &value) const |
get optional parameter | |
T | getValue (const std::string &key) const |
get mandatory parameter | |
T | getValue (const std::string &key, const T &defaultValue) const |
get optional parameter | |
T | getValidValue (const std::string &key, const Validator &validator) const |
get optional parameter | |
T | getValidValue (const std::string &key, const T &defaultValue, const Validator &validator) const |
get optional parameter | |
int | getEnum (const std::string &key, const std::string(&values)[n]) const |
int | getEnum (const std::string &key, const std::string(&values)[n], int defaultValue) const |
int | getEnum (const std::string &key, const std::vector< std::string > &values) const |
int | getEnum (const std::string &key, const std::vector< std::string > &values, int defaultValue) const |
ThisType * | clone () const |
ParameterContainerData | parameter () |
const ParameterContainerData | parameter () const |
void | reset () |
Protected Attributes | |
ParameterContainerData | parameter_ |
|
inherited |
|
inline |
add parameters from a file
[in] | filename | name of the file containing the parameters |
|
inline |
add a single parameter to the container
[in] | key | key of the parameter to add |
[in] | value | value of the parameter to add |
[in] | force | replace parameter, if it exists |
|
inline |
add a single Floating number parameter to the container
[in] | key | key of the parameter to add |
[in] | value | value of the parameter to add |
[in] | force | replace parameter, if it exists |
|
inline |
add parameters from the command line
This mehtod adds all parameters (strings containing a colon) in the command line to the container. The parameters are then removed from the command line.
[in] | argc | number of arguments (as given to main) |
[in] | argv | vector of arguments (as given to main) |
|
inline |
add parameters from a DGF file
Parameters can also be read from a DGF file containing a 'FemParameter' block.
[in] | filename | name of the DGF file containing the parameters |
|
inline |
clear all parameters
|
inlineinherited |
|
inline |
|
inline |
|
inlineinherited |
check, whether a parameter is defined
[in] | key | name of the parameter to check |
|
inlineinherited |
get optional parameter (special case for string)
[in] | key | name of the parameter to get |
[in] | defaultValue | default value for this parameter |
[out] | value | value of the parameter |
|
inlineinherited |
get optional parameter
[in] | key | name of the parameter to get |
[in] | defaultValue | default value for this parameter |
[out] | value | value of the parameter |
|
inlineinherited |
get mandatory parameter
[in] | key | name of the parameter to get |
[out] | value | value of the parameter |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
get optional parameter
[in] | key | name of the parameter to get |
[in] | defaultValue | default value for this parameter |
[in] | validator | validator for the parameter value |
[out] | value | value of the parameter |
|
inlineinherited |
get mandatory parameter
[in] | key | name of the parameter to get |
[in] | validator | validator for the parameter value |
[out] | value | value of the parameter |
|
inlineinherited |
get optional parameter
[in] | key | name of the parameter to get |
[in] | defaultValue | default value for this parameter |
[in] | validator | validator for the parameter value |
|
inlineinherited |
get optional parameter
[in] | key | name of the parameter to get |
[in] | validator | validator for the parameter value |
|
inlineinherited |
get mandatory parameter
[in] | key | name of the parameter to get |
|
inlineinherited |
get optional parameter
[in] | key | name of the parameter to get |
[in] | defaultValue | default value for this parameter |
|
inline |
cast into ParameterReader
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
A helper function to convert numbers to scientific strings.
[in] | value | the value to be converted (needs a << operator) |
|
inline |
obtain the cached value for fem.verbose
|
inline |
write the parameter database to a stream
This method writes paramters to the given stream. If the second parameter is true all parameters are written; otherwise only used parameters which do not coincide with the default value are written.
[in] | out | stream for the parameters. |
[in] | writeAll | default is true |
|
protectedinherited |