Go to the documentation of this file.
26 #ifndef O2SCL_TABULATED_EOS_H
27 #define O2SCL_TABULATED_EOS_H
30 #include <o2scl/constants.h>
31 #include <o2scl/eos_had_base.h>
32 #include <o2scl/fermion.h>
33 #include <o2scl/eos_had_apr.h>
35 #ifndef DOXYGEN_NO_O2NS
78 std::string srho_nuc, srho_neut, snuc, sneut;
98 virtual ~eos_had_tabulated() {
110 O2SCL_ERR(
"No EOS specified in eos_had_tabulated::calc_e().",
113 double barn=ne.n+pr.n;
115 double delta=(1.0-2.0*xp);
121 double edsym=(tneut->
interp(srho_neut,
barn,sneut)-
125 th.
ed=ednuc+delta*delta*edsym;
128 double dednucdn=tnuc->
deriv(srho_nuc,
barn,snuc)/
135 ne.mu=(dednucdn+delta*delta*dedsymdn)+4.0*delta*edsym*xp/
barn;
136 pr.mu=(dednucdn+delta*delta*dedsymdn)+4.0*delta*edsym*(xp-1.0)/
barn;
139 th.
pr=-th.
ed+ne.n*ne.mu+pr.n*pr.mu;
147 template <
class vec_t>
148 int set_eos(
size_t n, vec_t &rho, vec_t &Enuc, vec_t &Eneut) {
158 for(
size_t i=0;i<n;i++) {
159 double line[3]={rho[i],Enuc[i],Eneut[i]};
172 template<
class vec_t>
173 int set_eos(
size_t n_nuc, vec_t &rho_nuc, vec_t &E_nuc,
174 size_t n_neut, vec_t &rho_neut, vec_t &E_neut) {
186 for(
size_t i=0;i<n_nuc;i++) {
187 double line[2]={rho_nuc[i],E_nuc[i]};
190 for(
size_t i=0;i<n_neut;i++) {
191 double line[2]={rho_neut[i],E_neut[i]};
210 #ifndef DOXYGEN_NO_O2NS
table & get_nuc_table()
Return the internal table.
void free_table()
Free the table memory.
void line_of_data(size_t nv, const vec2_t &v)
void deriv(std::string x, std::string y, std::string yp)
bool table_alloc
True if the table has been allocated.
Zero-temperature EOS from a table.
double interp(std::string sx, double x0, std::string sy)
int set_eos(size_t n, vec_t &rho, vec_t &Enuc, vec_t &Eneut)
Set the EOS through vectors specifying the densities and energies.
int set_eos(size_t n_nuc, vec_t &rho_nuc, vec_t &E_nuc, size_t n_neut, vec_t &rho_neut, vec_t &E_neut)
Set the EOS through vectors specifying the densities and energies.
void line_of_names(std::string newheads)
virtual int calc_e(fermion &ne, fermion &pr, thermo &th)
Equation of state as a function of density.
table & get_neut_table()
Return the internal table.
bool one_table
If true, then tnuc and tneut point to the same table.
A hadronic EOS based on a function of the densities [abstract base].
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).