AMDiS  0.1
The Adaptive Multi-Dimensional Simulation Toolbox
Initfile Class Reference

Static Public Member Functions

static void init (std::string const &in)
 initialize singleton object and global parameters
template<class T >
static std::optional< T > get (std::string const &key)
 Get parameter-values from parameter-tree. More...
template<class T >
static void get (std::string const &key, T &value)
 Get parameter-values from parameter-tree with default value. More...
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 Initfilesinglett ()
 Return the singleton that contains the data.
static Dune::ParameterTree & pt ()
 Return the parameter-tree.

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]

static std::optional<T> get ( std::string const &  key)

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(), AMGPrecon< AMGCreator, Smoother, Traits >::create(), EstimatorMarker< Grid >::createMarker(), KrylovRunner< Mat, Vec, ITLSolver >::createPrecon(), ISTLSolver< Mat, Vec >::Creator::createWithString(), SolverPrecon< Mat, Vec >::Creator::createWithString(), ISTLPreconCreator< Model, Traits >::Creator::createWithString(), IterativeSolverCreator< Mat, Vec, IterativeSolver >::createWithString(), ISTLSolverCreator< Model, Traits >::Creator::createWithString(), AMGPreconCreator< AMGSolver, Traits >::createWithString(), DirectRunner< Mat, Vec, Solver >::DirectRunner(), ESMarker< Grid >::ESMarker(), EstimatorMarker< Grid >::EstimatorMarker(), FileWriterBase::FileWriterBase(), GERSMarker< Grid >::GERSMarker(), GmshWriter< GV >::GmshWriter(), KrylovRunner< Mat, Vec, ITLSolver >::KrylovRunner(), Marker< Grid >::Marker(), MSMarker< Grid >::MSMarker(), PetscRunner< Matrix, Vector >::PetscRunner(), ProblemStat< Traits >::removeMarker(), AdaptInfo::reset(), ProblemStat< Traits >::restore(), AdaptInfo::ScalContent::ScalContent(), PetscRunner< Matrix, Vector >::solve(), SolverInfo::SolverInfo(), UmfpackRunner< Mat, Vec >::UmfpackRunner(), and VTKWriter< GV, GF >::VTKWriter().

◆ get() [2/2]

static void get ( std::string const &  key,
T &  value 

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

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

keyThe tag to look for
valueThe default value and result.

References Initfile::pt().

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