7 #include <athena/mesh/mesh.hpp>
8 #include <athena/parameter_input.hpp>
11 #include <application/exceptions.hpp>
18 MeshBlock *pmb, ParameterInput *pin) {
23 if (pin->DoesParameterExist(
"chemistry", input_key)) {
24 std::string filename = pin->GetString(
"chemistry", input_key);
25 std::ifstream stream(filename);
26 if (stream.good() ==
false) {
27 throw NotFoundError(
"microphysics",
28 "Cannot open microphysics config file: " + filename);
31 YAML::Node node = YAML::Load(stream);
32 if (!node[
"microphysics"]) {
33 throw NotFoundError(
"Microphysics",
"microphysics");
36 for (
auto sys : node[
"microphysics"]) {
37 std::string name = sys.as<std::string>();
38 std::string scheme = node[name][
"scheme"].as<std::string>();
39 if (scheme ==
"Kessler94") {
40 auto p = std::make_shared<Kessler94>(name, node[name]);
43 throw NotFoundError(
"Microphysics", scheme);
static AllMicrophysicalSchemes Create(MeshBlock *pmb, ParameterInput *pin)
static const std::string input_key
microphysics input key in the input file [microphysics_config]
std::vector< MicrophysicalSchemePtr > AllMicrophysicalSchemes