ExaDG
Loading...
Searching...
No Matches
general_parameters.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2021 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_EXADG_UTILITIES_GENERAL_PARAMETERS_H_
23#define INCLUDE_EXADG_UTILITIES_GENERAL_PARAMETERS_H_
24
25#include <deal.II/base/parameter_handler.h>
26
27#include <exadg/utilities/enum_patterns.h>
28
29namespace ExaDG
30{
32{
34 {
35 }
36
37 GeneralParameters(std::string const & input_file)
38 {
39 dealii::ParameterHandler prm;
40 add_parameters(prm);
41 prm.parse_input(input_file, "", true, true);
42 }
43
44 void
45 add_parameters(dealii::ParameterHandler & prm)
46 {
47 prm.enter_subsection("General");
48 {
49 prm.add_parameter("Precision",
50 precision,
51 "Floating point precision.",
52 dealii::Patterns::Selection("float|double"),
53 false);
54 prm.add_parameter(
55 "Dim", dim, "Number of space dimension.", dealii::Patterns::Integer(2, 3), true);
56 prm.add_parameter("IsTest",
57 is_test,
58 "Set to true if the program is run as a test.",
59 dealii::Patterns::Bool(),
60 false);
61 }
62 prm.leave_subsection();
63 }
64
65 std::string precision = "double";
66
67 unsigned int dim = 2;
68
69 bool is_test = false;
70};
71
72} // namespace ExaDG
73
74
75
76#endif /* INCLUDE_EXADG_UTILITIES_GENERAL_PARAMETERS_H_ */
Definition driver.cpp:33
Definition general_parameters.h:32