28 char hoteos_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Eos/hoteos.C,v 1.2 2015/09/10 13:28:18 j_novak Exp $" ;
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) ;
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) ;
Base class for temperature-dependent equations of state (abstract class).
virtual int identify() const =0
Returns a number to identify the sub-classe of Hot_eos the object belongs to.
virtual void del_deriv() const
Deletes all the derived quantities.
virtual double nbar_Hs_p(double ent, double sb) const =0
Computes the baryon density from the log-enthalpy and entropy per baryon (virtual function implemente...
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.
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...
Eos * p_cold_eos
Corresponding cold Eos.
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...
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 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.
Hot_eos()
Standard constructor.
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.
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.
const string & get_name() const
Returns the hot EOS name.
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
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...
virtual ~Hot_eos()
Destructor.
virtual void sauve(FILE *) const
Save in a file.
void set_name(const char *)
Sets the hot EOS name.
Base class for coordinate mappings.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_nzone() const
Returns the number of domains.
Tbl ** t
Array (size nzone ) of pointers on the Tbl 's.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Tensor field of valence 0 (or component of a tensorial field).
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
virtual void annule(int l_min, int l_max)
Sets the Scalar to zero in several domains.
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
const Valeur & get_spectral_va() const
Returns va (read only version)
Valeur & set_spectral_va()
Returns va (read/write version)
Dim_tbl dim
Number of dimensions, size,...
int get_etat() const
Gives the logical state.
void annule_hard()
Sets the Tbl to zero in a hard way.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int get_taille() const
Gives the total size (ie dim.taille)
double * t
The array of double.
Values and coefficients of a (real-value) function.
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c ).
Mtbl * c
Values of the function at the points of the multi-grid
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
void coef_i() const
Computes the physical value of *this.
void annule_hard()
Sets the Valeur to zero in a hard way.
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.
const Map & get_mp() const
Returns the mapping.