ExaDG
Toggle main menu visibility
Loading...
Searching...
No Matches
include
exadg
utilities
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 EXADG_UTILITIES_GENERAL_PARAMETERS_H_
23
#define EXADG_UTILITIES_GENERAL_PARAMETERS_H_
24
25
// deal.II
26
#include <deal.II/base/parameter_handler.h>
27
28
// ExaDG
29
#include <exadg/utilities/enum_patterns.h>
30
31
namespace
ExaDG
32
{
33
struct
GeneralParameters
34
{
35
GeneralParameters()
36
{
37
}
38
39
GeneralParameters(std::string
const
& input_file)
40
{
41
dealii::ParameterHandler prm;
42
add_parameters(prm);
43
prm.parse_input(input_file,
""
,
true
,
true
);
44
}
45
46
void
47
add_parameters(dealii::ParameterHandler & prm)
48
{
49
prm.enter_subsection(
"General"
);
50
{
51
prm.add_parameter(
"Precision"
,
52
precision,
53
"Floating point precision."
,
54
dealii::Patterns::Selection(
"float|double"
),
55
false
);
56
prm.add_parameter(
57
"Dim"
, dim,
"Number of space dimension."
, dealii::Patterns::Integer(2, 3),
true
);
58
prm.add_parameter(
"IsTest"
,
59
is_test,
60
"Set to true if the program is run as a test."
,
61
dealii::Patterns::Bool(),
62
false
);
63
}
64
prm.leave_subsection();
65
}
66
67
std::string precision =
"double"
;
68
69
unsigned
int
dim = 2;
70
71
bool
is_test =
false
;
72
};
73
74
}
// namespace ExaDG
75
76
#endif
/* EXADG_UTILITIES_GENERAL_PARAMETERS_H_ */
ExaDG
Definition
driver.cpp:33
Generated by
1.17.0