Class eos_tov (o2scl)

O2scl : Class List

class eos_tov

A EOS base class for the TOV solver.

The class o2scl::tov_solve uses only the functions baryons_only() and ed_nb_from_pr(). Thus the function ed_nb_from_pr() must work with pressure and energy density in units of \( \mathrm{M}_\odot/\mathrm{km}^3\) and baryon density in units of \( 1/\mathrm{fm}^3 \). This requirement holds, for example, even when if o2scl::tov_solve::set_units() is used to modify the units of the output of the TOV solver.

Subclassed by o2scl::eos_cs2_poly, o2scl::eos_nstar_rot, o2scl::eos_tov_buchdahl, o2scl::eos_tov_interp, o2scl::eos_tov_linear, o2scl::eos_tov_polytrope, o2scl::eos_tov_vectors< vec_t >

Public Functions

eos_tov()
inline virtual ~eos_tov()
inline bool has_baryons()

Return true if a baryon density is available.

void check_nb(double &avg_abs_dev, double &max_abs_dev)

Check that the baryon density is consistent with the \( P(\varepsilon) \).

virtual double ed_from_pr(double pr) = 0

From the pressure, return the energy density.

virtual double pr_from_ed(double ed) = 0

From the energy density, return the pressure.

virtual double nb_from_ed(double ed) = 0

From the energy density, return the baryon density.

virtual double nb_from_pr(double pr) = 0

From the pressure, return the baryon density.

virtual double ed_from_nb(double nb) = 0

From the baryon density, return the energy density.

virtual double pr_from_nb(double nb) = 0

From the baryon density, return the pressure.

virtual void ed_nb_from_pr(double pr, double &ed, double &nb) = 0

Given the pressure, produce the energy and number densities.

The TOV solver o2scl::tov_solve assumes that pr and ed are always in \( M_{\odot}/\mathrm{km}^3 \) and that nb is always in in \( \mathrm{fm}^{-3} \) .

If has_baryons() is false, then nb is unmodified by o2scl::tov_solve.

Public Members

int verbose

Control for output (default 1)

Protected Attributes

bool baryon_column

Set to true if the baryon density is provided in the EOS (default false)