walberla::config Namespace Reference

Classes

struct  CaseInsensitiveCompare
 
class  Config
 Configuration handler & parameter file parser. More...
 
struct  ConfigGenerator
 
class  Iterator
 
class  MultipleConfigGenerator
 
class  SingleConfigGenerator
 

Functions

static void printConfig (std::ostream &os, const Config::BlockHandle &block, int depth=0)
 
std::ostream & operator<< (std::ostream &os, const Config &config)
 
std::ostream & operator<< (std::ostream &os, const Config::BlockHandle &block)
 
template<>
Config::Parameter< std::string > Config::Block::getParameter< std::string > (std::string key) const
 
boost::property_tree::iptree configToBoostPropertyTree (const Config &config)
 
boost::property_tree::iptree configBlockHandleToBoostPropertyTree (const Config::BlockHandle &blockHandle)
 
Helper functions
std::string usageString (const std::string &executableName)
 
void createFromTextFile (Config &config, const std::string &pathToTextFile)
 
void substituteCommandLineArgs (Config &config, int argc, char **argv)
 
void substituteCommandLineArgs (Config &config, const std::vector< std::string > &params)
 
Iterator createConfigIteratorFromTextFiles (const std::string &basename, const std::string &extension, int nrOfDigits)
 
Load configuration file using command line arguments
shared_ptr< Configcreate (int argc, char **argv)
 Loads configuration file using command line arguments. More...
 
Iterator begin (int argc, char **argv)
 Loads multiple numbered configuration files. More...
 
Iterator end ()
 

Function Documentation

Iterator walberla::config::begin ( int  argc,
char **  argv 
)

Loads multiple numbered configuration files.

In order to do a parameter study i.e. running multiple simulations in a row this function can be used. The configuration file name has to have the following structure: someName000.someExtension If there are zeros before the extension dot, it is interpreted as the first file of a numbered series.

If there are no zeros in the filename before the dot, the iterator goes over the single file i.e. its save to always use the iterator variant.

Command line substitution does not work when iterating over multiple files.

template<>
Config::Parameter<std::string> walberla::config::Config::Block::getParameter< std::string > ( std::string  key) const
inline
boost::property_tree::iptree walberla::config::configBlockHandleToBoostPropertyTree ( const Config::BlockHandle blockHandle)
boost::property_tree::iptree walberla::config::configToBoostPropertyTree ( const Config config)
shared_ptr< Config > walberla::config::create ( int  argc,
char **  argv 
)

Loads configuration file using command line arguments.

The last command line parameter which does not begin with '-' is taken as the configuration file name. Parameters starting with '-' are used to overwrite individual configuration values.

For the syntax of the configuration file see config::Config

For details on Parameter substitution using additional command line parameters see config::substituteCommandLineArgs

Iterator walberla::config::createConfigIteratorFromTextFiles ( const std::string &  basename,
const std::string &  extension,
int  nrOfDigits 
)
void walberla::config::createFromTextFile ( Config config,
const std::string &  pathToTextFile 
)
Iterator walberla::config::end ( )
inline
std::ostream & walberla::config::operator<< ( std::ostream &  os,
const Config config 
)
std::ostream & walberla::config::operator<< ( std::ostream &  os,
const Config::BlockHandle block 
)
static void walberla::config::printConfig ( std::ostream &  os,
const Config::BlockHandle block,
int  depth = 0 
)
static
void walberla::config::substituteCommandLineArgs ( Config config,
int  argc,
char **  argv 
)
void walberla::config::substituteCommandLineArgs ( Config config,
const std::vector< std::string > &  params 
)
std::string walberla::config::usageString ( const std::string &  executableName)