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