29char eos_poly_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Eos/eos_poly.C,v 1.9 2014/10/13 08:52:53 j_novak Exp $" ;
117#include "utilitaires.h"
127 Eos(
"Relativistic polytropic EOS"),
128 gam(gam0), kap(kappa), m_0(double(1)), mu_0(double(1)) {
137 Eos(
"Relativistic polytropic EOS"),
138 gam(gam0), kap(kappa), m_0(mass), mu_0(double(1)) {
147 Eos(
"Relativistic polytropic EOS"),
148 gam(gam0), kap(kappa), m_0(mass), mu_0(mu_zero) {
158 gam(eosi.gam), kap(eosi.kap), m_0(eosi.m_0), mu_0(eosi.mu_0) {
195 fich >>
gam ; fich.getline(blabla, 80) ;
196 fich >>
kap ; fich.getline(blabla, 80) ;
197 fich >>
m_0 ; fich.getline(blabla, 80) ;
202 fich >>
mu_0 ; fich.getline(blabla, 80) ;
283 cout <<
"The second EOS is not of type Eos_poly !" << endl ;
292 <<
"The two Eos_poly have different gamma : " <<
gam <<
" <-> "
299 <<
"The two Eos_poly have different kappa : " <<
kap <<
" <-> "
306 <<
"The two Eos_poly have different m_0 : " <<
m_0 <<
" <-> "
313 <<
"The two Eos_poly have different mu_0 : " <<
mu_0 <<
" <-> "
314 << eos.
mu_0 << endl ;
341 double tempo = -
m_0 ;
342 fwrite_be(&tempo,
sizeof(
double), 1, fich) ;
349 ost <<
"EOS of class Eos_poly (relativistic polytrope) : " << endl ;
350 ost <<
" Adiabatic index gamma : " <<
gam << endl ;
351 ost <<
" Pressure coefficient kappa : " <<
kap <<
352 " rho_nuc c^2 / n_nuc^gamma" << endl ;
353 ost <<
" Mean particle mass : " <<
m_0 <<
" m_B" << endl ;
354 ost <<
" Relativistic chemical potential at zero pressure : " <<
mu_0 <<
" m_B c^2" << endl ;
423 if ( ent < 1.e-13 +
ent_0 ) {
424 return (
double(1) + ent/
double(2) + ent*ent/
double(12) ) /
gam1 ;
431 return double(1) /
gam1 ;
451 if ( ent <
ent_0 + 1.e-13 ) {
452 return (
double(1) + ent/
double(2) + ent*ent/
double(12) ) /
gam1
453 * ( double(1) + pp / ee) ;
457 * (
double(1) + pp / ee) ;
462 return double(1) /
gam1 ;
471 if ( ent >
double(0) ) {
473 if ( ent <
ent_0 + 1.e-13 ) {
474 return gam * ( double(1) + ent/double(2) + ent*ent/double(12) )
Polytropic equation of state (relativistic case).
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
double ent_0
Enthalpy at zero pressure ( )
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
double kap
Pressure coefficient (cf.
virtual void sauve(FILE *) const
Save in a file.
Eos_poly(double gamma, double kappa)
Standard constructor (sets both m_0 and mu_0 to 1).
double get_mu_0() const
Return the relativistic chemical potential at zero pressure [unit: , with ].
double get_gam() const
Returns the adiabatic index (cf. Eq. (3))
double gam
Adiabatic index (cf. Eq. (3))
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
void operator=(const Eos_poly &)
Assignment to another Eos_poly.
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
double m_0
Individual particule mass (cf.
double mu_0
Relativistic chemical potential at zero pressure [unit: , with ].
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
virtual bool operator==(const Eos &) const
Comparison operator (egality)
virtual ~Eos_poly()
Destructor.
double get_m_0() const
Return the individual particule mass (cf.
double get_kap() const
Returns the pressure coefficient (cf.
virtual ostream & operator>>(ostream &) const
Operator >>
void set_auxiliary()
Computes the auxiliary quantities gam1 , unsgam1 , gam1sgamkap from the values of gam and kap.
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 void sauve(FILE *) const
Save in a file.
void set_name(const char *name_i)
Sets the EOS name.
Cmp exp(const Cmp &)
Exponential.
Cmp pow(const Cmp &, int)
Power .
Cmp log(const Cmp &)
Neperian logarithm.
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
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.