Opm::Parameters Namespace Reference

Classes

struct  ParamInfo
 
class  ParamRegFinalizer_
 
class  ParamRegFinalizerBase_
 

Functions

template<class TypeTag , template< class, class > class Property>
auto get (bool errorIfNotRegistered=true)
 Retrieve a runtime parameter. More...
 
void printParamUsage_ (std::ostream &os, const ParamInfo &paramInfo)
 
void getFlattenedKeyList_ (std::list< std::string > &dest, const Dune::ParameterTree &tree, const std::string &prefix="")
 
std::string breakLines_ (const std::string &msg, int indentWidth, int maxWidth)
 
int getTtyWidth_ ()
 
template<class TypeTag >
void printParamList_ (std::ostream &os, const std::list< std::string > &keyList, bool printDefaults=false)
 
template<class TypeTag >
void printUsage (const std::string &helpPreamble, const std::string &errorMsg="", std::ostream &os=std::cerr, const bool showAll=false)
 Print a usage message for all run-time parameters. More...
 
void removeLeadingSpace_ (std::string &s)
 
std::string transformKey_ (const std::string &s, bool capitalizeFirstLetter=true, const std::string &errorPrefix="")
 
std::string parseKey_ (std::string &s)
 
std::string parseQuotedValue_ (std::string &s, const std::string &errorPrefix)
 
std::string parseUnquotedValue_ (std::string &s, const std::string &)
 
template<class TypeTag , class PositionalArgumentCallback >
std::string parseCommandLineOptions (int argc, const char **argv, const std::string &helpPreamble="", const PositionalArgumentCallback &posArgCallback=noPositionalParameters_)
 Parse the parameters provided on the command line. More...
 
template<class TypeTag >
void parseParameterFile (const std::string &fileName, bool overwrite=true)
 Read the parameters from an INI-style file. More...
 
template<class TypeTag >
void printValues (std::ostream &os=std::cout)
 Print values of the run-time parameters. More...
 
template<class TypeTag >
bool printUnused (std::ostream &os=std::cout)
 Print the list of unused run-time parameters. More...
 
template<class TypeTag , class Container >
void getLists (Container &usedParams, Container &unusedParams)
 Retrieves the lists of parameters specified at runtime and their values. More...
 
template<class TypeTag >
void reset ()
 
template<class TypeTag , template< class, class > class Param>
bool isSet (bool errorIfNotRegistered=true)
 Returns true if a parameter has been specified at runtime, false otherwise. More...
 
template<class TypeTag , template< class, class > class Param>
void registerParam (const char *usageString)
 Register a run-time parameter. More...
 
template<class TypeTag , template< class, class > class Param>
void hideParam ()
 Indicate that a given parameter should not be mentioned in the help message. More...
 
template<class TypeTag >
void endParamRegistration ()
 Indicate that all parameters are registered for a given type tag. More...
 

Function Documentation

◆ breakLines_()

std::string Opm::Parameters::breakLines_ ( const std::string &  msg,
int  indentWidth,
int  maxWidth 
)
inline

Referenced by printParamUsage_(), printUsage(), and start().

◆ endParamRegistration()

template<class TypeTag >
void Opm::Parameters::endParamRegistration ( )

Indicate that all parameters are registered for a given type tag.

If registerParam is called after the invocation of endParamRegistration, a std::logic_error exception will be thrown.

◆ getFlattenedKeyList_()

void Opm::Parameters::getFlattenedKeyList_ ( std::list< std::string > &  dest,
const Dune::ParameterTree &  tree,
const std::string &  prefix = "" 
)
inline

◆ getLists()

template<class TypeTag , class Container >
void Opm::Parameters::getLists ( Container &  usedParams,
Container &  unusedParams 
)

Retrieves the lists of parameters specified at runtime and their values.

The two arguments besides the TypeTag are assumed to be STL containers which store std::pair<std::string, std::string>.

References getFlattenedKeyList_().

◆ getTtyWidth_()

int Opm::Parameters::getTtyWidth_ ( )
inline

Referenced by printParamUsage_(), printUsage(), and start().

◆ hideParam()

template<class TypeTag , template< class, class > class Param>
void Opm::Parameters::hideParam ( )

Indicate that a given parameter should not be mentioned in the help message.

This allows to deal with unused parameters

◆ isSet()

template<class TypeTag , template< class, class > class Param>
bool Opm::Parameters::isSet ( bool  errorIfNotRegistered = true)

Returns true if a parameter has been specified at runtime, false otherwise.

If the parameter in question has not been registered, this throws an exception.

◆ parseKey_()

std::string Opm::Parameters::parseKey_ ( std::string &  s)
inline

◆ parseQuotedValue_()

std::string Opm::Parameters::parseQuotedValue_ ( std::string &  s,
const std::string &  errorPrefix 
)
inline

Referenced by parseParameterFile().

◆ parseUnquotedValue_()

std::string Opm::Parameters::parseUnquotedValue_ ( std::string &  s,
const std::string &   
)
inline

Referenced by parseParameterFile().

◆ printParamList_()

template<class TypeTag >
void Opm::Parameters::printParamList_ ( std::ostream &  os,
const std::list< std::string > &  keyList,
bool  printDefaults = false 
)

◆ printParamUsage_()

◆ removeLeadingSpace_()

void Opm::Parameters::removeLeadingSpace_ ( std::string &  s)
inline

Referenced by parseParameterFile().

◆ reset()

template<class TypeTag >
void Opm::Parameters::reset ( )

◆ transformKey_()

std::string Opm::Parameters::transformKey_ ( const std::string &  s,
bool  capitalizeFirstLetter = true,
const std::string &  errorPrefix = "" 
)
inline