23#include "nlohmann/json_fwd.hpp"
27#include <nlohmann/json.hpp>
44 using Tscal = shambase::VecComponent<Tvec>;
132 inline void set_locally_isothermalFA2014(
Tscal h_over_r) {
136 inline void set_locally_isothermalFA2014_extended(
160 if constexpr (std::is_same_v<f32_3, Tvec>) {
164 if constexpr (std::is_same_v<f64_3, Tvec>) {
168 logger::raw_ln(
"EOS config", s,
":");
169 if (
Isothermal *eos_config = std::get_if<Isothermal>(&config)) {
170 logger::raw_ln(
"isothermal : ");
171 logger::raw_ln(
"cs", eos_config->cs);
172 }
else if (
Adiabatic *eos_config = std::get_if<Adiabatic>(&config)) {
173 logger::raw_ln(
"adiabatic : ");
174 logger::raw_ln(
"gamma", eos_config->gamma);
175 }
else if (
Polytropic *eos_config = std::get_if<Polytropic>(&config)) {
176 logger::raw_ln(
"polytropic : ");
177 logger::raw_ln(
"K", eos_config->K);
178 logger::raw_ln(
"gamma", eos_config->gamma);
179 }
else if (
LocallyIsothermal *eos_config = std::get_if<LocallyIsothermal>(&config)) {
180 logger::raw_ln(
"locally isothermal : ");
182 logger::raw_ln(
"locally isothermal (Lodato Price 2007) : ");
185 logger::raw_ln(
"locally isothermal (Farris 2014) : ");
188 = std::get_if<LocallyIsothermalFA2014Extended>(&config)) {
189 logger::raw_ln(
"locally isothermal (Farris 2014 extended) : ");
190 }
else if (
Fermi *eos_config = std::get_if<Fermi>(&config)) {
191 logger::raw_ln(
"Fermi : ");
192 logger::raw_ln(
"mu_e", eos_config->mu_e);
std::uint32_t u32
32 bit unsigned integer
This header file contains utility functions related to exception handling in the code.
void throw_unimplemented(SourceLocation loc=SourceLocation{})
Throw a std::runtime_error saying that the function is unimplemented.
void to_json(nlohmann::json &j, const EOSConfig< Tvec > &p)
Serialize EOSConfig to json.
void from_json(const nlohmann::json &j, EOSConfig< Tvec > &p)
Deserializes an EOSConfig<Tvec> from a JSON object.
Locally isothermal equation of state configuration.
Configuration struct for the equation of state used in the hydrodynamic models.
void set_isothermal(Tscal cs)
Set the EOS configuration to an isothermal equation of state.
Variant config
Current EOS configuration.
shamphys::EOS_Config_Polytropic< Tscal > Polytropic
Polytropic equation of state configuration.
shamphys::EOS_Config_Isothermal< Tscal > Isothermal
Isothermal equation of state configuration.
void print_status()
Print current status of the EOSConfig.
shamphys::EOS_Config_LocallyIsothermalDisc_Farris2014< Tscal > LocallyIsothermalFA2014
Locally isothermal equation of state configuration from Lodato Price 2007.
void set_adiabatic(Tscal gamma)
Set the EOS configuration to an adiabatic equation of state.
shamphys::EOS_Config_LocallyIsothermal_LP07< Tscal > LocallyIsothermalLP07
Locally isothermal equation of state configuration from Lodato Price 2007.
void set_polytropic(Tscal K, Tscal gamma)
Set the EOS configuration to an polytropic equation of state.
shamphys::EOS_Config_LocallyIsothermalDisc_ExtendedFarris2014< Tscal > LocallyIsothermalFA2014Extended
Locally isothermal equation of state configuration from Farris 2014 extended to q !...
void set_fermi(Tscal mu_e)
Set the EOS configuration to a Fermi equation of state.
void set_locally_isothermalLP07(Tscal cs0, Tscal q, Tscal r0)
Set the EOS configuration to a locally isothermal equation of state (Lodato Price 2007)
static constexpr u32 dim
Dimension of the vector quantities.
shamphys::EOS_Config_Adiabatic< Tscal > Adiabatic
Adiabatic equation of state configuration.
void set_locally_isothermal()
Set the EOS configuration to a locally isothermal equation of state.
std::variant< Isothermal, Adiabatic, Polytropic, LocallyIsothermal, LocallyIsothermalLP07, LocallyIsothermalFA2014, LocallyIsothermalFA2014Extended, Fermi > Variant
Variant type to store the EOS configuration.
shambase::VecComponent< Tvec > Tscal
Scalar type associated to the vector template type.
Configuration struct for adiabatic equation of state.
Configuration struct for Fermi equation of state.
Configuration struct for isothermal equation of state.
Configuration struct for the locally isothermal equation of state extended from Farris 2014 to includ...
Configuration struct for the locally isothermal equation of state from Farris 2014.
Configuration struct for the locally isothermal equation of state from Lodato Price 2007.
Configuration struct for polytropic equation of state.