45 #include "utilitaires.h" 79 fread(&taille,
sizeof(
int), 1, fich) ;
81 char* t_name =
new char[taille] ;
82 fread(t_name,
sizeof(
char), taille, fich) ;
93 fich.getline(t_name, 100) ;
120 name.assign(name_i) ;
132 fwrite_be(&ident,
sizeof(
int), 1, fich) ;
134 int taille = int(
name.size()) ;
135 fwrite_be(&taille,
sizeof(
int), 1, fich) ;
136 fwrite(
name.c_str(),
sizeof(char),
name.size(), fich) ;
143 ostream& operator<<(ostream& ost,
const Hot_eos& eqetat) {
154 double (
Hot_eos::*fait)(
double,
double)
const,
157 assert(ent.
get_etat() != ETATNONDEF) ;
158 assert(sb.
get_etat() != ETATNONDEF) ;
162 const Mg3d* mg = mp->get_mg() ;
182 assert(vsb->
get_mg() == vent.get_mg()) ;
191 for (
int l = l_min; l< l_min + nzet; l++) {
197 Tbl* tent = vent.c->
t[l] ;
198 Tbl* tsb = vsb->
c->
t[l] ;
199 Tbl* tresu = vresu.
c->
t[l] ;
205 assert( tent->
get_etat() == ETATQCQ ) ;
209 tsb =
new Tbl(tent->
dim) ;
215 tresu->
t[i] = (this->*fait)( tent->
t[i], tsb->
t[i] ) ;
219 if (tsb0)
delete tsb ;
228 if (l_min + nzet < nz) {
229 resu.
annule(l_min + nzet, nz - 1) ;
virtual double press_Hs_p(double ent, double sb) const =0
Computes the pressure from the log-enthalpy and entropy per baryon (virtual function implemented in t...
Eos * p_cold_eos
Corresponding cold Eos.
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
virtual double nbar_Hs_p(double ent, double sb) const =0
Computes the baryon density from the log-enthalpy and electronic fraction (virtual function implement...
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
virtual double temp_Hs_p(double ent, double sb) const =0
Computes the temperature from the log-enthalpy and entropy per baryon (virtual function implemented i...
const string & get_name() const
Returns the hot EOS name.
void annule_hard()
Sets the Valeur to zero in a hard way.
Tensor field of valence 0 (or component of a tensorial field).
Scalar chi2_Hs(const Scalar &ent, const Scalar &Ye, int nzet, int l_min=0) const
Computes the chi^2 coefficient from the enthalpy with ye.
void coef_i() const
Computes the physical value of *this.
Base class for coordinate mappings.
virtual double mul_Hs_p(double ent, const double ye) const =0
Computes the electronic chemical potential from the enthapy with electronic fraction (virtual functio...
Values and coefficients of a (real-value) function.
int get_etat() const
Gives the logical state.
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
virtual double sigma_Hs_p(double ent, const double ye) const =0
Computes the source terms for electronic fraction advection equation from the enthapy with electronic...
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Scalar press_Hs(const Scalar &ent, const Scalar &sb, int nzet, int l_min=0) const
Computes the pressure from the log-enthalpy and entropy per baryon.
Scalar temp_Hs(const Scalar &ent, const Scalar &sb, int nzet, int l_min=0) const
Computes the temperature field from the log-enthalpy field and entropy per baryon.
Scalar ener_Hs(const Scalar &ent, const Scalar &sb, int nzet, int l_min=0) const
Computes the total energy density from the log-enthalpy and entropy per baryon.
void set_name(const char *)
Sets the hot EOS name.
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
virtual double ener_Hs_p(double ent, double sb) const =0
Computes the total energy density from the log-enthalpy and entropy per baryon (virtual function impl...
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Scalar csound_square_Hs(const Scalar &ent, const Scalar &Y_e, int nzet, int l_min=0) const
Computes the sound speed squared from the enthalpy with ye.
virtual ~Hot_eos()
Destructor.
Dim_tbl dim
Number of dimensions, size,...
double * t
The array of double.
Mtbl * c
Values of the function at the points of the multi-grid.
virtual int identify() const =0
Returns a number to identify the sub-classe of Hot_eos the object belongs to.
Scalar sigma_Hs(const Scalar &ent, const Scalar &Y_e, int nzet, int l_min=0) const
Computes the source terms for electronic fraction advection equation from the enthalpy with ye...
int get_nzone() const
Returns the number of domains.
Scalar mul_Hs(const Scalar &ent, const Scalar &Ye, int nzet, int l_min=0) const
Computes the electronic chemical potential from the enthalpy with ye.
Scalar nbar_Hs(const Scalar &ent, const Scalar &sb, int nzet, int l_min=0) const
Computes the baryon density field from the log-enthalpy field and entropy per baryon.
void calcule(const Scalar &thermo1, const Scalar &thermo2, int nzet, int l_min, double(Hot_eos::*fait)(double, double) const, Scalar &resu) const
General computational method for Scalar '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.
virtual double csound_square_Hs_p(double ent, const double ye) const =0
Computes the sound speed squared from the enthapy with electronic fraction (virtual function impleme...
Hot_eos()
Standard constructor.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
virtual void del_deriv() const
Deletes all the derived quantities.
Base class for 2-parameters equations of state (abstract class).
int get_taille() const
Gives the total size (ie dim.taille)
virtual void sauve(FILE *) const
Save in a file.
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c )...
Valeur & set_spectral_va()
Returns va (read/write version)
virtual double chi2_Hs_p(double ent, const double ye) const =0
Computes the chi^2 coefficient from the enthapy with electronic fraction (virtual function implemente...
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
const Map & get_mp() const
Returns the mapping.
void annule_hard()
Sets the Tbl to zero in a hard way.
const Valeur & get_spectral_va() const
Returns va (read only version)