Skip to content

Commit

Permalink
Allow gendisk2d to create an arbitrary EmpCyl2d basis
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin D. Weinberg committed Nov 26, 2024
1 parent 34a8dcf commit 9ec4f4a
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions utils/ICs/initial2d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ main(int ac, char **av)
int nhalo, ndisk;
std::string hbods, dbods, suffix, centerfile, halofile1, halofile2;
std::string cachefile, config, gentype, dtype, dmodel, mtype, ctype;
std::string diskconf;

const std::string mesg("Generates a Monte Carlo realization of a halo with an\n embedded disk using Jeans' equations\n");

Expand Down Expand Up @@ -370,6 +371,8 @@ main(int ac, char **av)
cxxopts::value<int>(M)->default_value("2"))
("pert", "For testing a quadrupole distribution using test2d",
cxxopts::value<double>(pert)->default_value("0.0"))
("diskconf", "Custom disk configuration file for basis construction",
cxxopts::value<std::string>(diskconf))
("allow", "Allow multimass algorithm to generature negative masses for testing")
("nomono", "Allow non-monotonic mass interpolation")
("report", "Print out progress in BiorthCyl table evaluation")
Expand Down Expand Up @@ -582,16 +585,30 @@ main(int ac, char **av)
yml << YAML::Key << "verbose" << YAML::Value << true;

// Build the diskconf stanza
yml << YAML::Key << "diskconf" << YAML::BeginMap
<< YAML::Key << "name" << YAML::Value << "expon"
<< YAML::Key << "parameters"
<< YAML::BeginMap
<< YAML::Key << "aexp" << YAML::Value << ACYL
<< YAML::EndMap
<< YAML::EndMap;

// End the configuration map
yml << YAML::EndMap;
yml << YAML::Key << "diskconf";
if (vm.count("diskconf")) {
YAML::Node node = YAML::Load(vm["diskconf"].as<std::string>());
yml << YAML::Value << node;
}
else {
// Begin the map
yml << YAML::BeginMap
<< YAML::Key << "name" << YAML::Value << "expon"
<< YAML::Key << "parameters"
<< YAML::BeginMap
<< YAML::Key << "aexp" << YAML::Value << ACYL
<< YAML::EndMap
<< YAML::EndMap;
// End the configuration map
yml << YAML::EndMap;
}

// TEST
std::cout << std::string(80, '-') << std::endl
<< "Test output" << std::endl
<< std::string(80, '-') << std::endl
<< yml.c_str() << std::endl
<< std::string(80, '-') << std::endl;

// Create expansion only if needed . . .
std::shared_ptr<Disk2d> expandd;
Expand Down

0 comments on commit 9ec4f4a

Please sign in to comment.