An EOS for the TOV solver using simple linear interpolation and an optional crust EOS. More...
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 get_eden() and other functions from the units specified in the input table_units object.
#include <eos_tov.h>
Public Member Functions | |
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. | |
void | read_vectors (size_t n_core, std::vector< double > &core_ed, std::vector< double > &core_pr, std::vector< double > &core_nb) |
Read the EOS from a set of equal length vectors for energy density, pressure, and baryon density. | |
void | read_vectors (size_t n_core, std::vector< double > &core_ed, std::vector< double > &core_pr) |
Read the EOS from a pair of equal length vectors for energy density and pressure. | |
Crust EOS functions | |
void | default_low_dens_eos () |
Default crust EOS from Negele73 and Baym71. | |
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 | get_eden (double pres, double &ed, double &nb) |
Given the pressure, produce the energy and number densities. More... | |
virtual void | get_aux (double P, size_t &nv, std::vector< double > &auxp) |
Given the pressure, produce all the remaining quantities. More... | |
virtual void | get_names_units (size_t &np, std::vector< std::string > &pnames, std::vector< std::string > &punits) |
Fill a list with strings for the names of the remaining quanities. | |
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... | |
![]() | |
void | check_nb (double &avg_abs_dev, double &max_abs_dev) |
Check that the baryon density is consistent with the EOS. | |
Protected Member Functions | |
void | internal_read () |
Protected Attributes | |
Crust EOS variables | |
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. | |
size_t | crust_nlines |
Number of EOS entries. | |
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 |
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. | |
size_t | full_nlines |
Number of lines in full EOS. | |
bool | core_set |
True if core table has been specified. | |
table_units * | core_table |
Full user EOS table. | |
size_t | cole |
Column for energy density in EOS file. | |
size_t | colp |
Column for pressure in EOS file. | |
size_t | colnb |
Column for baryon density in EOS file. | |
bool | eos_read |
True if an EOS has been specified. | |
size_t | core_auxp |
Number of additional columns in the core EOS. | |
Additional Inherited Members | |
![]() | |
int | verbose |
Control for output (default 1) | |
void o2scl::eos_tov_interp::gcp10_low_dens_eos | ( | std::string | model = "BSk20" , |
bool | external = false |
||
) |
|
virtual |
The argument P
should always be in .
Reimplemented from o2scl::eos_tov.
|
virtual |
The arguments P
and e
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::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::s12_low_dens_eos | ( | std::string | model = "SLy4" , |
bool | external = false |
||
) |
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).
Hosted at
.