29char 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) ;
191ostream& 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) ;
212 resu.set_etat_zero() ;
225 resu.set_etat_qcq() ;
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 ) ;
258 resu.annule(0, l_min-1) ;
261 if (l_min + nzet < nz) {
262 resu.annule(l_min + nzet, nz - 1) ;
268void Eos::calcule(
const Scalar& ent,
int nzet,
int l_min,
271 assert(ent.get_etat() != ETATNONDEF) ;
277 resu.set_etat_zero() ;
290 resu.set_etat_qcq() ;
291 Valeur& vresu = resu.set_spectral_va() ;
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 ) ;
323 resu.annule(0, l_min-1) ;
326 if (l_min + nzet < nz) {
327 resu.annule(l_min + nzet, nz - 1) ;
338Cmp Eos::nbar_ent(
const Cmp& ent,
int nzet,
int l_min,
const Param* par)
const {
342 calcule(ent, nzet, l_min, &Eos::nbar_ent_p, par, resu) ;
352 calcule(ent, nzet, l_min, &Eos::nbar_ent_p, par, resu) ;
363Cmp Eos::ener_ent(
const Cmp& ent,
int nzet,
int l_min,
const Param* par)
const {
367 calcule(ent, nzet, l_min, &Eos::ener_ent_p, par, resu) ;
377 calcule(ent, nzet, l_min, &Eos::ener_ent_p, par, resu) ;
385Cmp Eos::press_ent(
const Cmp& ent,
int nzet,
int l_min,
const Param* par)
const {
389 calcule(ent, nzet, l_min, &Eos::press_ent_p, par, resu) ;
399 calcule(ent, nzet, l_min, &Eos::press_ent_p, par, resu) ;
407Cmp Eos::der_nbar_ent(
const Cmp& ent,
int nzet,
int l_min,
const Param* par)
const {
411 calcule(ent, nzet, l_min, &Eos::der_nbar_ent_p, par, resu) ;
421 calcule(ent, nzet, l_min, &Eos::der_nbar_ent_p, par, resu) ;
430Cmp Eos::der_ener_ent(
const Cmp& ent,
int nzet,
int l_min,
const Param* par)
const {
434 calcule(ent, nzet, l_min, &Eos::der_ener_ent_p, par, resu) ;
444 calcule(ent, nzet, l_min, &Eos::der_ener_ent_p, par, resu) ;
452Cmp Eos::der_press_ent(
const Cmp& ent,
int nzet,
int l_min,
const Param* par)
const {
456 calcule(ent, nzet, l_min, &Eos::der_press_ent_p, par, resu) ;
466 calcule(ent, nzet, l_min, &Eos::der_press_ent_p, par, resu) ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
int get_etat() const
Returns the logical state.
Valeur va
The numerical value of the Cmp
const Map * get_mp() const
Returns the mapping.
Equation of state base class.
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos the object belongs to.
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 ~Eos()
Destructor.
virtual void sauve(FILE *) const
Save in a file.
const char * get_name() const
Returns the EOS name.
Eos()
Standard constructor.
void set_name(const char *name_i)
Sets the 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).
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).
int get_etat() const
Gives the logical state.
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
void coef_i() const
Computes the physical value of *this.
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.