29#ifndef __EOS_BIFLUID_H_
30#define __EOS_BIFLUID_H_
143#include "utilitaires.h"
154#define MAX_EOSNAME 100
205 explicit Eos_bifluid(
const char* name_i,
double mass1,
double mass2) ;
315 virtual void sauve(FILE* )
const ;
349 int nzet,
int l_min = 0)
const ;
363 virtual bool nbar_ent_p(
const double ent1,
const double ent2,
364 const double delta2,
double& nbar1,
365 double& nbar2)
const = 0 ;
404 Cmp& nbar1,
Cmp& nbar2,
int nzet,
int l_min = 0)
419 virtual double ener_nbar_p(
const double nbar1,
const double nbar2,
420 const double delta2)
const = 0 ;
442 int nzet,
int l_min = 0)
const ;
457 const double delta2)
const = 0 ;
478 int nzet,
int l_min = 0)
const ;
496 virtual double get_K11(
const double n1,
const double n2,
const
497 double x)
const = 0 ;
515 virtual double get_K12(
const double n1,
const double n2,
const
516 double x)
const = 0 ;
533 virtual double get_K22(
const double n1,
const double n2,
const
534 double x)
const = 0 ;
559 int nzet,
int l_min = 0)
const ;
584 x2,
int nzet,
int l_min = 0)
const ;
610 int nzet,
int l_min = 0)
const ;
636 x2,
int nzet,
int l_min,
double
637 (
Eos_bifluid::*fait)(
double,
double,
double)
const,
655ostream& operator<<(ostream& ,
const Eos_bifluid& ) ;
832 Eos_bf_poly(
double kappa1,
double kappa2,
double kappa3,
double beta) ;
860 Eos_bf_poly(
double gamma1,
double gamma2,
double gamma3,
861 double gamma4,
double gamma5,
double gamma6,
862 double kappa1,
double kappa2,
double kappa3,
863 double beta,
double mass1=1,
double mass2=1,
865 double ecart = 1.e-8) ;
956 int get_typeos()
const {
return typeos;};
971 virtual void sauve(FILE* )
const ;
974 virtual ostream&
operator>>(ostream &)
const ;
993 virtual bool nbar_ent_p(
const double ent1,
const double ent2,
994 const double delta2,
double& nbar1,
995 double& nbar2)
const ;
1002 virtual double nbar_ent_p1(
const double ent1)
const ;
1009 virtual double nbar_ent_p2(
const double ent2)
const ;
1022 virtual double ener_nbar_p(
const double nbar1,
const double nbar2,
1023 const double delta2)
const ;
1036 virtual double press_nbar_p(
const double nbar1,
const double nbar2,
1037 const double delta2)
const ;
1064 virtual double get_K11(
const double n1,
const double n2,
const
1065 double delta2)
const ;
1082 virtual double get_K12(
const double n1,
const double n2,
const
1083 double delta2)
const ;
1099 virtual double get_K22(
const double n1,
const double n2,
const
1100 double delta2)
const ;
1220 double gamma4,
double gamma5,
double gamma6,
1221 double kappa1,
double kappa2,
double kappa3,
1222 double beta,
double mass1,
double mass2,
1224 double ecart = 1.e-8) ;
1277 virtual void sauve(FILE* )
const ;
1280 virtual ostream&
operator>>(ostream &)
const ;
1299 virtual bool nbar_ent_p(
const double ent1,
const double ent2,
1300 const double delta2,
double& nbar1,
1301 double& nbar2)
const ;
1309 virtual double nbar_ent_p1(
const double ent1)
const ;
1316 virtual double nbar_ent_p2(
const double ent2)
const ;
1329 virtual double ener_nbar_p(
const double nbar1,
const double nbar2,
1330 const double delta2)
const ;
1343 virtual double press_nbar_p(
const double nbar1,
const double nbar2,
1344 const double delta2)
const ;
1371 virtual double get_K11(
const double n1,
const double n2,
const
1372 double delta2)
const ;
1389 virtual double get_K12(
const double n1,
const double n2,
const
1390 double delta2)
const ;
1406 virtual double get_K22(
const double n1,
const double n2,
const
1407 double delta2)
const ;
1527 Eos_bf_tabul(
const char* name_i,
const char* table,
const char* path,
double mass1,
double mass2) ;
1537 Eos_bf_tabul(
const char* name_i,
const char* file_name,
double mass1,
double mass2) ;
1617 virtual void sauve(FILE* )
const ;
1621 virtual ostream&
operator>>(ostream &)
const ;
1656 int nzet,
int l_min = 0)
const ;
1669 virtual bool nbar_ent_p(
const double ent1,
const double ent2,
1670 const double delta2,
double& nbar1,
1671 double& nbar2)
const ;
1678 virtual double nbar_ent_p1(
const double ent1)
const ;
1685 virtual double nbar_ent_p2(
const double ent2)
const ;
1698 virtual double ener_nbar_p(
const double nbar1,
const double nbar2,
1699 const double delta2)
const ;
1712 virtual double press_nbar_p(
const double nbar1,
const double nbar2,
1713 const double delta2)
const ;
1727 virtual double get_K11(
const double delta2,
const double ent1,
1728 const double ent2)
const ;
1742 virtual double get_K12(
const double delta2,
const double ent1 ,
1743 const double ent2)
const ;
1756 virtual double get_K22(
const double delta2,
const double ent1,
1757 const double ent2)
const ;
1769 virtual double ener_ent_p(
const double ent1,
const double ent2,
1770 const double delta_car)
const ;
1782 virtual double press_ent_p(
const double ent1,
const double ent2,
1783 const double delta_car)
const ;
1795 virtual double alpha_ent_p(
const double ent1,
const double ent2,
1796 const double delta_car)
const ;
1816 const double mu2,
double& press,
double& nbar1,
double& nbar2,
double& alpha)
const ;
1824 const Tbl& ftab,
const Tbl& dfdytab,
const Tbl& dfdztab,
const Tbl& d2fdydztab,
1825 const double y,
const double z,
double& f,
double& dfdy,
double& dfdz)
const ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference).
void operator=(const Eos_bf_poly_newt &)
Assignment to another Eos_bf_poly_newt.
virtual double get_K22(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy/(baryonic density 2) .
virtual int identify() const
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
virtual double nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present (virtual functio...
virtual double get_K11(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to (baryonic density 1) .
virtual ostream & operator>>(ostream &) const
Operator >>.
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality).
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const
Computes both baryon densities from the log-enthalpies.
Eos_bf_poly_newt(double kappa1, double kappa2, double kappa3, double beta)
Standard constructor.
virtual void sauve(FILE *) const
Save in a file.
virtual double nbar_ent_p2(const double ent2) const
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present.
virtual ~Eos_bf_poly_newt()
Destructor.
virtual double get_K12(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to .
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the total energy density from the baryonic densities and the relative velocity.
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
double gam5
Adiabatic indexes , see Eq.~eeosbfpolye}.
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference).
double kap1
Pressure coefficient , see Eq.
double get_kap1() const
Returns the pressure coefficient [unit: ], where .
void determine_type()
Determines the type of the analytical EOS (see typeos ).
double gam1
Adiabatic indexes , see Eq.~eeosbfpolye}.
double kap2
Pressure coefficient , see Eq.
void operator=(const Eos_bf_poly &)
Assignment to another Eos_bf_poly.
double gam4
Adiabatic indexes , see Eq.~eeosbfpolye}.
double get_gam6() const
Returns the adiabatic index .
double gam3
Adiabatic indexes , see Eq.~eeosbfpolye}.
virtual double get_K11(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to (baryonic density 1) .
virtual double get_K12(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to .
double get_gam4() const
Returns the adiabatic index .
double get_gam1() const
Returns the adiabatic index .
double get_gam5() const
Returns the adiabatic index .
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality).
virtual ostream & operator>>(ostream &) const
Operator >>.
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
virtual double get_K22(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy/(baryonic density 2) .
double gam6
Adiabatic indexes , see Eq.~eeosbfpolye}.
double gam2
Adiabatic indexes , see Eq.~eeosbfpolye}.
double precis
contains the precision required in zerosec_b
virtual int identify() const
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
double get_gam2() const
Returns the adiabatic index .
double get_gam3() const
Returns the adiabatic index .
double get_kap3() const
Returns the pressure coefficient [unit: ], where .
double get_beta() const
Returns the coefficient [unit: ], where .
virtual void sauve(FILE *) const
Save in a file.
void set_auxiliary()
Computes the auxiliary quantities gam1m1 , gam2m1 and gam3m1.
double get_kap2() const
Returns the pressure coefficient [unit: ], where .
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the total energy density from the baryonic densities and the relative velocity.
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const
Computes both baryon densities from the log-enthalpies.
int typeos
The bi-fluid analytical EOS type:
double beta
Coefficient , see Eq.
double kap3
Pressure coefficient , see Eq.
virtual double nbar_ent_p2(const double ent2) const
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present.
virtual double nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present.
double ecart
contains the precision required in the relaxation nbar_ent_p
Eos_bf_poly(double kappa1, double kappa2, double kappa3, double beta)
Standard constructor.
double relax
Parameters needed for some inversions of the EOS.
virtual ~Eos_bf_poly()
Destructor.
double mu2_max
Upper boundary of the chemical-potential interval (fluid 2 = p).
virtual double press_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes the pressure from the baryonic log-enthalpies and the relative velocity.
Tbl * dpsddelta_car_tab
Table of .
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
void operator=(const Eos_bf_tabul &)
Assignment to another Eos_bf_tabul.
Tbl * dn2sddelta_car_tab
Table of .
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const
Computes both baryon densities from the log-enthalpies.
double delta_car_max
Upper boundary of the relative velocity interval.
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference).
void calcule_interpol(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, Cmp &nbar1, Cmp &nbar2, Cmp &ener, Cmp &press, Cmp &K_nn, Cmp &K_np, Cmp &K_pp, Cmp &alpha_eos, int nzet, int l_min=0) const
General computational method for Cmp 's, it computes both baryon densities, energy and pressure profi...
Tbl * press_tab
Table of .
virtual ~Eos_bf_tabul()
Destructor.
string tablename
Name of the file containing the tabulated data (be careful, Eos_bifluid uses char*).
double mu2_min
Lower boundary of the chemical-potential interval (fluid 2 = p).
double mu1_min
Lower boundary of the chemical-potential interval (fluid 1 = n).
virtual double alpha_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes alpha, the derivative of the total energy density with respect to from the baryonic log-ent...
Eos_bf_tabul(const Eos_bf_tabul &)
Copy constructor.
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality).
double delta_car_min
Lower boundary of the relative velocity interval.
double mu1_max
Upper boundary of the chemical-potential interval (fluid 1 = n).
void interpol_2d_Tbl3d(const int i, const int j, const int k, const Tbl &ytab, const Tbl &ztab, const Tbl &ftab, const Tbl &dfdytab, const Tbl &dfdztab, const Tbl &d2fdydztab, const double y, const double z, double &f, double &dfdy, double &dfdz) const
Routine used by interpol_3d_bifluid to perform the 2D interpolation on the chemical potentials on eac...
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
virtual double nbar_ent_p2(const double ent2) const
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present.
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the total energy density from the baryonic densities and the relative velocity.
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
Tbl * d2psdmu1dmu2_tab
Table of .
virtual double get_K22(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy/(baryonic density 2) .
void read_table()
Reads the file containing the table and initializes the arrays mu1_tab, mu2_tab, delta_car_tab,...
void interpol_3d_bifluid(const double delta2, const double mu1, const double mu2, double &press, double &nbar1, double &nbar2, double &alpha) const
General method computing the pressure, both baryon densities and alpha from the values of both chemic...
Tbl * delta_car_tab
Table of .
virtual ostream & operator>>(ostream &) const
Operator >>.
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
virtual double get_K12(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy with respect to .
virtual double get_K11(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy with respect to (baryonic density 1) .
Tbl * mu2_tab
Table of where .
virtual void sauve(FILE *) const
Save in a file.
virtual double ener_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes the total energy density from the baryonic log-enthalpies and the relative velocity.
virtual double nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present.
Tbl * dn1sddelta_car_tab
Table of .
Eos_bf_tabul(const char *name_i, const char *table, const char *path, double mass1, double mass2)
Standard constructor.
Tbl * mu1_tab
Table of where .
2-fluids equation of state base class.
void calcule(const Cmp &nbar1, const Cmp &nbar2, const Cmp &x2, int nzet, int l_min, double(Eos_bifluid::*fait)(double, double, double) const, Cmp &resu) const
General computational method for Cmp 's ( 's).
virtual void calcule_tout(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, Cmp &nbar1, Cmp &nbar2, Cmp &ener, Cmp &press, int nzet, int l_min=0) const
General computational method for Cmp 's, it computes both baryon densities, energy and pressure profi...
virtual ostream & operator>>(ostream &) const =0
Operator >>.
virtual double nbar_ent_p2(const double ent2) const =0
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present (virtual functi...
double get_m1() const
Return the individual particule mass .
virtual void sauve(FILE *) const
Save in a file.
static Eos_bifluid * eos_from_file(FILE *)
Construction of an EOS from a binary file.
virtual ~Eos_bifluid()
Destructor.
void nbar_ent(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, Cmp &nbar1, Cmp &nbar2, int nzet, int l_min=0) const
Computes both baryon density fields from the log-enthalpy fields and the relative velocity.
virtual bool operator==(const Eos_bifluid &) const =0
Comparison operator (egality).
double m_1
Individual particle mass [unit: ].
virtual double nbar_ent_p1(const double ent1) const =0
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present (virtual functio...
double get_m2() const
Return the individual particule mass .
virtual bool operator!=(const Eos_bifluid &) const =0
Comparison operator (difference).
Cmp get_Knn(const Cmp &nbar1, const Cmp &nbar2, const Cmp &x2, int nzet, int l_min=0) const
Computes the derivatives of the energy/(baryonic density 1) .
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
virtual double get_K22(const double n1, const double n2, const double x) const =0
Computes the derivative of the energy/(baryonic density 2) .
virtual double get_K11(const double n1, const double n2, const double x) const =0
Computes the derivative of the energy with respect to (baryonic density 1) .
Cmp get_Kpp(const Cmp &nbar1, const Cmp &nbar2, const Cmp &x2, int nzet, int l_min=0) const
Computes the derivatives of the energy/(baryonic density 2) .
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const =0
Computes the total energy density from the baryonic densities and the relative velocity.
string get_name() const
Returns the EOS name.
virtual Eos * trans2Eos() const =0
Makes a translation from Eos_bifluid to Eos .
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const =0
Computes the pressure from the baryonic densities and the relative velocity.
virtual double get_K12(const double n1, const double n2, const double x) const =0
Computes the derivative of the energy with respect to .
Cmp press_ent(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, int nzet, int l_min=0) const
Computes the pressure from the log-enthalpy fields and the relative velocity.
Cmp ener_ent(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, int nzet, int l_min=0) const
Computes the total energy density from the log-enthalpy fields and the relative velocity.
Cmp get_Knp(const Cmp &nbar1, const Cmp &nbar2, const Cmp &x2, int nzet, int l_min=0) const
Computes the derivatives of the energy with respect to .
friend ostream & operator<<(ostream &, const Eos_bifluid &)
Display.
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const =0
Computes both baryon densities from the log-enthalpies (virtual function implemented in the derived c...
void operator=(const Eos_bifluid &)
Assignment to another Eos_bifluid.
double m_2
Individual particle mass [unit: ].
Eos_bifluid()
Standard constructor.
Polytropic equation of state (relativistic case).
Equation of state base class.
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
Coord z
z coordinate centered on the grid
Coord y
y coordinate centered on the grid
Coord x
x coordinate centered on the grid