MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / validate_runparams

Function validate_runparams

Source/driver/runtime_parameters.H:69–121  ·  view source on GitHub ↗

Check to ensure that any runtime parameters set in inputs or on the command line are valid -- everything should have been accessed by now.

Source from the content-addressed store, hash-verified

67/// by now.
68///
69AMREX_INLINE
70void
71validate_runparams()
72{
73
74 amrex::Vector<std::string> check_namespaces = {"castro", "problem"};
75#ifdef AMREX_PARTICLES
76 check_namespaces.push_back("particles");
77#endif
78#ifdef DIFFUSION
79 check_namespaces.push_back("diffusion");
80#endif
81#ifdef GRAVITY
82 check_namespaces.push_back("gravity");
83#endif
84#ifdef RADIATION
85 //check_namespaces.push_back("radiation"); // this doesn't yet work because RadBndry isn't setup yet
86 check_namespaces.push_back("radsolve");
87#endif
88
89 // now Microphysics
90
91 check_namespaces.push_back("eos");
92#ifdef REACTIONS
93 check_namespaces.push_back("network");
94 check_namespaces.push_back("integrator");
95#endif
96#ifdef RADIATION
97 check_namespaces.push_back("opacity");
98#endif
99#ifdef DIFFUSION
100 check_namespaces.push_back("conductivity");
101#endif
102
103 for (const auto& nm: check_namespaces)
104 {
105 // "castro"
106 if (amrex::ParmParse::hasUnusedInputs(nm)) {
107 amrex::Print() << Font::Bold << FGColor::Yellow
108 << "[WARNING] the following " + nm + ".* parameters are ignored\n";
109 auto unused = amrex::ParmParse::getUnusedInputs(nm);
110 for (const auto& p: unused) {
111 amrex::Print() << p << "\n";
112 }
113 amrex::Print() << ResetDisplay << std::endl;
114 if (castro::abort_on_invalid_params) {
115 amrex::Error("Error: invalid parameters");
116 }
117 }
118
119 }
120
121}
122
123#endif

Callers 1

CastroMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected