29char eos_fermi_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Eos/eos_fermi.C,v 1.2 2014/10/13 08:52:52 j_novak Exp $" ;
52#include "utilitaires.h"
63 Eos(
"Degenerate ideal Fermi gas"),
74 Eos(
"Degenerate ideal Fermi gas"),
75 m_0(mass), g_s(g_degen) {
86 m_0(eosi.m_0), g_s(eosi.g_s) {
113 fich >>
m_0 ; fich.getline(blabla, 80) ;
114 fich >>
g_s ; fich.getline(blabla, 80) ;
156 cout <<
"n_0 = " <<
n_0 << endl ;
157 cout <<
"p_0 = " <<
p_0 << endl ;
158 cout <<
"ener_0 = " <<
ener_0 << endl ;
182 cout <<
"The second EOS is not of type Eos_Fermi !" << endl ;
191 <<
"The two Eos_Fermi have different m_0 : " <<
m_0 <<
" <-> "
198 <<
"The two Eos_Fermi have different g_s : " <<
g_s <<
" <-> "
232 ost <<
"EOS of class Eos_Fermi (degenerate ideal Fermi gas) : " << endl ;
233 ost <<
" Fermion mass : " <<
m_0 <<
" eV/c2" << endl ;
234 ost <<
" Degeneracy factor : " <<
g_s << endl ;
251 double x2 =
exp(
double(2)*ent) - double(1) ;
252 double x =
sqrt( x2 ) ;
254 return n_0 * x2 * x ;
268 double hh =
exp(ent) ;
269 double x2 = hh*hh - double(1) ;
270 double x =
sqrt(x2) ;
272 return ener_0 * (x*(double(2)*x2 + double(1))*hh -
log(x+hh)) ;
286 double hh =
exp(ent) ;
287 double x2 = hh*hh - double(1) ;
288 double x =
sqrt(x2) ;
290 return p_0 * (x*(double(2)*x2 - double(3))*hh +
double(3)*
log(x+hh)) ;
303 cerr <<
"Eos_Fermi::der_nbar_ent_p : not implemented yet ! " << endl ;
313 cerr <<
"Eos_Fermi::der_ener_ent_p : not implemented yet ! " << endl ;
323 cerr <<
"Eos_Fermi::der_press_ent_p : not implemented yet ! " << endl ;
Degenerate ideal Fermi gas.
double get_m() const
Returns the fermion mass in eV/c2.
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual ostream & operator>>(ostream &) const
Operator >>
virtual double ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
int get_g_degen() const
Returns the degeneracy factor.
virtual void sauve(FILE *) const
Save in a file.
double ener_0
Energy density scale [unit: ], where ].
virtual ~Eos_Fermi()
Destructor.
void operator=(const Eos_Fermi &)
Assignment to another Eos_Fermi.
int g_s
Degeneracy parameter.
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
double m_0
Individual particule mass [unit: eV/c2].
virtual bool operator==(const Eos &) const
Comparison operator (egality)
double p_0
Pressure scale [unit: ], where ].
double n_0
Number density scale [unit: ].
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
Eos_Fermi(double mass)
Standard constructor (sets g_s to 2).
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
void set_auxiliary()
Computes the auxiliary quantities n_0 , ener_0.
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 sqrt(const Cmp &)
Square root.
Cmp exp(const Cmp &)
Exponential.
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.