Go to the documentation of this file.
26 #ifndef O2SCL_TOV_EOS_H
27 #define O2SCL_TOV_EOS_H
33 #include <boost/numeric/ublas/vector.hpp>
35 #include <o2scl/constants.h>
36 #include <o2scl/lib_settings.h>
37 #include <o2scl/interp.h>
38 #include <o2scl/table_units.h>
39 #include <o2scl/vector_derint.h>
40 #include <o2scl/root_brent_gsl.h>
42 #ifndef DOXYGEN_NO_O2NS
74 void check_nb(
double &avg_abs_dev,
double &max_abs_dev);
108 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb)=0;
259 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
285 virtual double solve_rad(
double rad,
double gm);
290 virtual double solve_rp(
double rp,
double r,
double gm,
double rad);
396 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
483 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
522 std::swap(user_ed,
ed_vec);
523 std::swap(user_pr,
pr_vec);
524 std::swap(user_nb,
nb_vec);
537 std::swap(user_ed,
ed_vec);
538 std::swap(user_pr,
pr_vec);
584 return pe_int.
eval(pr);
590 return ep_int.
eval(ed);
596 return en_int.
eval(ed);
602 return pn_int.
eval(pr);
608 return ne_int.
eval(nb);
614 return np_int.
eval(nb);
752 static const int smooth_trans=0;
753 static const int match_line=1;
807 std::string s_colp, std::string s_colnb=
"");
825 bool external=
false);
832 bool external=
false);
840 bool external=
false);
854 std::string fname=
"");
874 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
882 virtual void get_eden_user(
double pres,
double &ed,
double &nb);
911 #ifndef DOXYGEN_INTERNAL
973 #ifndef DOXYGEN_NO_O2NS
virtual double ed_from_nb(double nb)=0
From the baryon density, return the energy density.
virtual double pr_from_ed(double ed)
From the energy density, return the pressure.
double efactor
Unit conversion factor for energy density (default 1.0)
double pr1
The pressure at ed1.
virtual double pr_from_ed(double ed)
From the energy density, return the pressure.
virtual double solve_rp(double rp, double r, double gm, double rad)
Solve for as a function of at fixed gravitational mass.
double ed1
The energy density for which the baryon density is known.
void no_low_dens_eos()
Compute with no crust EOS (this is the default)
virtual double solve_rad(double rad, double gm)
Solve for the radius at fixed gravitational mass.
double ed1
The energy density for which the baryon density is known.
bool baryon_column
Set to true if the baryon density is provided in the EOS (default false)
double K
Coefficient (default 1.0)
virtual double nb_from_pr(double pr)
From the pressure, return the baryon density.
virtual double ed_from_pr(double pr)
From the pressure, return the energy density.
void read_vectors_copy(size_t user_n, vec_t &user_ed, vec_t &user_pr, vec_t &user_nb)
Read the EOS from a set of equal length vectors for energy density, pressure, and baryon density.
double ed1
The energy density for which the baryon density is known.
double pr1
The pressure for which the baryon density is known.
virtual void ed_nb_from_pr(double pr, double &ed, double &nb)=0
Given the pressure, produce the energy and number densities.
virtual double nb_from_ed(double ed)
From the energy density, return the baryon density.
std::vector< double > core_vece
Energy densities.
virtual double nb_from_pr(double pr)
From the pressure, return the baryon density.
void read_table(table_units<> &eosat, std::string s_cole, std::string s_colp, std::string s_colnb="")
Specify the EOS through a table.
virtual double ed_from_nb(double nb)
From the baryon density, return the energy density.
virtual double nb_from_pr(double pr)
From the pressure, return the baryon density.
virtual double eval(const double x0) const
void set_cs2_eps0(double cs2_, double eps0_)
Set the sound speed and energy density at zero pressure.
virtual double pr_from_ed(double ed)
From the energy density, return the pressure.
double trans_pres
Transition pressure (in )
The Buchdahl EOS for the TOV solver.
void vector_copy(const vec_t &src, vec2_t &dest)
void reset_interp_nb(size_t n)
Internal function to reset the interpolation with baryon density.
virtual double ed_from_pr(double pr)
From the pressure, return the energy density.
void set_baryon_density(double nb, double ed)
Set the baryon density.
std::vector< double > full_vecp
Pressure.
std::vector< double > crust_vece
Energy densities.
std::vector< double > full_vecnb
Baryon density.
void set(size_t n, const vec_t &x, const vec2_t &y)
virtual double pr_from_ed(double ed)
From the energy density, return the pressure.
virtual double pr_from_ed(double ed)
From the energy density, return the pressure.
virtual double ed_from_nb(double nb)
From the baryon density, return the energy density.
virtual double ed_from_pr(double pr)
From the pressure, return the energy density.
virtual double pr_from_nb(double nb)
From the baryon density, return the pressure.
virtual double pr_from_r_gm(double r, double gm)
Compute the pressure at radius r for a fixed gravitational mass.
Standard polytropic EOS .
virtual double pr_from_nb(double nb)
From the baryon density, return the pressure.
double nb1
The baryon density at ed1.
double pfactor
Unit conversion factor for pressure (default 1.0)
double nb1
The baryon density at ed1.
double nb1
The baryon density at ed1.
virtual double nb_from_pr(double pr)
From the pressure, return the baryon density.
double eps0
The energy density at zero pressure (default 0.0)
void set_transition(double ptrans, double pw)
Set the transition pressure and "width".
void check_nb(double &avg_abs_dev, double &max_abs_dev)
Check that the baryon density is consistent with the .
bool has_baryons()
Return true if a baryon density is available.
void set_baryon_density(double nb, double ed)
Set the baryon density.
virtual double nb_from_ed(double ed)
From the energy density, return the baryon density.
std::vector< double > core_vecnb
Baryon densities.
void reset_interp(size_t n)
Internal function to reset the interpolation.
void get_transition(double &ptrans, double &pwidth)
Get the transition pressure (in the user-specified unit system) and width.
virtual double nb_from_ed(double ed)=0
From the energy density, return the baryon density.
virtual double ed_from_r_gm(double r, double gm)
Compute the energy density at radius r for a fixed gravitational mass.
bool err_nonconv
If true, call the error handler if the EOS reports a non-finite value (default true)
virtual double pr_from_nb(double nb)
From the baryon density, return the pressure.
virtual double nb_from_ed(double ed)
From the energy density, return the baryon density.
vec_t ed_vec
Energy densities from full EOS.
virtual double nb_from_ed(double ed)
From the energy density, return the baryon density.
root_brent_gsl rbg
Solver.
void set_baryon_density(double nb, double ed)
Set the baryon density.
void internal_read()
Internal function to reinterpolate if if either the core or crust tables are changed.
virtual void ed_nb_from_pr(double pr, double &ed, double &nb)
Given the pressure, produce the energy and number densities.
double n
Index (default 3.0)
void ngl13_low_dens_eos2(double S, double L, double nt, std::string fname="")
Crust EOS from Newton13 given S and L in MeV and a transition density.
virtual double ed_from_pr(double pr)
From the pressure, return the energy density.
int verbose
Control for output (default 1)
void read_vectors_copy(size_t user_n, vec_t &user_ed, vec_t &user_pr)
Read the EOS from a pair of equal length vectors for energy density and pressure.
double cs2
Coefficient (default 1.0)
virtual void ed_nb_from_pr(double pr, double &ed, double &nb)
Given the pressure, produce the energy and number densities.
virtual double ed_from_nb(double nb)
From the baryon density, return the energy density.
void default_low_dens_eos()
Standard crust EOS from Negele73 and Baym71tg.
vec_t pr_vec
Pressures from full EOS.
vec_t nb_vec
Baryon densities from full EOS.
Provide an EOS for TOV solvers based on interpolation of user-supplied vectors.
std::vector< double > crust_vecnb
Baryon densities.
void read_vectors_swap(size_t user_n, vec_t &user_ed, vec_t &user_pr)
Read the EOS from a pair of equal length vectors for energy density and pressure.
virtual double nb_from_pr(double pr)
From the pressure, return the baryon density.
virtual double ed_from_nb(double nb)
From the baryon density, return the energy density.
std::vector< double > full_vece
Energy density.
virtual void ed_nb_from_pr(double pr, double &ed, double &nb)
Given the pressure, produce the energy and number densities.
An EOS for the TOV solver using simple linear interpolation and an optional crust EOS.
virtual double pr_from_nb(double nb)
From the baryon density, return the pressure.
virtual double nb_from_ed(double ed)
From the energy density, return the baryon density.
virtual double ed_from_nb(double nb)
From the baryon density, return the energy density.
std::vector< double > crust_vecp
Pressures.
virtual void get_eden_user(double pres, double &ed, double &nb)
Get the energy density from the pressure in the user-specified unit system.
virtual void ed_nb_from_pr(double pr, double &ed, double &nb)
Given the pressure, produce the energy and number densities.
void sho11_low_dens_eos()
Crust EOS from Shen11b.
double nfactor
Unit conversion factor for baryon density (default 1.0)
virtual double ed_from_pr(double pr)=0
From the pressure, return the energy density.
A EOS base class for the TOV solver.
virtual double pr_from_nb(double nb)=0
From the baryon density, return the pressure.
double pr1
The pressure at ed1.
double Pstar
The parameter with units of pressure in units of solar masses per km cubed (default value )
void s12_low_dens_eos(std::string model="SLy4", bool external=false)
Crust EOS from Steiner12.
void gcp10_low_dens_eos(std::string model="BSk20", bool external=false)
Crust EOS from Goriely, Chamel, and Pearson.
double trans_width
Transition width (unitless)
void set_coeff_index(double coeff, double index)
Set the coefficient and polytropic index.
void ngl13_low_dens_eos(double L, std::string model="PNM", bool external=false)
Crust EOS from Newton13 given L in MeV.
bool use_crust
Set to true if we are using a crust EOS (default false)
virtual double nb_from_pr(double pr)=0
From the pressure, return the baryon density.
void read_vectors_swap(size_t user_n, vec_t &user_ed, vec_t &user_pr, vec_t &user_nb)
Read the EOS from a set of equal length vectors for energy density, pressure, and baryon density.
virtual double ed_from_pr(double pr)
From the pressure, return the energy density.
std::vector< double > core_vecp
Pressures.
virtual double pr_from_ed(double ed)=0
From the energy density, return the pressure.
virtual double rad_from_gm(double gm)
Given the gravitational mass, compute the radius.
virtual void ed_nb_from_pr(double pr, double &ed, double &nb)
Given the pressure, produce the energy and number densities.
virtual double pr_from_nb(double nb)
From the baryon density, return the pressure.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).