ExaDG
Loading...
Searching...
No Matches
resolution_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_OPERATORS_RESOLUTION_PARAMETERS_H_
23#define INCLUDE_EXADG_OPERATORS_RESOLUTION_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 SpatialResolutionParametersMinMax(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("SpatialResolution");
48 {
49 prm.add_parameter("DegreeMin",
50 degree_min,
51 "Minimal polynomial degree of shape functions.",
52 dealii::Patterns::Integer(1),
53 true);
54 prm.add_parameter("DegreeMax",
55 degree_max,
56 "Maximal polynomial degree of shape functions.",
57 dealii::Patterns::Integer(1),
58 true);
59 prm.add_parameter("RefineSpaceMin",
60 refine_space_min,
61 "Minimal number of mesh refinements.",
62 dealii::Patterns::Integer(0, 20),
63 true);
64 prm.add_parameter("RefineSpaceMax",
65 refine_space_max,
66 "Maximal number of mesh refinements.",
67 dealii::Patterns::Integer(0, 20),
68 true);
69 }
70 prm.leave_subsection();
71 }
72
73 unsigned int degree_min = 3;
74 unsigned int degree_max = 3;
75
76 unsigned int refine_space_min = 0;
77 unsigned int refine_space_max = 0;
78};
79
81{
83 {
84 }
85
86 SpatialResolutionParameters(std::string const & input_file)
87 {
88 dealii::ParameterHandler prm;
89 add_parameters(prm);
90 prm.parse_input(input_file, "", true, true);
91 }
92
93 void
94 add_parameters(dealii::ParameterHandler & prm,
95 std::string const & subsection_name = "SpatialResolution")
96 {
97 prm.enter_subsection(subsection_name);
98 {
99 prm.add_parameter("Degree",
100 degree,
101 "Polynomial degree of shape functions.",
102 dealii::Patterns::Integer(1),
103 true);
104 prm.add_parameter("RefineSpace",
105 refine_space,
106 "Number of global, uniform mesh refinements.",
107 dealii::Patterns::Integer(0, 20),
108 true);
109 }
110 prm.leave_subsection();
111 }
112
113 unsigned int degree = 3;
114
115 unsigned int refine_space = 0;
116};
117} // namespace ExaDG
118
119
120#endif /* INCLUDE_EXADG_OPERATORS_RESOLUTION_PARAMETERS_H_ */
Definition driver.cpp:33
Definition resolution_parameters.h:32
Definition resolution_parameters.h:81