6#include <dune/common/parametertree.hh>
15 static void init(std::string
const& in);
25 static std::optional<T>
get(std::string
const& key)
28 return pt().get<T>(key);
42 static void get(std::string
const& key, T& value)
44 value =
pt().get(key, value);
48 static void set(std::string
const& key, T
const& value)
62 static void clearData() {}
75 static Dune::ParameterTree&
pt()
81 void read(std::string
const& fn,
bool force =
false);
82 void write(std::string
const& fn);
89 bool breakOnMissingTag_ =
false;
92 Dune::ParameterTree
pt_;
Definition: Initfile.hpp:12
static std::optional< T > get(std::string const &key)
Get parameter-values from parameter-tree.
Definition: Initfile.hpp:25
void read(std::string const &fn, bool force=false)
Fill an parametr-tree from a file with filename fn.
Definition: Initfile.cpp:32
void getInternalParameters()
read standard values for output and information of parameter-values
Definition: Initfile.cpp:38
static void get(std::string const &key, T &value)
Get parameter-values from parameter-tree with default value.
Definition: Initfile.hpp:42
static int getMsgInfo()
Returns specified info level.
Definition: Initfile.hpp:54
static void printParameters()
print all data in singleton to std::cout
Definition: Initfile.cpp:49
Dune::ParameterTree pt_
ParameterTree to read/store parameter values.
Definition: Initfile.hpp:92
static Initfile & singlett()
Return the singleton that contains the data.
Definition: Initfile.hpp:68
static Dune::ParameterTree & pt()
Return the parameter-tree.
Definition: Initfile.hpp:75
static void init(std::string const &in)
initialize singleton object and global parameters
Definition: Initfile.cpp:25