AMDiS 2.11-git
The Adaptive Multi-Dimensional Simulation Toolbox
 
Loading...
Searching...
No Matches
Initfile Class Reference

Classes

struct  is_arithmetic_container
 Template for container types with [] operator and existing value_type. More...
 
struct  is_arithmetic_container< Container, std::enable_if_t< std::is_arithmetic< typename Container::value_type >::value &&!std::is_same< Container, std::string >::value > >
 

Static Public Member Functions

static void init (std::string const &in)
 initialize singleton object and global parameters
 
template<class T , std::enable_if_t<!std::is_arithmetic_v< T >, int > = 0>
static std::optional< T > get (std::string const &key)
 Get parameter-values from parameter-tree.
 
template<class T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0>
static std::optional< T > get (std::string const &key)
 
template<class T >
static void get (std::string const &key, T &value)
 Get parameter-values from parameter-tree with default value.
 
template<class T >
static void set (std::string const &key, T const &value)
 
static int getMsgInfo ()
 Returns specified info level.
 
static void printParameters ()
 print all data in singleton to std::cout
 
static void clearData ()
 

Protected Member Functions

void read (std::string const &fn, bool force=false)
 Fill an parametr-tree from a file with filename fn.
 
void write (std::string const &fn)
 
void getInternalParameters ()
 read standard values for output and information of parameter-values
 

Static Protected Member Functions

static Dune::ParameterTree & pt ()
 Return the parameter-tree.
 
template<class T >
static std::optional< T > getVector (const std::string &key)
 get Parameter values for vector types
 
template<typename T >
static bool parse (const std::string &input, T &result)
 replace expression with the respective result
 
template<typename T >
static T parseExpression (const std::string &input, const std::string &key)
 
template<typename T , typename Container >
static T parseExpression (const std::string &input, const std::string &key, size_t i)
 
static Initfilesinglett ()
 Return the singleton that contains the data.
 

Protected Attributes

int msgInfo_ = 0
 
int paramInfo_ = 1
 
bool breakOnMissingTag_ = false
 
Dune::ParameterTree pt_
 ParameterTree to read/store parameter values.
 

Member Function Documentation

◆ get() [1/2]

template<class T , std::enable_if_t<!std::is_arithmetic_v< T >, int > = 0>
static std::optional< T > get ( std::string const &  key)
inlinestatic

Get parameter-values from parameter-tree.

Looks for the key in the parameter-tree and returns the stored and parsed value if found and parsable.

May throw an exception if the value can not be parsed into type T

References Initfile::pt().

Referenced by AdaptInfo::AdaptInfo(), AdaptInstationary::AdaptInstationary(), BackupWriter< SystemVector >::BackupWriter(), DirectRunner< M, X, Y, Solver >::DirectRunner(), ESMarker< Grid >::ESMarker(), EstimatorMarker< Grid >::EstimatorMarker(), FileWriterBase::FileWriterBase(), GERSMarker< Grid >::GERSMarker(), GmshWriter< GV >::GmshWriter(), KrylovRunner< M, X, Y, ITLSolver >::KrylovRunner(), LinearSolver< Mat, VecX, VecY >::LinearSolver(), Marker< Grid >::Marker(), MSMarker< Grid >::MSMarker(), NewtonIteration< ProblemType >::NewtonIteration(), AdaptInfo::ScalContent::ScalContent(), UmfpackRunner< M, X, Y >::UmfpackRunner(), VTKWriter< GV, GF >::VTKWriter(), EstimatorMarker< Grid >::createMarker(), KrylovRunner< M, X, Y, ITLSolver >::createPrecon(), IterativeSolverCreator< M, X, Y, IterativeSolver >::createWithString(), Initfile::getInternalParameters(), Environment::infoLevel(), ISTLPreconCreatorBase< Traits >::init(), ISTLSolverCreatorBase< Traits >::init(), ISTLPreconCreator< tag::solver< Traits >, Traits >::init(), ISTLPreconCreator< tag::bjacobi, Traits >::init(), ISTLIterativeSolverCreatorBase< Traits >::init(), GMResSolverCreator< Solver, Traits >::init(), PCGSolverCreator< Solver, Traits >::init(), DirectSolverCreator< Solver, Traits >::init(), Environment::msgAllRanks(), and AdaptInfo::reset().

◆ get() [2/2]

template<class T >
static void get ( std::string const &  key,
T &  value 
)
inlinestatic

Get parameter-values from parameter-tree with default value.

initialized in init()-method. Cast the value to the desired type.

Parameters
keyThe tag to look for
valueThe default value and result.

The documentation for this class was generated from the following files: