LORENE
|
Equation of state for use in dynamical code base class. More...
#include <dyneos.h>
Public Member Functions | |
virtual | ~Dyn_eos () |
Destructor. More... | |
const string & | get_name () const |
Returns the EOS name. More... | |
void | set_name (const string &) |
Sets the EOS name. More... | |
virtual bool | operator== (const Dyn_eos &) const =0 |
Comparison operator (egality) More... | |
virtual bool | operator!= (const Dyn_eos &) const =0 |
Comparison operator (difference) More... | |
virtual int | identify () const =0 |
Returns a number to identify the sub-classe of Dyn_eos the object belongs to. More... | |
virtual void | sauve (FILE *) const |
Save in a file. More... | |
virtual double | ent_nbar_p (double nbar, const Param *par=0x0) const =0 |
Computes the log-enthalpy from the baryon density and extra parameters (virtual function implemented in the derived classes). More... | |
Scalar | ent_nbar (const Scalar &nbar, int nzet, int l_min=0, Param *par=0x0) const |
Computes the log-enthalpy field from the baryon density field and extra parameters. More... | |
virtual double | ener_nbar_p (double nbar, const Param *par=0x0) const =0 |
Computes the total energy density from the baryon density and extra parameters (virtual function implemented in the derived classes). More... | |
Scalar | ener_nbar (const Scalar &nbar, int nzet, int l_min=0, Param *par=0x0) const |
Computes the total energy density from the baryon density and extra parameters. More... | |
virtual double | press_nbar_p (double nbar, const Param *par=0x0) const =0 |
Computes the pressure from the baryon density and extra parameters (virtual function implemented in the derived classes). More... | |
Scalar | press_nbar (const Scalar &nbar, int nzet, int l_min=0, Param *par=0x0) const |
Computes the pressure from the baryon density and extra parameters. More... | |
virtual double | csound_square_nbar_p (double nbar, const Param *par=0x0) const =0 |
Computes the sound speed squared from the baryon density with extra parameters (virtual function implemented in the derived classes). More... | |
Scalar | csound_square_nbar (const Scalar &nbar, int nzet, int l_min=0, Param *par=0x0) const |
Computes the sound speed squared from the baryon density with extra parameters. More... | |
Static Public Member Functions | |
static Dyn_eos * | convert_from_Eos (const Eos &) |
Conversion operator from Eos to Dyn_eos . More... | |
static Dyn_eos * | eos_from_file (FILE *) |
Construction of an EOS from a binary file. More... | |
static Dyn_eos * | eos_from_file (ifstream &) |
Construction of an EOS from a formatted file. More... | |
Protected Member Functions | |
Dyn_eos () | |
Standard constructor. More... | |
Dyn_eos (const string &) | |
Standard constructor with name. More... | |
Dyn_eos (const Dyn_eos &) | |
Copy constructor. More... | |
Dyn_eos (FILE *) | |
Constructor from a binary file (created by the function sauve(FILE*) ). More... | |
Dyn_eos (ifstream &) | |
Constructor from a formatted file. More... | |
virtual ostream & | operator>> (ostream &) const =0 |
Operator >> More... | |
void | calcule (const Scalar &thermo, int nzet, int l_min, double(Dyn_eos::*fait)(double, const Param *) const, Param *par, Scalar &resu) const |
General computational method for Scalar 's. More... | |
Protected Attributes | |
string | name |
EOS name. More... | |
Friends | |
ostream & | operator<< (ostream &, const Dyn_eos &) |
Display. More... | |
Equation of state for use in dynamical code base class.
()
This class describes equation of states with baryon density as parameter as opposed to the classes of the group Eos
where it is the log-enthalpy which is used.
|
protected |
|
explicitprotected |
|
protected |
|
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 Dyn_eos::eos_from_file(FILE*)
.
Definition at line 79 of file dyneos.C.
References name.
|
protected |
Constructor from a formatted file.
This constructor is protected because any EOS construction from a formatted file must be done via the function Dyn_eos::eos_from_file(ifstream&)
.
Definition at line 90 of file dyneos.C.
References name.
|
protected |
General computational method for Scalar
's.
thermo | [input] thermodynamical quantity (for instance the density field) from which the thermodynamical quantity resu 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 Dyn_eos which performs the pointwise calculation. |
par | possible extra parameters of the EOS |
resu | [output] result of the computation. |
Definition at line 196 of file dyneos.C.
References Lorene::Scalar::get_etat().
Conversion operator from Eos
to Dyn_eos
.
Works only for relativistic polytropes and tabulated EOSs.
Definition at line 120 of file dyneos.C.
References Lorene::Eos_poly::get_gam(), Lorene::Eos_poly::get_kap(), Lorene::Eos_poly::get_m_0(), Lorene::Eos_poly::get_mu_0(), Lorene::Eos::get_name(), and Lorene::Eos::identify().
Scalar Lorene::Dyn_eos::csound_square_nbar | ( | const Scalar & | nbar, |
int | nzet, | ||
int | l_min = 0 , |
||
Param * | par = 0x0 |
||
) | const |
Computes the sound speed squared from the baryon density with extra parameters.
nbar | [input, unit: ] baryon density |
nzet | number of domains where the derivative dln(e)/dln(H) is to be computed. |
l_min | index of the innermost domain is which the coefficient dln(n)/dln(H) is to be computed [default value: 0]; the derivative dln(e)/dln(H) is computed only in domains whose indices are in [l_min,l_min+nzet-1] . In the other domains, it is set to zero. |
par | possible extra parameters of the EOS |
Definition at line 300 of file dyneos.C.
References calcule(), csound_square_nbar_p(), and Lorene::Tensor::get_mp().
|
pure virtual |
Computes the sound speed squared from the baryon density with extra parameters (virtual function implemented in the derived classes).
nbar | [input, unit: ] baryon density |
par | possible extra parameters of the EOS |
Implemented in Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
Scalar Lorene::Dyn_eos::ener_nbar | ( | const Scalar & | nbar, |
int | nzet, | ||
int | l_min = 0 , |
||
Param * | par = 0x0 |
||
) | const |
Computes the total energy density from the baryon density and extra parameters.
nbar | [input, unit: ] baryon density |
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. |
par | possible extra parameters of the EOS |
Definition at line 276 of file dyneos.C.
References calcule(), ener_nbar_p(), and Lorene::Tensor::get_mp().
|
pure virtual |
Computes the total energy density from the baryon density and extra parameters (virtual function implemented in the derived classes).
nbar | [input, unit: ] baryon density |
par | possible extra parameters of the EOS |
Implemented in Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
Scalar Lorene::Dyn_eos::ent_nbar | ( | const Scalar & | nbar, |
int | nzet, | ||
int | l_min = 0 , |
||
Param * | par = 0x0 |
||
) | const |
Computes the log-enthalpy field from the baryon density field and extra parameters.
nbar | [input, unit: ] baryon density |
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. |
par | possible extra parameters of the EOS |
Definition at line 263 of file dyneos.C.
References calcule(), ent_nbar_p(), and Lorene::Tensor::get_mp().
|
pure virtual |
Computes the log-enthalpy from the baryon density and extra parameters (virtual function implemented in the derived classes).
nbar | [input, unit: ] baryon density |
par | possible extra parameters of the EOS |
Implemented in Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
|
static |
Construction of an EOS from a binary file.
The file must have been created by the function sauve(FILE*)
.
Definition at line 323 of file dyneos.C.
References Lorene::fread_be().
|
static |
Construction of an EOS from a formatted file.
The fist line of the file must start by the EOS number, according to the following conventions (same as fo the classes Eos
):
Dyn_eos_poly
).Dyn_eos_poly_newt
).Dyn_eos_tab
).Dyn_eos_cons
).The second line in the file should contain a name given by the user to the EOS. The following lines should contain the EOS parameters (one parameter per line), in the same order than in the class declaration.
const string & Lorene::Dyn_eos::get_name | ( | ) | const |
|
pure virtual |
Returns a number to identify the sub-classe of Dyn_eos
the object belongs to.
Implemented in Lorene::Dyn_eos_cons, Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
|
pure virtual |
Comparison operator (difference)
Implemented in Lorene::Dyn_eos_cons, Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
|
pure virtual |
Comparison operator (egality)
Implemented in Lorene::Dyn_eos_cons, Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
|
protectedpure virtual |
Operator >>
Implemented in Lorene::Dyn_eos_cons, Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
Scalar Lorene::Dyn_eos::press_nbar | ( | const Scalar & | nbar, |
int | nzet, | ||
int | l_min = 0 , |
||
Param * | par = 0x0 |
||
) | const |
Computes the pressure from the baryon density and extra parameters.
nbar | [input, unit: ] baryon density |
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. |
par | possible extra parameters of the EOS |
Definition at line 288 of file dyneos.C.
References calcule(), Lorene::Tensor::get_mp(), and press_nbar_p().
|
pure virtual |
Computes the pressure from the baryon density and extra parameters (virtual function implemented in the derived classes).
nbar | [input, unit: ] baryon density |
par | possible extra parameters of the EOS |
Implemented in Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
|
virtual |
Save in a file.
Reimplemented in Lorene::Dyn_eos_tab, and Lorene::Dyn_eos_poly.
Definition at line 178 of file dyneos.C.
References Lorene::fwrite_be(), identify(), and name.
void Lorene::Dyn_eos::set_name | ( | const string & | name_i | ) |
|
friend |