dune-fem
2.4.1-rc
|
Container for User Specified Parameters. More...
#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/io/parameter.hh>
Static Public Member Functions | |
static ParameterContainer & | container () |
static int | setVerboseRank (int verboseRank) |
set the rank for verbose output More... | |
static void | append (int &argc, char **argv) |
add parameters from the command line RangeType gRight; More... | |
static void | append (const std::string &key, const std::string &value) |
add a single parameter to the container More... | |
static void | append (const std::string &filename) |
add parameters from a file to the container More... | |
static void | appendDGF (const std::string &filename) |
add parameters from a DGF file to the container More... | |
static bool | exists (const std::string &key) |
find out, whether a parameter is defined in the container More... | |
template<class T > | |
static void | get (const std::string &key, T &value) |
get a mandatory parameter from the container More... | |
template<class T > | |
static void | get (const std::string &key, const T &defaultValue, T &value) |
get an optional parameter from the container More... | |
static void | get (const std::string &key, const char *defaultValue, std::string &value) |
get an optional parameter from the container special case for string More... | |
template<class T , class Validator > | |
static void | getValid (const std::string &key, const Validator &validator, T &value) |
get a mandatory parameter from the container More... | |
template<class T , class Validator > | |
static void | getValid (const std::string &key, const T &defaultValue, const Validator &validator, T &value) |
get an optional parameter from the container More... | |
template<class T > | |
static T | getValue (const std::string &key) |
get a mandatory parameter from the container More... | |
template<class T > | |
static T | getValue (const std::string &key, const T &defaultValue) |
get an optional parameter from the container More... | |
template<class T , class Validator > | |
static T | getValidValue (const std::string &key, const Validator &validator) |
get an optional parameter from the container More... | |
template<class T , class Validator > | |
static T | getValidValue (const std::string &key, const T &defaultValue, const Validator &validator) |
get an optional parameter from the container More... | |
template<int n> | |
static int | getEnum (const std::string &key, const std::string(&values)[n]) |
template<int n> | |
static int | getEnum (const std::string &key, const std::string(&values)[n], int defaultValue) |
static std::string | commonOutputPath () |
obtain common output path More... | |
static std::string | outputPath () |
obtain unique output path for this process More... | |
static std::string | commonInputPath () |
obtain common input path More... | |
static bool | verbose () |
obtain the cached value for fem.verbose More... | |
static void | write (const std::string &filename, const std::string &fileextension="", bool writeAll=true) |
write the parameter database to a file More... | |
static void | write (std::ostream &out, bool writeAll=true) |
write the parameter database to a stream More... | |
Static Protected Member Functions | |
static void | write (const std::string &path, const std::string &filename, const std::string &fileextension, bool writeAll=true) |
write the parameter database to a file More... | |
Container for User Specified Parameters.
The class Parameter provides parameters collected from given parameter files or the command line in a unified and easy to use way.
This class adheres to the singleton concept, i.e., all methods are static and internally use a single instance of this object to store all data.
|
inlinestatic |
add parameters from the command line RangeType gRight;
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) |
References Dune::Fem::ParameterContainer::append(), and container().
Referenced by main(), and Dune::Fem::PersistenceManager::restoreValue().
|
inlinestatic |
add a single parameter to the container
[in] | key | key of the parameter to add |
[in] | value | value of the parameter to add |
References Dune::Fem::ParameterContainer::append(), and container().
|
inlinestatic |
add parameters from a file to the container
[in] | filename | name of the file containing the parameters |
References Dune::Fem::ParameterContainer::append(), and container().
|
inlinestatic |
add parameters from a DGF file to the container
Parameters can also be read from a DGF file containing a 'FemParameter' block.
[in] | filename | name of the DGF file containing the parameters |
References Dune::Fem::ParameterContainer::appendDGF(), and container().
|
inlinestatic |
obtain common input path
This common input path could for example be used for the determination of the location of parameter and grid files
References Dune::Fem::ParameterContainer::commonInputPath(), and container().
|
inlinestatic |
obtain common output path
For parallel jobs you need two different output paths:
References Dune::Fem::ParameterContainer::commonOutputPath(), container(), and outputPath().
Referenced by outputPath(), readParameterList(), Dune::Fem::IOInterface::readPath(), and write().
|
inlinestatic |
Referenced by append(), appendDGF(), commonInputPath(), commonOutputPath(), Dune::Fem::IOInterface::defaultGridKey(), exists(), get(), getEnum(), getValid(), getValidValue(), getValue(), Dune::Fem::OEMGMRESOp< DiscreteFunctionType, Op >::operator()(), Dune::Fem::PersistenceManager::restoreValue(), setVerboseRank(), verbose(), Dune::Fem::VTKIO< GridPart, true >::VTKIO(), and write().
|
inlinestatic |
find out, whether a parameter is defined in the container
[in] | key | name of the parameter to check |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::exists().
|
inlinestatic |
get a mandatory parameter from the container
[in] | key | name of the parameter to get |
[out] | value | value of the parameter |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::get().
Referenced by readParameterList().
|
inlinestatic |
get an optional parameter from the container
[in] | key | name of the parameter to get |
[in] | defaultValue | default value for this parameter |
[out] | value | value of the parameter |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::get().
|
inlinestatic |
get an optional parameter from the container 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 |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::get().
|
inlinestatic |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::getEnum().
|
inlinestatic |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::getEnum().
|
inlinestatic |
get a mandatory parameter from the container
[in] | key | name of the parameter to get |
[in] | validator | validator for the parameter value |
[out] | value | value of the parameter |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::getValid().
|
inlinestatic |
get an optional parameter from the container
[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 |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::getValid().
|
inlinestatic |
get an optional parameter from the container
[in] | key | name of the parameter to get |
[in] | validator | validator for the parameter value |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::getValidValue().
|
inlinestatic |
get an optional parameter from the container
[in] | key | name of the parameter to get |
[in] | defaultValue | default value for this parameter |
[in] | validator | validator for the parameter value |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::getValidValue().
|
inlinestatic |
get a mandatory parameter from the container
[in] | key | name of the parameter to get |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::getValue().
|
inlinestatic |
get an optional parameter from the container
[in] | key | name of the parameter to get |
[in] | defaultValue | default value for this parameter |
References container(), and Dune::Fem::BasicParameterReader< Parameter >::getValue().
|
inlinestatic |
obtain unique output path for this process
For parallel jobs you need two different output paths:
References commonOutputPath(), path, and Dune::Fem::MPIManager::rank().
Referenced by commonOutputPath().
|
inlinestatic |
set the rank for verbose output
This mehtod allows to set the fem verbosity within the code.
[in] | verboseRank | the rank of the processor to have * verbose output (-1: no verbose output) |
[out] | the | value used before the change |
References container(), and Dune::Fem::ParameterContainer::setVerboseRank().
|
inlinestatic |
obtain the cached value for fem.verbose
References container(), Dune::Fem::ParameterContainer::verbose(), and write().
Referenced by Dune::Fem::AdaptationMethod< GridType >::AdaptationMethod(), Dune::Fem::CheckPointer< GridImp, DataImp >::GridPersistentObject::backup(), Dune::Fem::IOInterface::copyMacroGrid(), DuneODE::ExplicitOdeSolver< DestinationImp >::createOdeSolver(), DuneODE::ImplicitOdeSolver< DestinationImp >::createOdeSolver(), DuneODE::SemiImplicitOdeSolver< DestinationImp >::createOdeSolver(), Dune::Fem::FemEoc::EOCColumnWriter::eoc(), Dune::Fem::GridSolutionVector< GridImp, DiscreteFunctionImp >::GridSolutionVector(), Dune::Fem::DataOutput< GridImp, DataImp >::init(), Dune::Fem::IOTuple< Tuple >::input(), Dune::Fem::LoadBalancer< GridType >::LoadBalancer(), Dune::Fem::GridSolutionVector< GridImp, DiscreteFunctionImp >::numProcs(), Dune::Fem::CheckPointer< GridImp, DataImp >::readCheckPoint(), Dune::Fem::CheckPointer< GridImp, DataImp >::restoreGrid(), Dune::Fem::PersistenceManager::restoreValue(), and Dune::Fem::DataOutput< GridImp, DataImp >::writeData().
|
inlinestatic |
write the parameter database to a file
This method writes paramters to the given file. 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] | filename | name of the file to store the parameters in; prefix() is used. |
[in] | fileextension | file extension if you want to have time stemps in the log files, ! must contain the "." dot for fileextensions ! |
[in] | writeAll | default is true |
References commonOutputPath(), and Dune::Fem::MPIManager::rank().
Referenced by Dune::Fem::DataOutput< GridImp, DataImp >::init(), Dune::Fem::CheckPointer< GridImp, DataImp >::initialize(), Dune::Fem::PersistenceManager::restoreValue(), verbose(), and write().
|
inlinestatic |
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 |
References container(), and Dune::Fem::ParameterContainer::write().
|
inlinestaticprotected |
write the parameter database to a file
This method writes paramters to the given file. 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] | path | path where filename is stored (for parallel writing) |
[in] | filename | name of the file to store the parameters in; prefix() is used. |
[in] | fileextension | chosen fileextension |
[in] | writeAll | default is true |
References Dune::Fem::createDirectory(), Dune::Fem::directoryExists(), and write().