79 #include "utilitaires.h" 89 constructed_from_file(false) {
94 for (
int l=0; l<
ndom; l++) {
102 constructed_from_file(false) {
112 constructed_from_file(false) {
123 constructed_from_file(false) {
137 constructed_from_file(false) {
141 for (
int l=0; l<
ndom; l++) {
154 ofstream temp(
"meos_is_being_built.d") ;
155 temp <<
" " << flush ;
158 for (
int l=
ndom-1; l>=0; l--) {
162 system(
"rm -f meos_is_being_built.d") ;
167 constructed_from_file(true) {
171 fich >>
ndom ; fich.getline(blabla, 80) ;
174 ofstream temp(
"meos_is_being_built.d") ;
175 temp <<
" " << flush ;
178 for (
int l=
ndom-1; l>=0; l--) {
182 system(
"rm -f meos_is_being_built.d") ;
191 for (
int l=0; l<
ndom; l++) {
206 cout <<
"MEos::operator= : not implemented yet !" << endl ;
222 for (
int l=
ndom-1; l>=0; l--) {
230 ost <<
"EOS of class MEos (multi-domain equation of state) : " << endl ;
231 ost <<
" Number of domains : " <<
ndom << endl ;
233 for (
int l=0; l<
ndom; l++) {
234 ost <<
"Equation of state in domain " << l <<
" : " << endl ;
235 ost <<
"-------------------------------" << endl ;
253 cout <<
"The second EOS is not of type MEos !" << endl ;
258 const MEos& eos =
dynamic_cast<const MEos&
>( eos_i ) ;
261 cout <<
"The two MEos have different number of domains" << endl ;
266 for (
int l=0; l<
ndom; l++) {
virtual double der_nbar_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
virtual double der_press_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
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...
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...
void operator=(const MEos &)
Assignment to another MEos.
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual bool operator==(const Eos &) const
Comparison operator (egality)
MEos(int ndom_i, const Eos **mono_eos_i)
Standard constructor.
Equation of state base class.
int ndom
Number of domains.
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual ostream & operator>>(ostream &) const
Operator >>
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...
EOS with domain dependency.
virtual void sauve(FILE *) const
Save in a file.
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...
virtual double press_ent_p(double ent, const Param *par=0x0) const
Computes the pressure from the log-enthalpy.
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 ...
static Eos * eos_from_file(FILE *)
Construction of an EOS from a binary file.
const Eos ** mono_eos
Array (upon the domains) containing the various EOS.
int & get_int_mod(int position=0) const
Returns the reference of a modifiable int stored in the list.
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 ener_ent_p(double ent, const Param *par=0x0) const
Computes the total energy density from the log-enthalpy.
bool constructed_from_file
Indicates wether the EOS has been constructed from a file.
virtual double der_ener_ent_p(double ent, const Param *par=0x0) const
Computes the logarithmic derivative from the log-enthalpy.
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
virtual ~MEos()
Destructor.
virtual bool operator!=(const Eos &) const
Comparison operator (difference)
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...
virtual double nbar_ent_p(double ent, const Param *par=0x0) const
Computes the baryon density from the log-enthalpy.
virtual void sauve(FILE *) const
Save in a file.