SpECTRE  v2024.04.12
EquationsOfState::Tabulated3D< IsRelativistic > Class Template Reference

Nuclear matter equation of state in tabulated form. More...

#include <Tabulated3d.hpp>

Classes

struct  TableFilename
 
struct  TableSubFilename
 

Public Types

enum  : size_t {
  Epsilon = 0 , Pressure , CsSquared , DeltaMu ,
  NumberOfVars
}
 Fields stored in the table.
 
using options = tmpl::list< TableFilename, TableSubFilename >
 
- Public Types inherited from EquationsOfState::EquationOfState< IsRelativistic, 3 >
using creatable_classes = typename detail::DerivedClasses< IsRelativistic, 3 >::type
 

Public Member Functions

 Tabulated3D (const Tabulated3D &)=default
 
Tabulated3Doperator= (const Tabulated3D &)=default
 
 Tabulated3D (Tabulated3D &&)=default
 
Tabulated3Doperator= (Tabulated3D &&)=default
 
 Tabulated3D (const std::string &filename, const std::string &subfilename)
 
 Tabulated3D (std::vector< double > electron_fraction, std::vector< double > log_density, std::vector< double > log_temperature, std::vector< double > table_data, double energy_shift, double enthalpy_minimum)
 
 Tabulated3D (const h5::EosTable &spectre_eos)
 
template<class DataType >
void convert_to_table_quantities (const gsl::not_null< Scalar< DataType > * > converted_electron_fraction, const gsl::not_null< Scalar< DataType > * > log_rest_mass_density, const gsl::not_null< Scalar< DataType > * > log_temperature, const Scalar< DataType > &electron_fraction, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &temperature) const
 
std::unique_ptr< EquationOfState< IsRelativistic, 3 > > get_clone () const override
 
void initialize (std::vector< double > electron_fraction, std::vector< double > log_density, std::vector< double > log_temperature, std::vector< double > table_data, double energy_shift, double enthalpy_minimum)
 
void initialize (const h5::EosTable &spectre_eos)
 
bool is_equal (const EquationOfState< IsRelativistic, 3 > &rhs) const override
 
bool is_barotropic () const override
 Returns true if the EOS is barotropic. More...
 
bool operator== (const Tabulated3D< IsRelativistic > &rhs) const
 
bool operator!= (const Tabulated3D< IsRelativistic > &rhs) const
 
template<class DataType >
Scalar< DataType > equilibrium_electron_fraction_from_density_temperature_impl (const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &temperature) const
 
template<typename DataType >
void enforce_physicality (Scalar< DataType > &electron_fraction, Scalar< DataType > &density, Scalar< DataType > &temperature) const
 
 WRAPPED_PUPable_decl_base_template (SINGLE_ARG(EquationOfState< IsRelativistic, 3 >), Tabulated3D)
 
double electron_fraction_lower_bound () const override
 The lower bound of the electron fraction that is valid for this EOS. More...
 
double electron_fraction_upper_bound () const override
 The upper bound of the electron fraction that is valid for this EOS. More...
 
double rest_mass_density_lower_bound () const override
 The lower bound of the rest mass density that is valid for this EOS. More...
 
double rest_mass_density_upper_bound () const override
 The upper bound of the rest mass density that is valid for this EOS. More...
 
double temperature_lower_bound () const override
 The lower bound of the temperature that is valid for this EOS. More...
 
double temperature_upper_bound () const override
 The upper bound of the temperature that is valid for this EOS. More...
 
double specific_internal_energy_lower_bound (const double rest_mass_density, const double electron_fraction) const override
 The lower bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\) and electron fraction \(Y_e\). More...
 
double specific_internal_energy_upper_bound (const double rest_mass_density, const double electron_fraction) const override
 The upper bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\). More...
 
double specific_enthalpy_lower_bound () const override
 The lower bound of the specific enthalpy that is valid for this EOS. More...
 
double baryon_mass () const override
 The baryon mass for this EoS. More...
 
Scalar< double > equilibrium_electron_fraction_from_density_temperature (const Scalar< double > &rest_mass_density, const Scalar< double > &temperature) const
 
Scalar< DataVectorequilibrium_electron_fraction_from_density_temperature (const Scalar< DataVector > &rest_mass_density, const Scalar< DataVector > &temperature) const
 
- Public Member Functions inherited from EquationsOfState::EquationOfState< IsRelativistic, 3 >
 EquationOfState (const EquationOfState &)=default
 
EquationOfStateoperator= (const EquationOfState &)=default
 
 EquationOfState (EquationOfState &&)=default
 
EquationOfStateoperator= (EquationOfState &&)=default
 
 EquationOfState (CkMigrateMessage *msg)
 
 WRAPPED_PUPable_abstract (EquationOfState)
 
virtual std::unique_ptr< EquationOfState< IsRelativistic, 3 > > get_clone () const =0
 
virtual bool is_equal (const EquationOfState< IsRelativistic, 3 > &rhs) const =0
 
virtual std::unique_ptr< EquationOfState< IsRelativistic, 3 > > promote_to_3d_eos ()
 
virtual bool is_barotropic () const =0
 Returns true if the EOS is barotropic. More...
 
virtual double electron_fraction_lower_bound () const =0
 The lower bound of the electron fraction that is valid for this EOS. More...
 
virtual double electron_fraction_upper_bound () const =0
 The upper bound of the electron fraction that is valid for this EOS. More...
 
virtual double rest_mass_density_lower_bound () const =0
 The lower bound of the rest mass density that is valid for this EOS. More...
 
virtual double rest_mass_density_upper_bound () const =0
 The upper bound of the rest mass density that is valid for this EOS. More...
 
virtual double specific_internal_energy_lower_bound (const double rest_mass_density, const double electron_fraction) const =0
 The lower bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\) and electron fraction \(Y_e\). More...
 
virtual double specific_internal_energy_upper_bound (const double rest_mass_density, const double electron_fraction) const =0
 The upper bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\) and electron fraction \(Y_e\). More...
 
virtual double specific_enthalpy_lower_bound () const =0
 The lower bound of the specific enthalpy that is valid for this EOS. More...
 
virtual double temperature_lower_bound () const =0
 The lower bound of the temperature that is valid for this EOS. More...
 
virtual double temperature_upper_bound () const =0
 The upper bound of the temperature that is valid for this EOS. More...
 
virtual double baryon_mass () const
 The vacuum mass of a baryon for this EOS. More...
 
virtual Scalar< double > pressure_from_density_and_energy (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0
 
virtual Scalar< DataVectorpressure_from_density_and_energy (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0
 
virtual Scalar< double > pressure_from_density_and_temperature (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0
 
virtual Scalar< DataVectorpressure_from_density_and_temperature (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0
 
virtual Scalar< double > temperature_from_density_and_energy (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0
 
virtual Scalar< DataVectortemperature_from_density_and_energy (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0
 
virtual Scalar< double > specific_internal_energy_from_density_and_temperature (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0
 
virtual Scalar< DataVectorspecific_internal_energy_from_density_and_temperature (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0
 
virtual Scalar< double > sound_speed_squared_from_density_and_temperature (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0
 
virtual Scalar< DataVectorsound_speed_squared_from_density_and_temperature (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0
 

Static Public Attributes

static constexpr size_t thermodynamic_dim = 3
 
static constexpr bool is_relativistic = IsRelativistic
 
static constexpr Options::String help
 
- Static Public Attributes inherited from EquationsOfState::EquationOfState< IsRelativistic, 3 >
static constexpr bool is_relativistic = IsRelativistic
 
static constexpr size_t thermodynamic_dim = 3
 

Detailed Description

template<bool IsRelativistic>
class EquationsOfState::Tabulated3D< IsRelativistic >

Nuclear matter equation of state in tabulated form.

The equation of state takes the form

\[ p = p (T, rho, Y_e) \]

where \(\rho\) is the rest mass density, \(T\) is the temperature, and \(Y_e\) is the electron fraction. The temperature is given in units of MeV.

Member Function Documentation

◆ baryon_mass()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::baryon_mass ( ) const
inlineoverridevirtual

The baryon mass for this EoS.

Reimplemented from EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ electron_fraction_lower_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::electron_fraction_lower_bound ( ) const
inlineoverridevirtual

The lower bound of the electron fraction that is valid for this EOS.

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ electron_fraction_upper_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::electron_fraction_upper_bound ( ) const
inlineoverridevirtual

The upper bound of the electron fraction that is valid for this EOS.

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ equilibrium_electron_fraction_from_density_temperature() [1/2]

template<bool IsRelativistic>
Scalar< DataVector > EquationsOfState::Tabulated3D< IsRelativistic >::equilibrium_electron_fraction_from_density_temperature ( const Scalar< DataVector > &  rest_mass_density,
const Scalar< DataVector > &  temperature 
) const
inline

Computes the electron fraction in beta-equilibrium \(Y_e^{\rm eq}\) from the rest mass density \(\rho\) and the temperature \(T\).

◆ equilibrium_electron_fraction_from_density_temperature() [2/2]

template<bool IsRelativistic>
Scalar< double > EquationsOfState::Tabulated3D< IsRelativistic >::equilibrium_electron_fraction_from_density_temperature ( const Scalar< double > &  rest_mass_density,
const Scalar< double > &  temperature 
) const
inline

Computes the electron fraction in beta-equilibrium \(Y_e^{\rm eq}\) from the rest mass density \(\rho\) and the temperature \(T\).

◆ get_clone()

template<bool IsRelativistic>
std::unique_ptr< EquationOfState< IsRelativistic, 3 > > EquationsOfState::Tabulated3D< IsRelativistic >::get_clone ( ) const
overridevirtual

◆ is_barotropic()

template<bool IsRelativistic>
bool EquationsOfState::Tabulated3D< IsRelativistic >::is_barotropic ( ) const
inlineoverridevirtual

Returns true if the EOS is barotropic.

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ is_equal()

template<bool IsRelativistic>
bool EquationsOfState::Tabulated3D< IsRelativistic >::is_equal ( const EquationOfState< IsRelativistic, 3 > &  rhs) const
overridevirtual

◆ rest_mass_density_lower_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::rest_mass_density_lower_bound ( ) const
inlineoverridevirtual

The lower bound of the rest mass density that is valid for this EOS.

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ rest_mass_density_upper_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::rest_mass_density_upper_bound ( ) const
inlineoverridevirtual

The upper bound of the rest mass density that is valid for this EOS.

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ specific_enthalpy_lower_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::specific_enthalpy_lower_bound ( ) const
inlineoverridevirtual

The lower bound of the specific enthalpy that is valid for this EOS.

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ specific_internal_energy_lower_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::specific_internal_energy_lower_bound ( const double  rest_mass_density,
const double  electron_fraction 
) const
overridevirtual

The lower bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\) and electron fraction \(Y_e\).

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ specific_internal_energy_upper_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::specific_internal_energy_upper_bound ( const double  rest_mass_density,
const double  electron_fraction 
) const
overridevirtual

The upper bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\).

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ temperature_lower_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::temperature_lower_bound ( ) const
inlineoverridevirtual

The lower bound of the temperature that is valid for this EOS.

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

◆ temperature_upper_bound()

template<bool IsRelativistic>
double EquationsOfState::Tabulated3D< IsRelativistic >::temperature_upper_bound ( ) const
inlineoverridevirtual

The upper bound of the temperature that is valid for this EOS.

Implements EquationsOfState::EquationOfState< IsRelativistic, 3 >.

Member Data Documentation

◆ help

template<bool IsRelativistic>
constexpr Options::String EquationsOfState::Tabulated3D< IsRelativistic >::help
staticconstexpr
Initial value:
= {
"A tabulated three-dimensional equation of state.\n"
"The energy density, pressure and sound speed "
"are tabulated as a function of density, electron_fraction and "
"temperature."}

The documentation for this class was generated from the following file: