Protected Member Functions | List of all members
o2scl::eos_tov_interp Class Reference

An EOS for the TOV solver using simple linear interpolation and an optional crust EOS. More...

#include <eos_tov.h>

Inheritance diagram for o2scl::eos_tov_interp:
o2scl::eos_tov

Public Member Functions

Basic EOS functions
virtual double ed_from_pr (double pr)
 From the pressure, return the energy density.
 
virtual double pr_from_ed (double ed)
 From the energy density, return the pressure.
 
virtual double nb_from_ed (double ed)
 From the energy density, return the baryon density.
 
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.
 
virtual double pr_from_nb (double nb)
 From the baryon density, return the pressure.
 
Basic usage
void read_table (table_units<> &eosat, std::string s_cole, std::string s_colp, std::string s_colnb="")
 Specify the EOS through a table. More...
 
Crust EOS functions
void default_low_dens_eos ()
 Default crust EOS from Negele73 and Baym71tg.
 
void sho11_low_dens_eos ()
 Crust EOS from Shen11b.
 
void s12_low_dens_eos (std::string model="SLy4", bool external=false)
 Crust EOS from Steiner12. More...
 
void gcp10_low_dens_eos (std::string model="BSk20", bool external=false)
 Crust EOS from Goriely, Chamel, and Pearson. More...
 
void ngl13_low_dens_eos (double L, std::string model="PNM", bool external=false)
 Crust EOS from Newton13 given L in MeV. More...
 
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. More...
 
void no_low_dens_eos ()
 Compute with no crust EOS.
 
Functions used by the tov_solve class
virtual void ed_nb_from_pr (double pr, double &ed, double &nb)
 Given the pressure, produce the energy and number densities. More...
 
Other functions
virtual void get_eden_user (double pres, double &ed, double &nb)
 Get the energy density from the pressure in the user-specified unit system.
 
void get_transition (double &ptrans, double &pwidth)
 Get the transition pressure (in the user-specified unit system) and width.
 
void set_transition (double ptrans, double pw)
 Set the transition pressure and "width". More...
 
- Public Member Functions inherited from o2scl::eos_tov
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) $.
 

Public Attributes

User EOS
std::vector< double > full_vece
 Energy densities from full EOS.
 
std::vector< double > full_vecp
 Pressures from full EOS.
 
std::vector< double > full_vecnb
 Baryon densities from full EOS.
 
- Public Attributes inherited from o2scl::eos_tov
int verbose
 Control for output (default 1)
 

Protected Member Functions

void internal_read ()
 Internal function to reinterpolate if if either the core or crust tables are changed.
 

Protected Attributes

Crust EOS
bool use_crust
 Set to true if we are using a crust EOS (default false)
 
std::vector< double > crust_vece
 Energy densities.
 
std::vector< double > crust_vecp
 Pressures.
 
std::vector< double > crust_vecnb
 Baryon densities.
 
Core EOS
std::vector< double > core_vece
 Energy densities.
 
std::vector< double > core_vecp
 Pressures.
 
std::vector< double > core_vecnb
 Baryon densities.
 
Interpolation objects
interp_vec< std::vector< double > > pe_int
 
interp_vec< std::vector< double > > pnb_int
 
interp< std::vector< double > > gen_int
 
Unit conversion factors for core EOS
double efactor
 Unit conversion factor for energy density (default 1.0)
 
double pfactor
 Unit conversion factor for pressure (default 1.0)
 
double nfactor
 Unit conversion factor for baryon density (default 1.0)
 
Properties of transition
double trans_pres
 Transition pressure (in $ M_{\odot}/\mathrm{km}^3 $)
 
double trans_width
 Transition width (unitless)
 
- Protected Attributes inherited from o2scl::eos_tov
bool baryon_column
 Set to true if the baryon density is provided in the EOS (default false)
 

Mode of transitioning between crust and core EOS

int transition_mode
 
static const int smooth_trans =0
 
static const int match_line =1
 

Detailed Description

The simplest usage of this class is simply to use read_table() to read a tabulated EOS stored in a table_units object and optionally specify a separate crust EOS.

Alternatively, the user can simply specify objects of type std::vector<double> which store the energy density, pressure, and baryon density.

There are two methods to handle the crust-core interface. The default, smooth_trans uses the crust below pressure $ P_1 $ (equal to the value of trans_pres divided by trans_width) and the core above pressure $ P_2 $ (the value of trans_pres times trans_width) and then in between uses

\[ \varepsilon(P) = [1-\chi(P)] \varepsilon_{\mathrm{crust}}(P) + \chi(P) \varepsilon_{\mathrm{core}}(P) \]

where the value $ \chi(P) $ is determined by

\[ \chi(P) = (P-P_1)/(P_2-P_1) \, . \]

This method is a bit more faithful to the original EOS tables, but the matching can result in pressures which decrease with increasing energy density. Alternatively the match_line method uses $ \varepsilon_1=\varepsilon_{\mathrm{crust}}(P_1) $ and $ \varepsilon_2=\varepsilon_{\mathrm{core}}(P_2) $ and

\[ \varepsilon(P) = (\varepsilon_2 - \varepsilon_1) \chi + \varepsilon_1 \, . \]

(using the same expression for $ \chi $ ). This method less frequently results in decreasing pressures, but can deviate further from the original tables.

Internally, energy and pressure are stored in units of $ \mathrm{M}_{\odot}/\mathrm{km}^3 $ and baryon density is stored in units of $ \mathrm{fm}^{-3} $ . The user-specified EOS table is left as is, and unit conversion is performed as needed in ed_nb_from_pr() and other functions from the units specified in the input table_units object.

Idea for Future:
Create a sanity check where core_auxp is nonzero only if core_table is also nonzero. Alternatively, this complication is due to the fact that this class works in two ways: one where it reads a table (and adds a crust), and one where it reads in vectors (with no crust). Maybe these two modes of operation should be separated into two classes. (2/6/16: Now there is a new eos_tov_vector class. The best way forward may be to make this a child of eos_tov_vectors.)

Definition at line 675 of file eos_tov.h.

Member Function Documentation

◆ ed_nb_from_pr()

virtual void o2scl::eos_tov_interp::ed_nb_from_pr ( double  pr,
double &  ed,
double &  nb 
)
virtual

The arguments pr and ed should always be in $ M_{\odot}/\mathrm{km}^3 $ . The argument for nb should be in $ \mathrm{fm}^{-3} $ .

If the baryon density is not specified, it should be set to zero or baryon_column should be set to false

Implements o2scl::eos_tov.

◆ gcp10_low_dens_eos()

void o2scl::eos_tov_interp::gcp10_low_dens_eos ( std::string  model = "BSk20",
bool  external = false 
)

◆ ngl13_low_dens_eos()

void o2scl::eos_tov_interp::ngl13_low_dens_eos ( double  L,
std::string  model = "PNM",
bool  external = false 
)

Current acceptable values for model are PNM and J35.

◆ ngl13_low_dens_eos2()

void o2scl::eos_tov_interp::ngl13_low_dens_eos2 ( double  S,
double  L,
double  nt,
std::string  fname = "" 
)

Note that this function works only if $ 28 < S < 38 $ MeV, $ 25 < L < 115 $ MeV, $ 0.01 < n_t < 0.15 $, and $ L > 5 S-65~\mathrm{MeV} $ . If fname is a string of length 0 (the default), then this function looks for a file named newton_SL.o2 in the O2scl data directory specified by o2scl::lib_settings_class::get_data_dir() .

◆ read_table()

void o2scl::eos_tov_interp::read_table ( table_units<> &  eosat,
std::string  s_cole,
std::string  s_colp,
std::string  s_colnb = "" 
)

If units are specified for any of the columns, then this function attempts to automatically determine the correct conversion factors using the o2scl::convert_units object returned by o2scl::o2scl_settings . If the units for any of the columns are blank, then they are assumed to be the native units for o2scl::tov_solve .

Note
The input table must have at least 2 rows and the pressure column must be strictly increasing.

This function copies the needed information from the table so if it is modified then this function needs to be called again to read a new table.

◆ s12_low_dens_eos()

void o2scl::eos_tov_interp::s12_low_dens_eos ( std::string  model = "SLy4",
bool  external = false 
)

This function uses the neutron star crust models from Steiner12 . The current acceptable values for model are APR, Gs, Rs and SLy4.

◆ set_transition()

void o2scl::eos_tov_interp::set_transition ( double  ptrans,
double  pw 
)

Sets the transition pressure and the width (specified as a number greater than unity in pw) of the transition between the two EOSs. The transition should be in the same units of the user-specified EOS. The transition is done smoothly using linear interpolation between $ P=\mathrm{ptrans}/pmathrm{pw} $ and $ P=\mathrm{ptrans} \times pmathrm{pw} $.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).