29 char eos_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Eos/eos.C,v 1.7 2014/10/13 08:52:51 j_novak Exp $" ;
98 #include "utilitaires.h"
134 fread(
name,
sizeof(
char), 100, fich) ;
142 fich.getline(
name, 100) ;
165 strncpy(
name, name_i, 100) ;
182 fwrite_be(&ident,
sizeof(
int), 1, fich) ;
184 fwrite(
name,
sizeof(
char), 100, fich) ;
191 ostream& operator<<(ostream& ost,
const Eos& eqetat) {
204 double (
Eos::*fait)(
double,
const Param*)
const,
const Param* par,
Cmp& resu)
const {
206 assert(ent.
get_etat() != ETATNONDEF) ;
231 for (
int l = l_min; l< l_min + nzet; l++) {
236 Tbl* tent = vent.
c->
t[l] ;
237 Tbl* tresu = vresu.
c->
t[l] ;
243 assert( tent->
get_etat() == ETATQCQ ) ;
248 tresu->
t[i] = (this->*fait)( tent->
t[i], par ) ;
261 if (l_min + nzet < nz) {
262 resu.
annule(l_min + nzet, nz - 1) ;
271 assert(ent.
get_etat() != ETATNONDEF) ;
296 for (
int l = l_min; l< l_min + nzet; l++) {
301 Tbl* tent = vent.
c->
t[l] ;
302 Tbl* tresu = vresu.
c->
t[l] ;
308 assert( tent->
get_etat() == ETATQCQ ) ;
313 tresu->
t[i] = (this->*fait)( tent->
t[i], par ) ;
326 if (l_min + nzet < nz) {
327 resu.
annule(l_min + nzet, nz - 1) ;
virtual double nbar_ent_p(double ent, const Param *par=0x0) const =0
Computes the baryon density from the log-enthalpy and extra parameters (virtual function implemented ...
Values and coefficients of a (real-value) function.
const char * get_name() const
Returns the EOS name.
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c ).
virtual double press_ent_p(double ent, const Param *par=0x0) const =0
Computes the pressure from the log-enthalpy and extra parameters (virtual function implemented in the...
Cmp press_ent(const Cmp &ent, int nzet, int l_min=0, const Param *par=0x0) const
Computes the pressure from the log-enthalpy and extra parameters.
Valeur va
The numerical value of the Cmp
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_etat() const
Returns the logical state.
virtual ~Eos()
Destructor.
Equation of state base class.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Tensor field of valence 0 (or component of a tensorial field).
const Map & get_mp() const
Returns the mapping.
Mtbl * c
Values of the function at the points of the multi-grid
double * t
The array of double.
const Valeur & get_spectral_va() const
Returns va (read only version)
Cmp der_press_ent(const Cmp &ent, int nzet, int l_min=0, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy and extra parameters.
void annule(int l)
Sets the Cmp to zero in a given domain.
Valeur & set_spectral_va()
Returns va (read/write version)
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Cmp der_nbar_ent(const Cmp &ent, int nzet, int l_min=0, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy and extra parameters.
Cmp ener_ent(const Cmp &ent, int nzet, int l_min=0, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy and extra parameters.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
virtual double der_press_ent_p(double ent, const Param *par=0x0) const =0
Computes the logarithmic derivative from the log-enthalpy and extra parameters (virtual function imp...
void set_name(const char *name_i)
Sets the EOS name.
int get_nzone() const
Returns the number of domains.
Cmp der_ener_ent(const Cmp &ent, int nzet, int l_min=0, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy and extra parameters.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
virtual double ener_ent_p(double ent, const Param *par=0x0) const =0
Computes the total energy density from the log-enthalpy and extra parameters (virtual function implem...
Eos()
Standard constructor.
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Cmp nbar_ent(const Cmp &ent, int nzet, int l_min=0, const Param *par=0x0) const
Computes the baryon density field from the log-enthalpy field and extra parameters.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
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.
void coef_i() const
Computes the physical value of *this.
void calcule(const Cmp &thermo, int nzet, int l_min, double(Eos::*fait)(double, const Param *) const, const Param *par, Cmp &resu) const
General computational method for Cmp 's.
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos the object belongs to.
int get_taille() const
Gives the total size (ie dim.taille)
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const =0
Computes the logarithmic derivative from the log-enthalpy with extra parameters (virtual function im...
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Base class for coordinate mappings.
const Map * get_mp() const
Returns the mapping.
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const =0
Computes the logarithmic derivative from the log-enthalpy and extra parameters (virtual function imp...
int get_etat() const
Gives the logical state.
virtual void sauve(FILE *) const
Save in a file.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).