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> 41 #ifndef DOXYGEN_NO_O2NS 73 void check_nb(
double &avg_abs_dev,
double &max_abs_dev);
107 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb)=0;
187 void set_baryon_density(
double nb,
double ed);
218 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
243 int solve_u_rp_fun(
size_t bv,
const std::vector<double> &bx,
244 std::vector<double> &by);
318 void set_coeff_index(
double coeff,
double index);
322 void set_baryon_density(
double nb,
double ed);
350 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
405 void set_cs2_eps0(
double cs2_,
double eps0_);
409 void set_baryon_density(
double nb,
double ed);
437 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
475 std::swap(user_ed,ed);
476 std::swap(user_pr,pr);
477 std::swap(user_nb,nb);
479 reset_interp_nb(user_n);
490 std::swap(user_ed,ed);
491 std::swap(user_pr,pr);
493 reset_interp(user_n);
505 if (ed.size()!=user_n) ed.resize(user_n);
506 if (pr.size()!=user_n) pr.resize(user_n);
507 if (nb.size()!=user_n) nb.resize(user_n);
512 reset_interp_nb(user_n);
523 if (ed.size()!=user_n) ed.resize(user_n);
524 if (pr.size()!=user_n) pr.resize(user_n);
528 reset_interp(user_n);
537 return pe_int.eval(pr);
543 return ep_int.eval(pr);
549 return en_int.eval(ed);
555 return pn_int.eval(ed);
561 return ne_int.eval(ed);
567 return np_int.eval(ed);
686 static const int smooth_trans=0;
687 static const int match_line=1;
736 std::string s_colp, std::string s_colnb=
"");
742 void default_low_dens_eos();
745 void sho11_low_dens_eos();
753 void s12_low_dens_eos(std::string model=
"SLy4",
754 bool external=
false);
760 void gcp10_low_dens_eos(std::string model=
"BSk20",
761 bool external=
false);
768 void ngl13_low_dens_eos(
double L, std::string model=
"PNM",
769 bool external=
false);
782 void ngl13_low_dens_eos2(
double S,
double L,
double nt,
783 std::string fname=
"");
803 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
811 virtual void get_eden_user(
double pres,
double &ed,
double &nb);
816 void get_transition(
double &ptrans,
double &pwidth);
827 void set_transition(
double ptrans,
double pw);
840 #ifndef DOXYGEN_INTERNAL 847 void internal_read();
902 #ifndef DOXYGEN_NO_O2NS std::vector< double > full_vecnb
Baryon densities from full EOS.
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. ...
std::vector< double > core_vecnb
Baryon densities.
double pr1
The pressure for which the baryon density is known.
vec_t ed
Energy densities from full EOS.
virtual double nb_from_ed(double ed)=0
From the energy density, return the baryon density.
std::vector< double > crust_vecnb
Baryon densities.
std::vector< double > crust_vecp
Pressures.
virtual double nb_from_pr(double pr)=0
From the pressure, return the baryon density.
virtual void ed_nb_from_pr(double pr, double &ed, double &nb)=0
Given the pressure, produce the energy and number densities.
virtual double ed_from_pr(double pr)
From the pressure, return the energy density.
std::vector< double > full_vecp
Pressures from full EOS.
virtual double ed_from_nb(double nb)=0
From the baryon density, return the energy density.
double eps0
The energy density at zero pressure (default 0.0)
virtual double ed_from_nb(double nb)
From the baryon density, return the energy density.
double ed1
The energy density for which the baryon density is known.
double pr1
The pressure at ed1.
double trans_pres
Transition pressure (in )
double K
Coefficient (default 1.0)
double ed1
The energy density for which the baryon density is known.
virtual double nb_from_ed(double ed)
From the energy density, return the baryon density.
double pfactor
Unit conversion factor for pressure (default 1.0)
std::vector< double > core_vecp
Pressures.
virtual double pr_from_ed(double ed)=0
From the energy density, return the pressure.
virtual void ed_nb_from_pr(double pr, double &ed, double &nb)
Given the pressure, produce the energy and number densities.
double Pstar
The parameter with units of pressure in units of solar masses per km cubed (default value ) ...
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. ...
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...
std::vector< double > crust_vece
Energy densities.
void reset_interp_nb(size_t n)
Desc.
double nb1
The baryon density at ed1.
virtual double nb_from_pr(double pr)
From the pressure, return the baryon density.
void vector_copy(const vec_t &src, vec2_t &dest)
vec_t pr
Pressures from full EOS.
double n
Index (default 3.0)
double ed1
The energy density for which the baryon density is known.
An EOS for the TOV solver using simple linear interpolation and an optional crust EOS...
bool has_baryons()
Return true if a baryon density is available.
A EOS base class for the TOV solver.
virtual double pr_from_nb(double nb)
From the baryon density, return the pressure.
Provide an EOS for TOV solvers based on interpolation of user-supplied vectors.
virtual double ed_from_pr(double pr)=0
From the pressure, return the energy density.
void no_low_dens_eos()
Compute with no crust EOS.
Standard polytropic EOS .
double cs2
Coefficient (default 1.0)
double pr1
The pressure at ed1.
void check_nb(double &avg_abs_dev, double &max_abs_dev)
Check that the baryon density is consistent with the .
double nb1
The baryon density at ed1.
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 efactor
Unit conversion factor for energy density (default 1.0)
double nfactor
Unit conversion factor for baryon density (default 1.0)
vec_t nb
Baryon densities from full EOS.
bool use_crust
Set to true if we are using a crust EOS (default false)
int verbose
Control for output (default 1)
bool baryon_column
Set to true if the baryon density is provided in the EOS (default false)
std::vector< double > full_vece
Energy densities from full EOS.
virtual double pr_from_ed(double ed)
From the energy density, return the pressure.
void reset_interp(size_t n)
Desc.
double nb1
The baryon density at ed1.
virtual double pr_from_nb(double nb)=0
From the baryon density, return the pressure.
double trans_width
Transition width (unitless)
std::vector< double > core_vece
Energy densities.
The Buchdahl EOS for the TOV solver.