1 #ifndef SRC_VIRTUAL_GROUPS_HPP_
2 #define SRC_VIRTUAL_GROUPS_HPP_
7 #include <unordered_map>
10 #include <yaml-cpp/yaml.h>
13 #include <athena/athena.hpp>
16 #include <configure.hpp>
22 class OutputParameters;
52 for (
auto it = node.begin(); it != node.end(); ++it) {
53 params_real_[it->first.as<std::string>()] = it->second.as<Real>();
58 void SetPar(std::string
const &name, Real value) {
66 void SetPar(std::string
const &name, std::string
const &value) {
72 T
GetPar(std::string
const &name)
const;
75 bool HasPar(std::string
const &name)
const {
95 inline int ParameterGroup::GetPar<int>(std::string
const &name)
const {
100 inline Real ParameterGroup::GetPar<Real>(std::string
const &name)
const {
105 inline std::string ParameterGroup::GetPar<std::string>(
106 std::string
const &name)
const {
107 return params_str_.at(name);
118 for (
auto const &name : species_names) {
virtual ~ASCIIOutputGroup()
virtual void WriteAsciiHeader(OutputParameters const *) const =0
virtual void WriteAsciiData(OutputParameters const *) const =0
virtual void WriteBinaryData(std::ofstream &os) const =0
virtual void WriteBinaryHeader(std::ofstream &os) const =0
virtual ~BinaryOutputGroup()
virtual bool CheckWarn() const
virtual void CheckFail() const
This function fails if the check fails.
void SetCooldownTime(Real cooldown)
void DecrementCounter(Real dt)
virtual bool ShouldFITSOutput(std::string variable_name) const =0
virtual void LoadFITSOutputData(OutputType *out, int *num_vars) const =0
virtual ~FITSOutputGroup()
void SetFlag(uint64_t flag)
int TestFlag(uint64_t flag) const
FlagGroup(uint64_t flags=0LL)
uint64_t myflags_
internal flags
static IndexMap const * GetInstance()
virtual void LoadMeshOutputData(OutputType *out, int *num_vars) const =0
virtual ~MeshOutputGroup()
virtual bool ShouldMeshOutput(std::string variable_name) const =0
NamedGroup(std::string name)
std::string GetName() const
T GetPar(std::string const &name) const
Get parameter.
virtual ~ParameterGroup()
void SetPar(std::string const &name, Real value)
Set real parameter.
void SetPar(std::string const &name, int value)
Set int parameter.
std::unordered_map< std::string, int > params_int_
int parameters
bool HasPar(std::string const &name) const
Check if a parameter exists.
std::unordered_map< std::string, std::string > params_str_
string parameters
void SetRealsFrom(YAML::Node const &node)
std::unordered_map< std::string, Real > params_real_
real parameters
void SetPar(std::string const &name, std::string const &value)
Set string parameter.
virtual size_t RestartDataSizeInBytes(Mesh const *pm) const =0
virtual size_t LoadRestartData(char *psrt)=0
virtual void DumpRestartData(char *pdst) const =0
std::vector< int > cloud_index_
indices of clouds
int GetSpeciesIndex(int n) const
virtual ~SpeciesIndexGroup()
void SetSpeciesIndex(std::vector< std::string > const &species_names)
Set species index based on species names.
std::vector< int > const & GetCloudIndexArray() const
std::vector< int > chemistry_index_
indices of chemical species
int GetChemistryIndex(int n) const
int GetCloudIndex(int n) const
std::vector< int > const & GetSpeciesIndexArray() const
std::vector< int > species_index_
indices of species
std::vector< int > const & GetChemistryIndexArray() const