tov_interp_eos Class Reference

#include <tov_eos.h>

Inheritance diagram for tov_interp_eos:

tov_eos

Detailed Description

An EOS for the TOV solver using simple linear interpolation and a default low-density EOS.

Internally, energy and pressure are stored in units of solar masses per cubic kilometer and baryon density is stored in units of fm^{-3}. The user-specified EOS table is left as is, and unit conversion is performed as needed in get_eden() and other functions so that results are returned in the units specified by set_units().

The function set_units() needs to be called before either of the functions get_eden() or get_eden_ld() are called. The function set_units() may be called after calling either the read_table() functions or the set_low_density_eos() function.

Definition at line 118 of file tov_eos.h.


Public Member Functions

virtual int get_eden (double pres, double &ed, double &nb)
 Given the pressure, produce the energy and number densities.
virtual int get_eden_user (double pres, double &ed, double &nb)
 Given the pressure, produce the energy and number densities from the user-specified EOS.
virtual int get_eden_ld (double pres, double &ed, double &nb)
 Given the pressure, produce the energy and number densities from the low-density EOS.
virtual int get_aux (double P, size_t &nv, ovector_view &auxp)
 Given the pressure, produce all the remaining quantities.
virtual int get_names (size_t &np, std::vector< std::string > &pnames)
 Fill a list with strings for the names of the remaining quanities.
int read_table (table &eosat, std::string s_cole="ed", std::string s_colp="pr", std::string s_colnb="nb")
 Specify the EOS through a table.
int read_table_file (std::string eosfn, std::string s_cole="ed", std::string s_colp="pr", std::string s_colnb="nb")
 Specify the EOS through a table in a file.
int set_low_density_eos (bool s_ldeos, std::string s_nvpath, int s_nvcole=0, int s_nvcolp=1, int s_nvcolnb=2)
 Set the low-density EOS.
int set_units (double s_efactor, double s_pfactor, double s_nfactor)
 Set the units of the user-specified EOS.
int set_units (std::string leunits="", std::string lpunits="", std::string lnunits="")
 Set the units of the user-specified EOS.
int get_transition (double &plow, double &ptrans, double &phi)
 Return limiting and transition pressures.
int set_transition (double ptrans, double pw)
 Set the transition pressure and "width".

Protected Member Functions

int check_eos ()
 Check that the EOS is valid.
void interp (const ovector_view &x, const ovector_view &y, double xx, double &yy, int n1, int n2)
 Linear EOS interpolation.

Protected Attributes

base_ioc bio
 A base I/O object for reading EOSs.
Low-density EOS
bool ldeos
 true if we are using the low-density eos (false)
bool ldeos_read
 Low-density EOS switch.
std::string ldpath
 the path to the low-density EOS
int ldcole
 column in low-density eos for energy density
int ldcolp
 column in low-density eos for pressure
int ldcolnb
 column in low-density eos for baryon density
tableld_eos
 file containing low-density EOS
double presld
 highest pressure in low-density EOS
double eld
 highest energy density in low-density EOS
double nbld
 highest baryon density in low-density EOS
double prest
 Transition pressure.
double pwidth
 Transition width.
User EOS
tableeost
 file containing eos
int nfile
 number of lines in eos file
int cole
 column for energy density in eos file
int colp
 column for pressure in eos file
int colnb
 column for baryon density in eos file
bool eos_read
 True if an EOS has been specified.
Units
std::string eunits
 Units for energy density.
std::string punits
 Units for pressure.
std::string nunits
 Units for baryon density.
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)

Member Function Documentation

int get_transition ( double &  plow,
double &  ptrans,
double &  phi 
)

Return limiting and transition pressures.

Returns, in order:

  • the highest pressure in the low-density EOS
  • the transition pressure
  • the lowest pressure in the high-density EOS

int set_transition ( double  ptrans,
double  pw 
)

Set the transition pressure and "width".

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 is done smoothly using linear interpolation between $ P=\mathrm{ptrans}/pmathrm{pw} $ and $ P=\mathrm{ptrans} \times pmathrm{pw} $.


Field Documentation

bool ldeos_read [protected]

Low-density EOS switch.

This is true if the ldeos has been read by set_ldeos. This is useful, since then we know whether or not we need to free the memory for the LD EOS in the destructor

Definition at line 218 of file tov_eos.h.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page