132 #include "utilitaires.h" 142 Eos(
"Relativistic polytropic EOS"),
143 gam(gam0), kap(kappa), m_0(double(1)), mu_0(double(1)) {
152 Eos(
"Relativistic polytropic EOS"),
153 gam(gam0), kap(kappa), m_0(mass), mu_0(double(1)) {
162 Eos(
"Relativistic polytropic EOS"),
163 gam(gam0), kap(kappa), m_0(mass), mu_0(mu_zero) {
173 gam(eosi.gam), kap(eosi.kap), m_0(eosi.m_0), mu_0(eosi.mu_0) {
210 fich >>
gam ; fich.getline(blabla, 80) ;
211 fich >>
kap ; fich.getline(blabla, 80) ;
212 fich >>
m_0 ; fich.getline(blabla, 80) ;
217 fich >>
mu_0 ; fich.getline(blabla, 80) ;
298 cout <<
"The second EOS is not of type Eos_poly !" << endl ;
307 <<
"The two Eos_poly have different gamma : " <<
gam <<
" <-> " 314 <<
"The two Eos_poly have different kappa : " <<
kap <<
" <-> " 321 <<
"The two Eos_poly have different m_0 : " <<
m_0 <<
" <-> " 328 <<
"The two Eos_poly have different mu_0 : " <<
mu_0 <<
" <-> " 329 << eos.
mu_0 << endl ;
356 double tempo = -
m_0 ;
357 fwrite_be(&tempo,
sizeof(
double), 1, fich) ;
364 ost <<
"EOS of class Eos_poly (relativistic polytrope) : " << endl ;
365 ost <<
" Adiabatic index gamma : " <<
gam << endl ;
366 ost <<
" Pressure coefficient kappa : " <<
kap <<
367 " rho_nuc c^2 / n_nuc^gamma" << endl ;
368 ost <<
" Mean particle mass : " <<
m_0 <<
" m_B" << endl ;
369 ost <<
" Relativistic chemical potential at zero pressure : " <<
mu_0 <<
" m_B c^2" << endl ;
387 double xx = ent -
ent_0 ;
425 double xx = ent -
ent_0 ;
426 return ent / (- expm1(-xx)) /
gam1 ;
429 return double(1) /
gam1 ;
444 double xx = ent -
ent_0 ;
445 return ent / (- expm1(-xx)) /
gam1 * (
double(1) + pp / ee) ;
448 return double(1) /
gam1 ;
459 double xx = ent -
ent_0 ;
460 return gam * ent / (- expm1(-xx)) /
gam1 ;
472 double xx = ent -
ent_0 ;
473 return gam1*( - expm1(-xx) ) ;
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
Cmp log(const Cmp &)
Neperian logarithm.
Equation of state base class.
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual ~Eos_poly()
Destructor.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
double ent_0
Enthalpy at zero pressure ( )
double get_gam() const
Returns the adiabatic index (cf. Eq. (3))
double kap
Pressure coefficient (cf.
virtual void sauve(FILE *) const
Save in a file.
virtual ostream & operator>>(ostream &) const
Operator >>
double m_0
Individual particule mass (cf.
void set_auxiliary()
Computes the auxiliary quantities gam1 , unsgam1 , gam1sgamkap from the values of gam and kap...
double get_kap() const
Returns the pressure coefficient (cf.
double get_m_0() const
Return the individual particule mass (cf.
void operator=(const Eos_poly &)
Assignment to another Eos_poly.
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
Polytropic equation of state (relativistic case).
virtual void sauve(FILE *) const
Save in a file.
virtual double csound_square_ent_p(double ent, const Param *par=0x0) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
Eos_poly(double gamma, double kappa)
Standard constructor (sets both m_0 and mu_0 to 1).
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
double get_mu_0() const
Return the relativistic chemical potential at zero pressure [unit: , with ].
Cmp pow(const Cmp &, int)
Power .
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
double gam
Adiabatic index (cf. Eq. (3))
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
virtual bool operator==(const Eos &) const
Comparison operator (egality)
void set_name(const char *name_i)
Sets the EOS name.
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
double mu_0
Relativistic chemical potential at zero pressure [unit: , with ].
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.