An EOS for the TOV solver using simple linear interpolation and an optional crust EOS. More...
#include <eos_tov.h>
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... | |
![]() | |
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 ![]() | |
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. | |
![]() | |
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 ![]() | |
double | trans_width |
Transition width (unitless) | |
![]() | |
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 |
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 (equal to the value of trans_pres divided by trans_width) and the core above pressure
(the value of trans_pres times trans_width) and then in between uses
where the value is determined by
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 and
and
(using the same expression for ). 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 and baryon density is stored in units of
. 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.
|
virtual |
The arguments pr
and ed
should always be in . The argument for
nb
should be in .
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.
void o2scl::eos_tov_interp::gcp10_low_dens_eos | ( | std::string | model = "BSk20" , |
bool | external = false |
||
) |
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
.
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 MeV,
MeV,
, and
. 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() .
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 .
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.
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
.
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 and
.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).