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);
476 std::swap(user_ed,ed_vec);
477 std::swap(user_pr,pr_vec);
478 std::swap(user_nb,nb_vec);
480 reset_interp_nb(user_n);
491 std::swap(user_ed,ed_vec);
492 std::swap(user_pr,pr_vec);
494 reset_interp(user_n);
506 if (ed_vec.size()!=user_n) ed_vec.resize(user_n);
507 if (pr_vec.size()!=user_n) pr_vec.resize(user_n);
508 if (nb_vec.size()!=user_n) nb_vec.resize(user_n);
513 reset_interp_nb(user_n);
524 if (ed_vec.size()!=user_n) ed_vec.resize(user_n);
525 if (pr_vec.size()!=user_n) pr_vec.resize(user_n);
529 reset_interp(user_n);
538 return pe_int.eval(pr);
544 return ep_int.eval(ed);
550 return en_int.eval(ed);
556 return pn_int.eval(pr);
562 return ne_int.eval(nb);
568 return np_int.eval(nb);
706 static const int smooth_trans=0;
707 static const int match_line=1;
761 std::string s_colp, std::string s_colnb=
"");
767 void default_low_dens_eos();
770 void sho11_low_dens_eos();
778 void s12_low_dens_eos(std::string model=
"SLy4",
779 bool external=
false);
785 void gcp10_low_dens_eos(std::string model=
"BSk20",
786 bool external=
false);
793 void ngl13_low_dens_eos(
double L, std::string model=
"PNM",
794 bool external=
false);
807 void ngl13_low_dens_eos2(
double S,
double L,
double nt,
808 std::string fname=
"");
828 virtual void ed_nb_from_pr(
double pr,
double &ed,
double &nb);
836 virtual void get_eden_user(
double pres,
double &ed,
double &nb);
841 void get_transition(
double &ptrans,
double &pwidth);
852 void set_transition(
double ptrans,
double pw);
865 #ifndef DOXYGEN_INTERNAL 872 void internal_read();
927 #ifndef DOXYGEN_NO_O2NS bool err_nonconv
If true, call the error handler if the EOS reports a non-finite value (default true) ...
std::vector< double > full_vecnb
Baryon density.
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.
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
Pressure.
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.
vec_t pr_vec
Pressures from full EOS.
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)
Internal function to reset the interpolation with baryon density.
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)
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.
vec_t ed_vec
Energy densities from full EOS.
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 (this is the default)
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)
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 density.
virtual double pr_from_ed(double ed)
From the energy density, return the pressure.
void reset_interp(size_t n)
Internal function to reset the interpolation.
vec_t nb_vec
Baryon densities from full EOS.
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.