forked from AMReX-Astro/Castro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruntime_parameters.H
More file actions
121 lines (103 loc) · 2.41 KB
/
Copy pathruntime_parameters.H
File metadata and controls
121 lines (103 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef RUNTIME_PARAMETERS_H
#define RUNTIME_PARAMETERS_H
#include <AMReX_ParmParse.H>
#include <castro_limits.H>
#ifdef DIFFUSION
#include <diffusion_params.H>
#endif
#ifdef GRAVITY
#include <gravity_params.H>
#endif
#ifdef RADIATION
#include <radsolve_params.H>
#include <radiation_params.H>
#endif
///
/// Initialize all of the runtime parameters defined in _cpp_parameters
/// regardless of the namespace
///
AMREX_INLINE
void
initialize_cpp_runparams()
{
{
ParmParse pp("castro");
#include <castro_queries.H>
}
#ifdef AMREX_PARTICLES
{
ParmParse pp("particles");
#include <particles_queries.H>
}
#endif
#ifdef DIFFUSION
{
ParmParse pp("diffusion");
#include <diffusion_queries.H>
}
#endif
#ifdef GRAVITY
{
ParmParse pp("gravity");
#include <gravity_queries.H>
}
#endif
#ifdef RADIATION
{
ParmParse pp("radiation");
#include <radiation_queries.H>
}
#endif
}
///
/// Check to ensure that any runtime parameters set in inputs or on
/// the command line are valid -- everything should have been accessed
/// by now.
///
AMREX_INLINE
void
validate_runparams()
{
amrex::Vector<std::string> check_namespaces = {"castro", "problem"};
#ifdef AMREX_PARTICLES
check_namespaces.push_back("particles");
#endif
#ifdef DIFFUSION
check_namespaces.push_back("diffusion");
#endif
#ifdef GRAVITY
check_namespaces.push_back("gravity");
#endif
#ifdef RADIATION
//check_namespaces.push_back("radiation"); // this doesn't yet work because RadBndry isn't setup yet
check_namespaces.push_back("radsolve");
#endif
// now Microphysics
check_namespaces.push_back("eos");
#ifdef REACTIONS
check_namespaces.push_back("network");
check_namespaces.push_back("integrator");
#endif
#ifdef RADIATION
check_namespaces.push_back("opacity");
#endif
#ifdef DIFFUSION
check_namespaces.push_back("conductivity");
#endif
for (auto nm: check_namespaces)
{
// "castro"
if (ParmParse::hasUnusedInputs(nm)) {
amrex::Print() << "Warning: the following " + nm + ".* parameters are ignored\n";
auto unused = ParmParse::getUnusedInputs(nm);
for (auto p: unused) {
amrex::Print() << p << "\n";
}
amrex::Print() << std::endl;
if (abort_on_invalid_params) {
amrex::Error("Error: invalid parameters");
}
}
}
}
#endif