55 #include "utilitaires.h" 66 Eos(
"Degenerate ideal Fermi gas"),
77 Eos(
"Degenerate ideal Fermi gas"),
78 m_0(mass), g_s(g_degen) {
89 m_0(eosi.m_0), g_s(eosi.g_s) {
116 fich >>
m_0 ; fich.getline(blabla, 80) ;
117 fich >>
g_s ; fich.getline(blabla, 80) ;
159 cout <<
"n_0 = " <<
n_0 << endl ;
160 cout <<
"p_0 = " <<
p_0 << endl ;
161 cout <<
"ener_0 = " <<
ener_0 << endl ;
185 cout <<
"The second EOS is not of type Eos_Fermi !" << endl ;
194 <<
"The two Eos_Fermi have different m_0 : " <<
m_0 <<
" <-> " 201 <<
"The two Eos_Fermi have different g_s : " <<
g_s <<
" <-> " 235 ost <<
"EOS of class Eos_Fermi (degenerate ideal Fermi gas) : " << endl ;
236 ost <<
" Fermion mass : " <<
m_0 <<
" eV/c2" << endl ;
237 ost <<
" Degeneracy factor : " <<
g_s << endl ;
254 double x2 =
exp(
double(2)*ent) - double(1) ;
255 double x =
sqrt( x2 ) ;
257 return n_0 * x2 * x ;
271 double hh =
exp(ent) ;
272 double x2 = hh*hh - double(1) ;
273 double x =
sqrt(x2) ;
275 return ener_0 * (x*(double(2)*x2 + double(1))*hh -
log(x+hh)) ;
289 double hh =
exp(ent) ;
290 double x2 = hh*hh - double(1) ;
291 double x =
sqrt(x2) ;
293 return p_0 * (x*(double(2)*x2 - double(3))*hh +
double(3)*
log(x+hh)) ;
306 cerr <<
"Eos_Fermi::der_nbar_ent_p : not implemented yet ! " << endl ;
316 cerr <<
"Eos_Fermi::der_ener_ent_p : not implemented yet ! " << endl ;
326 cerr <<
"Eos_Fermi::der_press_ent_p : not implemented yet ! " << endl ;
Cmp log(const Cmp &)
Neperian logarithm.
int get_g_degen() const
Returns the degeneracy factor.
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
Cmp exp(const Cmp &)
Exponential.
Cmp sqrt(const Cmp &)
Square root.
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
virtual ~Eos_Fermi()
Destructor.
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 double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
void operator=(const Eos_Fermi &)
Assignment to another Eos_Fermi.
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
double ener_0
Energy density scale [unit: ], where ].
virtual void sauve(FILE *) const
Save in a file.
void set_auxiliary()
Computes the auxiliary quantities n_0 , ener_0.
virtual void sauve(FILE *) const
Save in a file.
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
virtual ostream & operator>>(ostream &) const
Operator >>
Degenerate ideal Fermi gas.
double p_0
Pressure scale [unit: ], where ].
double m_0
Individual particule mass [unit: eV/c2].
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 bool operator!=(const Eos &) const
Comparison operator (difference)
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
void set_name(const char *name_i)
Sets the EOS name.
double n_0
Number density scale [unit: ].
double get_m() const
Returns the fermion mass in eV/c2.
virtual bool operator==(const Eos &) const
Comparison operator (egality)
int g_s
Degeneracy parameter.
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure 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.
Eos_Fermi(double mass)
Standard constructor (sets g_s to 2).