28char 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) ;
143ostream& 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) ;
167 resu.set_etat_zero() ;
178 vzero.annule_hard() ;
185 resu.set_etat_qcq() ;
186 Valeur& vresu = resu.set_spectral_va() ;
187 vresu.set_etat_c_qcq() ;
188 vresu.c->set_etat_qcq() ;
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] ;
201 if (tent->get_etat() == ETATZERO) {
202 tresu->set_etat_zero() ;
205 assert( tent->get_etat() == ETATQCQ ) ;
206 tresu->set_etat_qcq() ;
207 if (tsb->get_etat() == ETATZERO) {
209 tsb =
new Tbl(tent->dim) ;
213 for (
int i=0; i<tent->get_taille(); i++) {
215 tresu->t[i] = (this->*fait)( tent->t[i], tsb->t[i] ) ;
219 if (tsb0)
delete tsb ;
225 resu.annule(0, l_min-1) ;
228 if (l_min + nzet < nz) {
229 resu.annule(l_min + nzet, nz - 1) ;
241 calcule(ent, sb, nzet, l_min, &Hot_eos::nbar_Hs_p, resu) ;
257 calcule(ent, sb, nzet, l_min, &Hot_eos::ener_Hs_p, resu) ;
271 calcule(ent, sb, nzet, l_min, &Hot_eos::press_Hs_p, resu) ;
285 calcule(ent, sb, nzet, l_min, &Hot_eos::temp_Hs_p, resu) ;
Base class for temperature-dependent equations of state (abstract class).
const string & get_name() const
Returns the hot EOS name.
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.
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.
Eos * p_cold_eos
Corresponding cold Eos.
Hot_eos()
Standard constructor.
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
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.
Tensor field of valence 0 (or component of a tensorial field).
const Valeur & get_spectral_va() const
Returns va (read only version)
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
double * t
The array of double.
Values and coefficients of a (real-value) function.
Mtbl * c
Values of the function at the points of the multi-grid
void coef_i() const
Computes the physical value of *this.
const Mg3d * get_mg() const
Returns the Mg3d on which the this is defined.
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.