Class eos_nstar_rot_interp (o2scl)¶
-
class
o2scl
::
eos_nstar_rot_interp
: public o2scl::eos_nstar_rot¶ Create a tabulated EOS for nstar_rot using interpolation.
The tabulated EOS is stored in the following units
log_e_tab is the log of the energy density in units of \( 10^{15}~\mathrm{g}/\mathrm{cm}^3 \)
log_p_tab is the log of the pressure in units of \( 10^{15}~\mathrm{g}/\mathrm{cm}^3 \)
log_h_tab is the log of the pseudo-enthalpy
log_n0_tab is the log of the baryon density in units of \( 1/\mathrm{cm}^3 \)
The user specified EOS must have a monotonically increasing baryon chemical potential, as guaranteed, for example, by eos_tov::rns_C_low_dens_eos().
- Idea for Future:
Replace arrays with vectors and fix unit-indexing.
Subclassed by o2scl::eos_nstar_rot_C, o2scl::eos_nstar_rot_L
Constants
-
double
C
¶ Speed of light in vacuum (in CGS units)
-
double
G
¶ Gravitational constant (in CGS units)
-
double
KAPPA
¶ Square of length scale in CGS units, \( \kappa \equiv 10^{-15} c^2/G \).
-
double
KSCALE
¶ The value \( 10^{-15}/c^2 \).
-
int
n_nearest
¶ Cache for interpolation.
-
double
interp
(double xp[], double yp[], int np, double xb)¶ Driver for the interpolation routine.
First we find the tab. point nearest to xb, then we interpolate using four points around xb.
Note that this version, since the EOS arrays are now 0 indexed, is different than the nstar_rot version. There is also a bit of extra arithmetic in this function below which is probably unnecessary which is left over from the shift from unit to zero-indexing.
-
eos_nstar_rot_interp
()¶
-
template<class
vec1_t
, classvec2_t
, classvec3_t
, classvec4_t
>
voidset_eos_native
(vec1_t &eden, vec2_t &pres, vec3_t &enth, vec4_t &nb)¶ Set the EOS from four vectors in the native unit system.
-
template<class
vec1_t
, classvec2_t
, classvec3_t
>
voidset_eos_fm
(size_t n, vec1_t &eden, vec2_t &pres, vec3_t &nb)¶ Set the EOS from energy density, pressure, and baryon density stored in powers of \( \mathrm{fm} \) .
This function appends the default RNS crust and thus the
eden
,pres
, andnb
vectors should not contain points corresponding to the EOS for baryon densities smaller than \( 0.07463~\mathrm{fm}^{-3} \).
-
template<class
vec1_t
, classvec2_t
, classvec3_t
>
voidset_eos_crust_fm
(size_t n, vec1_t &eden, vec2_t &pres, vec3_t &nb)¶ Set the EOS from energy density, pressure, and baryon density stored in powers of \( \mathrm{fm} \) .
This function presumes that the user-specified vectors that contain the crust EOS. Note that the user-specified EOS must have a monotonically increasing baryon chemical potential.
-
double
ed_from_pr
(double pr)¶ From the pressure, return the energy density.
-
double
pr_from_ed
(double ed)¶ From the energy density, return the pressure.
-
double
nb_from_pr
(double pr)¶ From the pressure, return the baryon density.
-
double
pr_from_nb
(double nb)¶ From the baryon density, return the pressure.
-
double
ed_from_nb
(double nb)¶ From the baryon density, return the energy density.
-
double
nb_from_ed
(double ed)¶ From the energy density, return the baryon density.
-
double
enth_from_pr
(double pr)¶ From the pressure, return the enthalpy.
-
double
enth_from_nb
(double nb)¶ From the baryon density, return the enthalpy.
-
double
pr_from_enth
(double enth)¶ From the enthalpy, return the pressure.
-
void
ed_nb_from_pr
(double pr, double &ed, double &nb)¶ Given the pressure, compute the energy and number densities.
-
void
output
()¶ Output EOS table to screen.
-
void
output_table
(std::string fname)¶ Output EOS to an HDF5 file.
Protected Functions
-
int
new_search
(int n, double *x, double val)¶ Search in array
x
of lengthn
for valueval
.
Protected Attributes
-
o2scl::search_vec<double*>
sv
¶ Array search object.
-
int
n_tab
¶ number of tabulated EOS points
-
double
log_e_tab
[200]¶ rho points in tabulated EOS
-
double
log_p_tab
[200]¶ p points in tabulated EOS
-
double
log_h_tab
[200]¶ h points in EOS file
-
double
log_n0_tab
[200]¶ number density in EOS file