Parameters::init(...)
Parameters::init(...)
constructs a parameter tree singleton
from which parameters can be obtainedExplicitly specify parameter file (default:
params.input
)
Explicitly specify default parameters
Without reading command-line arguments
Read parameters from the parameter tree with
getParam
(converts std::string
to requested
type)
Examples:
Signature without default: throws ParameterException
if parameter doesn’t exist.
getParamFromGroup
variant traverses the parameter
tree
Example
FreeFlow.Problem.Gravity
Problem.Gravity
Useful when configuring multiple simulation components or multi-domain problem via the single parameter tree
Check: Does parameter exist in the parameter tree?
With group prefix lookup
#include <dumux/common/parameters.hh>
int main(int argc, char** argv)
{
Dumux::Parameters::init(argc, argv);
...
Dumux::Parameters::print(); // print report
return 0;
}
Reports unused parameters. Great for detecting typos in configuration file.
Dune INI syntax ([Group]
and Key = Value
pairs)
params.input
Examples:
An overview of all available parameters can be found in the doxygen documentation.