2-fluids equation of state base class. More...
#include <eos_bifluid.h>
Public Member Functions | |
virtual | ~Eos_bifluid () |
Destructor. | |
void | operator= (const Eos_bifluid &) |
Assignment to another Eos_bifluid . | |
string | get_name () const |
Returns the EOS name. | |
double | get_m1 () const |
Return the individual particule mass . | |
double | get_m2 () const |
Return the individual particule mass . | |
virtual bool | operator== (const Eos_bifluid &) const =0 |
Comparison operator (egality). | |
virtual bool | operator!= (const Eos_bifluid &) const =0 |
Comparison operator (difference). | |
virtual int | identify () const =0 |
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to. | |
virtual void | sauve (FILE *) const |
Save in a file. | |
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 profiles. | |
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 classes). | |
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 function implemented in the derived classes). | |
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 function implemented in the derived classes). | |
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 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. | |
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. | |
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. | |
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. | |
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). | |
virtual double | get_K12 (const double n1, const double n2, const double x) const =0 |
Computes the derivative of the energy with respect 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). | |
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). | |
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). | |
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 . | |
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 Eos * | trans2Eos () const =0 |
Makes a translation from Eos_bifluid to Eos . | |
Static Public Member Functions | |
static Eos_bifluid * | eos_from_file (FILE *) |
Construction of an EOS from a binary file. | |
static Eos_bifluid * | eos_from_file (const char *fname) |
Construction of an EOS from a formatted file. | |
Protected Member Functions | |
Eos_bifluid () | |
Standard constructor. | |
Eos_bifluid (const char *name_i, double mass1, double mass2) | |
Standard constructor with name and the two masses per particle. | |
Eos_bifluid (const Eos_bifluid &) | |
Copy constructor. | |
Eos_bifluid (FILE *) | |
Constructor from a binary file (created by the function sauve(FILE*) ). | |
Eos_bifluid (const char *fname) | |
Constructor from a formatted file. | |
virtual ostream & | operator>> (ostream &) const =0 |
Operator >>. | |
Protected Attributes | |
string | name |
EOS name. | |
double | m_1 |
Individual particle mass [unit: ]. | |
double | m_2 |
Individual particle mass [unit: ]. | |
Friends | |
ostream & | operator<< (ostream &, const Eos_bifluid &) |
Display. |
2-fluids equation of state base class.
Fluid 1 is supposed to correspond to neutrons, whereas fluid 2 corresponds to e.g. protons. Neutron 4-velocity is and proton one is
Therefore, the EOS is defined by giving two log-enthalpies AND a relative velocity as inputs. The output are then: two baryonic densities, the total energy density and pressure The enthalpies and are obtained through the formula
see Comer, Novak & Prix. Log-enthalpies are then defined as , where is the mass of a particle of the first fluid. (same for ) The relative velocity is defined as in Comer, Novak & Prix. It can be seen as the neutron velocity seen in the frame of protons (or vice-versa): ()
Definition at line 160 of file eos_bifluid.h.
Eos_bifluid::Eos_bifluid | ( | ) | [protected] |
Standard constructor.
Definition at line 132 of file eos_bifluid.C.
Eos_bifluid::Eos_bifluid | ( | const char * | name_i, | |
double | mass1, | |||
double | mass2 | |||
) | [explicit, protected] |
Standard constructor with name and the two masses per particle.
Definition at line 138 of file eos_bifluid.C.
Eos_bifluid::Eos_bifluid | ( | const Eos_bifluid & | eos_i | ) | [protected] |
Copy constructor.
Definition at line 144 of file eos_bifluid.C.
Eos_bifluid::Eos_bifluid | ( | FILE * | fich | ) | [protected] |
Constructor from a binary file (created by the function sauve(FILE*)
).
This constructor is protected because any EOS construction from a binary file must be done via the function Eos_bifluid::eos_from_file(FILE*)
.
Definition at line 150 of file eos_bifluid.C.
References fread_be(), m_1, m_2, and name.
Eos_bifluid::Eos_bifluid | ( | const char * | fname | ) | [protected] |
Constructor from a formatted file.
This constructor is protected because any EOS construction from a formatted file must be done via the function Eos_bifluid::eos_from_file(const char*)
.
The following fields have to be present in the config-file:\ name: [string] name of the EOS m_1, m_2: [double] baryon masses of the 2-fluids
Definition at line 162 of file eos_bifluid.C.
References m_1, m_2, name, and read_variable().
Eos_bifluid::~Eos_bifluid | ( | ) | [virtual] |
Destructor.
Definition at line 192 of file eos_bifluid.C.
void Eos_bifluid::calcule | ( | const Cmp & | nbar1, | |
const Cmp & | nbar2, | |||
const Cmp & | x2, | |||
int | nzet, | |||
int | l_min, | |||
double(Eos_bifluid::*)(double, double, double) const | fait, | |||
Cmp & | resu | |||
) | const |
General computational method for Cmp
's ('s).
nbar1 | [input, unit ] baryonic density field of fluid 1 at which the derivatives are to be computed. | |
nbar2 | [input, unit ] baryonic density field of fluid 2 at which the derivatives are to be computed | |
x2 | [input, unit ] relative velocityboth densities at which the derivative is to be computed | |
nzet | [input] number of domains where resu is to be computed. | |
l_min | [input] index of the innermost domain is which resu is to be computed [default value: 0]; resu is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. | |
fait | [input] pointer on the member function of class Eos_bifluid which performs the pointwise calculation. | |
resu | [output] result of the computation. |
Definition at line 619 of file eos_bifluid.C.
References Cmp::annule(), Valeur::c, Valeur::coef_i(), Tbl::get_etat(), Cmp::get_etat(), Cmp::get_mp(), Mg3d::get_nzone(), Tbl::get_taille(), Valeur::set_etat_c_qcq(), Tbl::set_etat_qcq(), Mtbl::set_etat_qcq(), Cmp::set_etat_qcq(), Cmp::set_etat_zero(), Tbl::t, Mtbl::t, and Cmp::va.
void Eos_bifluid::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 profiles.
ent1 | [input] the first log-enthalpy field . | |
ent2 | [input] the second log-enthalpy field . | |
delta2 | [input] the relative velocity field | |
nbar1 | [output] baryonic density of the first fluid | |
nbar2 | [output] baryonic density of the second fluid [unit: ] | |
ener | [output] total energy density of both fluids together | |
press | [output] pressure p of both fluids together | |
nzet | [input] number of domains where resu is to be computed. | |
l_min | [input] index of the innermost domain is which resu is to be computed [default value: 0]; resu is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. |
Definition at line 246 of file eos_bifluid.C.
References Cmp::allocate_all(), Cmp::annule(), ener_nbar_p(), Cmp::get_etat(), Cmp::get_mp(), Mg3d::get_nzone(), identify(), nbar_ent_p(), nbar_ent_p1(), nbar_ent_p2(), press_nbar_p(), Cmp::set(), and Cmp::set_etat_zero().
Cmp Eos_bifluid::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.
ent1 | [input, unit: ] log-enthalpy | |
ent2 | [input, unit: ] log-enthalpy | |
delta2 | [input, unit: ] relative velocity | |
nzet | number of domains where the energy density is to be computed. | |
l_min | index of the innermost domain is which the energy density is to be computed [default value: 0]; the energy density is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. |
Definition at line 462 of file eos_bifluid.C.
References ener_nbar_p(), Cmp::get_etat(), Map::get_mg(), Cmp::get_mp(), Mg3d::get_nzone(), nbar_ent_p(), nbar_ent_p1(), and nbar_ent_p2().
virtual double Eos_bifluid::ener_nbar_p | ( | const double | nbar1, | |
const double | nbar2, | |||
const double | delta2 | |||
) | const [pure virtual] |
Computes the total energy density from the baryonic densities and the relative velocity.
(virtual function implemented in the derived classes).
nbar1 | [input] baryonic density of the first fluid | |
nbar2 | [input] baryonic density of the second fluid [unit: ] | |
delta2 | [input, unit: ] relative velocity |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
Eos_bifluid * Eos_bifluid::eos_from_file | ( | const char * | fname | ) | [static] |
Construction of an EOS from a formatted file.
The following field has to be present:\ ident: [int] identifying the type of 2-fluid EOS 1 = relativistic polytropic EOS (class Eos_bf_poly
). \ 2 = Newtonian polytropic EOS (class Eos_bf_poly_newt
).
Definition at line 126 of file eos_bf_file.C.
References read_variable().
Eos_bifluid * Eos_bifluid::eos_from_file | ( | FILE * | fich | ) | [static] |
Construction of an EOS from a binary file.
The file must have been created by the function sauve(FILE*)
.
Definition at line 94 of file eos_bf_file.C.
References fread_be().
virtual double Eos_bifluid::get_K11 | ( | const double | n1, | |
const double | n2, | |||
const double | x | |||
) | const [pure virtual] |
Computes the derivative of the energy with respect to (baryonic density 1).
(virtual function implemented in the derived classes).
n1 | [input, unit ] baryonic density of fluid 1 at which the derivative is to be computed | |
n2 | [input, unit ] baryonic density of fluid 2 at which the derivative is to be computed | |
x | [input, unit ] relative Lorentz factorboth densities at which the derivative is to be computed |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
virtual double Eos_bifluid::get_K12 | ( | const double | n1, | |
const double | n2, | |||
const double | x | |||
) | const [pure virtual] |
Computes the derivative of the energy with respect to .
(virtual function implemented in the derived classes).
n1 | [input, unit ] baryonic density of fluid 1 at which the derivative is to be computed | |
n2 | [input, unit ] baryonic density of fluid 2 at which the derivative is to be computed | |
x | [input, unit ] relative Lorentz factorboth densities at which the derivative is to be computed |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
virtual double Eos_bifluid::get_K22 | ( | const double | n1, | |
const double | n2, | |||
const double | x | |||
) | const [pure virtual] |
Computes the derivative of the energy/(baryonic density 2).
(virtual function implemented in the derived classes).
n1 | [input, unit ] baryonic density of fluid 1 at which the derivative is to be computed | |
n2 | [input, unit ] baryonic density of fluid 2 at which the derivative is to be computed | |
x | [input, unit ] relative Lorentz factorboth densities at which the derivative is to be computed |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
Cmp Eos_bifluid::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).
nbar1 | [input, unit ] baryonic density field of fluid 1 at which the derivatives are to be computed | |
nbar2 | [input, unit ] baryonic density field of fluid 2 at which the derivatives are to be computed | |
x2 | [input, unit ] relative velocityboth densities at which the derivative is to be computed | |
nzet | number of domains where the derivatives are to be computed. | |
l_min | index of the innermost domain is which the derivatives are to be computed [default value: 0]; the derivatives are computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. |
get_K11
) Definition at line 706 of file eos_bifluid.C.
References calcule(), get_K11(), and Cmp::get_mp().
Cmp Eos_bifluid::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 .
nbar1 | [input, unit ] baryonic density field of fluid 1 at which the derivatives are to be computed | |
nbar2 | [input, unit ] baryonic density field of fluid 2 at which the derivatives are to be computed | |
x2 | [input, unit ] relative velocityboth densities at which the derivative is to be computed | |
nzet | number of domains where the derivatives are to be computed. | |
l_min | index of the innermost domain is which the derivatives are to be computed [default value: 0]; the derivatives are computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. |
get_K12
) Definition at line 717 of file eos_bifluid.C.
References calcule(), get_K12(), and Cmp::get_mp().
Cmp Eos_bifluid::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).
nbar1 | [input, unit ] baryonic density field of fluid 1 at which the derivatives are to be computed | |
nbar2 | [input, unit ] baryonic density field of fluid 2 at which the derivatives are to be computed | |
x2 | [input, unit ] relative velocityboth densities at which the derivative is to be computed | |
nzet | number of domains where the derivatives are to be computed. | |
l_min | index of the innermost domain is which the derivatives are to be computed [default value: 0]; the derivatives are computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. |
get_K12
) Definition at line 728 of file eos_bifluid.C.
References calcule(), get_K22(), and Cmp::get_mp().
double Eos_bifluid::get_m1 | ( | ) | const [inline] |
Return the individual particule mass .
[unit: ].
Definition at line 234 of file eos_bifluid.h.
References m_1.
double Eos_bifluid::get_m2 | ( | ) | const [inline] |
Return the individual particule mass .
[unit: ].
Definition at line 240 of file eos_bifluid.h.
References m_2.
string Eos_bifluid::get_name | ( | ) | const [inline] |
virtual int Eos_bifluid::identify | ( | ) | const [pure virtual] |
Returns a number to identify the sub-classe of Eos_bifluid
the object belongs to.
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
void Eos_bifluid::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.
ent1 | [input, unit: ] log-enthalpy | |
ent2 | [input, unit: ] log-enthalpy | |
delta2 | [input, unit: ] relative velocity | |
nbar1 | [output] baryonic density of the first fluid | |
nbar2 | [output] baryonic density of the second fluid [unit: ] | |
nzet | number of domains where the baryon density is to be computed. | |
l_min | index of the innermost domain is which the baryon density is to be computed [default value: 0]; the baryon density is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. |
Definition at line 374 of file eos_bifluid.C.
References Cmp::allocate_all(), Cmp::annule(), Cmp::get_etat(), Cmp::get_mp(), Mg3d::get_nzone(), nbar_ent_p(), nbar_ent_p1(), nbar_ent_p2(), Cmp::set(), and Cmp::set_etat_zero().
virtual bool Eos_bifluid::nbar_ent_p | ( | const double | ent1, | |
const double | ent2, | |||
const double | delta2, | |||
double & | nbar1, | |||
double & | nbar2 | |||
) | const [pure virtual] |
Computes both baryon densities from the log-enthalpies (virtual function implemented in the derived classes).
ent1 | [input, unit: ] log-enthalpy | |
ent2 | [input, unit: ] log-enthalpy | |
delta2 | [input, unit: ] relative velocity | |
nbar1 | [output] baryonic density of the first fluid | |
nbar2 | [output] baryonic density of the second fluid [unit: ] |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
virtual double Eos_bifluid::nbar_ent_p1 | ( | const double | ent1 | ) | const [pure virtual] |
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present (virtual function implemented in the derived classes).
ent1 | [input, unit: ] log-enthalpy |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
virtual double Eos_bifluid::nbar_ent_p2 | ( | const double | ent2 | ) | const [pure virtual] |
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present (virtual function implemented in the derived classes).
ent2 | [input, unit: ] log-enthalpy |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
virtual bool Eos_bifluid::operator!= | ( | const Eos_bifluid & | ) | const [pure virtual] |
Comparison operator (difference).
void Eos_bifluid::operator= | ( | const Eos_bifluid & | eosi | ) |
Assignment to another Eos_bifluid
.
Reimplemented in Eos_bf_poly, and Eos_bf_poly_newt.
Definition at line 198 of file eos_bifluid.C.
virtual bool Eos_bifluid::operator== | ( | const Eos_bifluid & | ) | const [pure virtual] |
Comparison operator (egality).
virtual ostream& Eos_bifluid::operator>> | ( | ostream & | ) | const [protected, pure virtual] |
Operator >>.
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
Cmp Eos_bifluid::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.
ent1 | [input, unit: ] log-enthalpy | |
ent2 | [input, unit: ] log-enthalpy | |
delta2 | [input, unit: ] relative velocity | |
nzet | number of domains where the pressure is to be computed. | |
l_min | index of the innermost domain is which the pressure is to be computed [default value: 0]; the pressure is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. |
Definition at line 542 of file eos_bifluid.C.
References Cmp::get_etat(), Map::get_mg(), Cmp::get_mp(), Mg3d::get_nzone(), nbar_ent_p(), nbar_ent_p1(), nbar_ent_p2(), and press_nbar_p().
virtual double Eos_bifluid::press_nbar_p | ( | const double | nbar1, | |
const double | nbar2, | |||
const double | delta2 | |||
) | const [pure virtual] |
Computes the pressure from the baryonic densities and the relative velocity.
(virtual function implemented in the derived classes).
nbar1 | [input] baryonic density of the first fluid | |
nbar2 | [input] baryonic density of the second fluid [unit: ] | |
delta2 | [input, unit: ] relative velocity |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
void Eos_bifluid::sauve | ( | FILE * | fich | ) | const [virtual] |
Save in a file.
Reimplemented in Eos_bf_poly, and Eos_bf_poly_newt.
Definition at line 211 of file eos_bifluid.C.
References fwrite_be(), identify(), m_1, m_2, and name.
virtual Eos* Eos_bifluid::trans2Eos | ( | ) | const [pure virtual] |
Makes a translation from Eos_bifluid
to Eos
.
(virtual function implemented in the derived classes).
This is only useful for the construction of a Et_rot_bifluid
star and ought not to be used in other situations.
relat | [input] Relativistic EOS or not. |
Implemented in Eos_bf_poly, and Eos_bf_poly_newt.
ostream& operator<< | ( | ostream & | , | |
const Eos_bifluid & | ||||
) | [friend] |
Display.
double Eos_bifluid::m_1 [protected] |
Individual particle mass [unit: ].
Definition at line 171 of file eos_bifluid.h.
double Eos_bifluid::m_2 [protected] |
Individual particle mass [unit: ].
Definition at line 176 of file eos_bifluid.h.
string Eos_bifluid::name [protected] |
EOS name.
Definition at line 166 of file eos_bifluid.h.