32 #include <o2scl/constants.h> 33 #include <o2scl/tensor_grid.h> 34 #include <o2scl/table.h> 35 #include <o2scl/boson_eff.h> 36 #include <o2scl/fermion_rel.h> 37 #include <o2scl/fermion_eff.h> 38 #include <o2scl/test_mgr.h> 39 #include <o2scl/convert_units.h> 40 #include <o2scl/interp2_direct.h> 42 #ifndef DOXYGEN_NO_O2NS 285 (
double nB,
double entr,
double &Ye,
double &T);
326 virtual void load(std::string fname);
336 virtual void output(std::string fname);
356 typedef std::function<double &(size_t,size_t)>
data_t;
363 ubvector grid_x, grid_y;
375 data=std::bind(std::mem_fn<
double &(
size_t,
size_t,
size_t)>
377 std::placeholders::_2);
380 for(
size_t i=0;i<nx;i++) grid_x[i]=tg3.
get_grid(0,i);
383 for(
size_t i=0;i<ny;i++) grid_y[i]=tg3.
get_grid(2,i);
384 it.set_data(nx,ny,grid_x,grid_y,data);
392 data=std::bind(std::mem_fn<
double &(
size_t,
size_t,
size_t)>
394 std::placeholders::_2,iT);
397 for(
size_t i=0;i<nx;i++) grid_x[i]=tg3.
get_grid(0,i);
400 for(
size_t i=0;i<ny;i++) grid_y[i]=tg3.
get_grid(1,i);
401 it.set_data(nx,ny,grid_x,grid_y,data);
409 data=std::bind(std::mem_fn<
double &(
size_t,
size_t,
size_t)>
411 std::placeholders::_1);
414 for(
size_t i=0;i<nx;i++) grid_x[i]=tg3.
get_grid(2,i);
417 for(
size_t i=0;i<ny;i++) grid_y[i]=tg3.
get_grid(1,i);
418 it.set_data(nx,ny,grid_x,grid_y,data);
536 virtual void load(std::string fname);
629 static const size_t ls_mode=0;
631 static const size_t stos_mode=1;
633 static const size_t hfsl_mode=2;
635 static const size_t sht_mode=3;
639 virtual void load(std::string fname,
size_t mode);
703 quark_frac(
other[5]) {
709 static const size_t orig_mode=0;
710 static const size_t quark_mode=1;
716 virtual void load(std::string fname,
size_t mode);
763 static const size_t mode_17=0;
765 static const size_t mode_21=1;
767 static const size_t mode_17b=2;
769 static const size_t mode_21b=3;
771 static const size_t mode_NL3=4;
773 static const size_t mode_NL3b=5;
805 virtual void load(std::string fname,
size_t mode);
884 virtual void load(std::string fname);
888 #ifndef DOXYGEN_NO_O2NS tensor_grid3 & munu
mue - mun + mup
tensor_grid3 & XHe3
Helion fraction.
tensor_grid3 & fill
Filling factor for nuclei.
tensor_grid3 & cs2
Speed of sound in cm^2/s^2.
data_t data
Data object in the form of a matrix.
virtual void beta_eq_sfixed(double nB, double entr, double &Ye, double &T)
Compute properties of matter in beta equilibrium at fixed entropy per baryon.
tensor_grid3 & nB
Baryon number density in .
size_t n_oth
Number of additional data sets.
tensor_grid3 & dpderho
dpderho in dyn*g/cm^2/erg
void alloc()
Allocate memory.
tensor_grid3 & Yp
Proton fraction.
tensor_grid3 & T
Temperature in MeV.
bool baryons_only_loaded
True if baryon-only thermodynamics has been loaded.
std::vector< std::string > oth_units
Units for the extra data sets included in current EOS.
interp2_direct< ubvector, data_t, matrix_row_gen< data_t >, matrix_column_gen< data_t > > it
The interpolation object.
tensor_grid3 Z
Proton number.
A slice of data from eos_sn_base for one index fixed.
tensor_grid3 mup
Proton chemical potential in MeV.
void set_nB_Ye(tensor_grid3<> &tg3, size_t iT)
Set the slice to correspond to a matrix in the form .
double m_neut
Neutron mass in (defaults to o2scl_mks::mass_neutron times o2scl_const::hc_mev_fm) ...
tensor_grid3 Eint
Internal energy per baryon without lepton and photon contributions in MeV.
std::vector< std::string > oth_names
Labels for the extra data sets included in current EOS.
bool loaded
If true, a EOS table was successfully loaded (default false)
tensor_grid3 Pint
Pressure without lepton and photon contributions in .
tensor_grid3 Fint
Free energy per baryon without lepton and photon contributions in MeV.
tensor_grid3 & XLi4
Lithium-4 fraction.
std::vector< double > nB_grid
Baryon density grid (in )
tensor_grid3 & Xd
Deuteron fraction.
tensor_grid3 Xalpha
Alpha particle baryon fraction.
A base class for the supernova EOSs [abstract].
virtual double check_eg()
Check electrons and photons.
fermion electron
Electron.
size_t get_size(size_t i) const
bool include_muons
If true, include muons.
tensor_grid3 & A_light
Mass number of light fragments.
The H. Shen et al. supernova EOS.
tensor_grid3 & x_out
Proton fraction outside nuclei.
tensor_grid3 & mue
Electron chemical potential in MeV.
tensor_grid3 & Yp
Proton fraction.
tensor_grid3 P
Total pressure in .
tensor_grid3 E
Total internal energy per baryon in MeV (without baryon rest masses but including electron rest mass)...
convert_units & cu
Unit conversion object (set automatically in constructor)
tensor_grid3 Sint
Entry per baryon without lepton and photon contributions.
The Lattimer-Swesty supernova EOS.
virtual void beta_eq_Tfixed(double nB, double T, double &Ye)
Compute the electron fraction for beta-equilibrium at fixed density and temperature temperature...
tensor_grid3 & Nskin
Number of neutrons in skin.
std::vector< double > T_grid
Temperature grid (in )
tensor_grid3 & muhat
mun - mup
tensor_grid3 & Yp
Proton fraction.
tensor_grid3 Xp
Proton baryon fraction.
tensor_grid3 & dsdT
Derivative of entropy with respect to temperature.
tensor_grid3 S
Total entropy per baryon.
tensor_grid3 & mu
Out of whackness parameter, , in MeV.
std::function< double &(size_t, size_t)> data_t
Typedef for the matrix type.
tensor_grid3 Xnuclei
Heavy nuclei baryon fraction.
double get_grid(size_t i, size_t j) const
static const size_t n_base
Number of base data sets.
A class to manipulate the G. Shen et al. EOS.
tensor_grid3 & gamma
Gamma.
double m_prot
Proton mass in (defaults to o2scl_mks::mass_proton times o2scl_const::hc_mev_fm) ...
tensor_grid3 & log_Y
Logarithm of proton fraction.
void free()
Free allocated memory.
tensor_grid3 & nb_in
Baryon number density inside nuclei in .
tensor_grid3 & nB
Baryon number density in .
bool is_loaded()
Return true if data has been loaded.
tensor_grid3 other[30]
Other data sets.
void set_interp_type(size_t interp_type)
Set the interpolation type of all the o2scl::tensor_grid3 objects to type interp_type ...
double m_amu
The atomic mass unit.
tensor_grid3 & dpdrhoe
dpdrhoe in dyn cm^3/cm^2/g
size_t n_T
Size of temperature grid.
The EOS tables from O'Connor and Ott.
tensor_grid3 & log_Y
Logarithm of proton fraction.
size_t n_Ye
Size of electron fraction grid.
size_t n_nB
Size of baryon density grid.
bool check_grid
If true, check the grid after load() (default true)
bool with_leptons_loaded
True if thermodynamics with leptons has been loaded.
tensor_grid3 & nB
Baryon number density in .
tensor_grid3 & dsdY
Derivative of entropy with respect to electron fraction.
void set_T_Ye(tensor_grid3<> &tg3, size_t inB)
Set the slice to correspond to a matrix in the form .
tensor_grid3 & Xt
Triton fraction.
The Hempel et al. supernova EOSs.
bool data_baryons_only()
Return true if data with only baryon information has been loaded.
tensor_grid3 mun
Neutron chemical potential in MeV.
tensor_grid3 & M_star
Nucleon effective mass (Dirac) in MeV.
tensor_grid3 & log_rho
Logarithm of baryon number density in .
void set_nB_T(tensor_grid3<> &tg3, size_t iYe)
Set the slice to correspond to a matrix in the form .
std::vector< double > Ye_grid
Electron fraction grid.
bool check_grid
If true, check the grid after load() (default true)
tensor_grid3 F
Total free energy per baryon in MeV (without baryon rest masses but including electron rest mass) ...
double energy_shift
Energy shift for table storage in erg/g.
tensor_grid3 & M_star
Nucleon effective mass in MeV.
tensor_grid3 * arr[n_base+30]
List of pointers to data.
bool data_with_leptons()
Return true if data with lepton information has been loaded.
tensor_grid3 A
Mass number.
tensor_grid3 & Z_light
Proton number of light fragments.
void check_free_energy(double &avg)
Test the free energy and store results in tm.
tensor_grid3 & dPdT
Derivative of pressure with respect to temperature.
fermion_rel relf
Relativistic fermion thermodynamics.
tensor_grid3 & log_rho
Logarithm of baryon number density in .
tensor_grid3 & nb_out
Baryon density outside nuclei in .
std::vector< double > rho
The original mass density grid from the table in g/cm^3.
void check_composition(double &max1, double &max2)
Check the table composition entries.
tensor_grid3 & M_star
Nucleon effective mass in MeV.
int verbose
Verbosity parameter (default 1)
bool check_grid
If true, check the grid after load() (default true)
tensor_grid3 & mu_e
Electron chemical potential per baryon including rest mass.
tensor_grid3 Xn
Neutron baryon fraction.
tensor_grid3 & dedt
C_V in erg/g/K.
virtual void compute_eg()
Compute the electron and photon contribution for the full grid.
tensor_grid3 & quark_frac
Fraction of quark matter.
tensor_grid3 & dPdn
Derivative of pressure with respect to baryon density.
tensor_grid3 & dPdY
Derivative of pressure with respect to electron fraction.