24 #ifndef PARAMETERREADER_h_
25 #define PARAMETERREADER_h_
27 #include <deal.II/base/parameter_handler.h>
29 using namespace dealii;
46 inline void SetSubsection(
const std::string subsection);
52 inline void read_parameters(
const std::string parameter_file);
57 inline void declare_entry (
const std::string &entry,
58 const std::string &default_value,
59 const Patterns::PatternBase &pattern=Patterns::Anything(),
60 const std::string &documentation=std::string());
65 inline double get_double (
const std::string &entry_name);
70 inline int get_integer (
const std::string &entry_name);
75 inline std::string get_string (
const std::string &entry_name);
80 inline bool get_bool (
const std::string &entry_name);
84 std::string subsection_;
88 ParameterReader::ParameterReader()
93 void ParameterReader::SetSubsection(
const std::string subsection)
95 subsection_ = subsection;
98 void ParameterReader::declare_entry(
const std::string &entry,
99 const std::string &default_value,
100 const Patterns::PatternBase &pattern,
101 const std::string &documentation)
103 prm.enter_subsection (subsection_);
105 prm.declare_entry(entry,default_value,pattern,documentation);
107 prm.leave_subsection();
110 void ParameterReader::read_parameters (
const std::string parameter_file)
112 prm.read_input (parameter_file);
115 double ParameterReader::get_double (
const std::string &entry_name)
118 prm.enter_subsection(subsection_);
120 ret = prm.get_double(entry_name);
122 prm.leave_subsection();
126 int ParameterReader::get_integer (
const std::string &entry_name)
129 prm.enter_subsection(subsection_);
131 ret = prm.get_integer(entry_name);
133 prm.leave_subsection();
137 std::string ParameterReader::get_string (
const std::string &entry_name)
140 prm.enter_subsection(subsection_);
142 ret = prm.get(entry_name);
144 prm.leave_subsection();
148 bool ParameterReader::get_bool(
const std::string &entry_name)
151 prm.enter_subsection(subsection_);
153 ret = prm.get_bool(entry_name);
155 prm.leave_subsection();
Definition: parameterreader.h:36