Base class for stars. More...
#include <star.h>
Public Member Functions | |
Star (Map &mp_i, int nzet_i, const Eos &eos_i) | |
Standard constructor. | |
Star (const Star &) | |
Copy constructor. | |
Star (Map &mp_i, const Eos &eos_i, FILE *fich) | |
Constructor from a file (see sauve(FILE* ) ). | |
virtual | ~Star () |
Destructor. | |
void | operator= (const Star &) |
Assignment to another Star . | |
Map & | set_mp () |
Read/write of the mapping. | |
void | set_enthalpy (const Scalar &) |
Assignment of the enthalpy field. | |
void | equation_of_state () |
Computes the proper baryon and energy density, as well as pressure from the enthalpy. | |
virtual void | hydro_euler () |
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid frame (nbar , ener and press ). | |
virtual void | equilibrium_spher (double ent_c, double precis=1.e-14, const Tbl *pent_limit=0x0) |
Computes a spherical static configuration. | |
const Map & | get_mp () const |
Returns the mapping. | |
int | get_nzet () const |
Returns the number of domains occupied by the star. | |
const Eos & | get_eos () const |
Returns the equation of state. | |
const Scalar & | get_ent () const |
Returns the enthalpy field. | |
const Scalar & | get_nbar () const |
Returns the proper baryon density. | |
const Scalar & | get_ener () const |
Returns the proper total energy density. | |
const Scalar & | get_press () const |
Returns the fluid pressure. | |
const Scalar & | get_ener_euler () const |
Returns the total energy density with respect to the Eulerian observer. | |
const Scalar & | get_s_euler () const |
Returns the trace of the stress tensor in the Eulerian frame. | |
const Scalar & | get_gam_euler () const |
Returns the Lorentz factor between the fluid and Eulerian observers. | |
const Vector & | get_u_euler () const |
Returns the fluid 3-velocity with respect to the Eulerian observer. | |
const Tensor & | get_stress_euler () const |
Returns the spatial part of the stress-energy tensor with respect to the Eulerian observer. | |
const Scalar & | get_logn () const |
Returns the logarithm of the lapse N. | |
const Scalar & | get_nn () const |
Returns the lapse function N. | |
const Vector & | get_beta () const |
Returns the shift vector . | |
const Scalar & | get_lnq () const |
const Metric & | get_gamma () const |
Returns the 3-metric . | |
virtual void | sauve (FILE *) const |
Save in a file. | |
double | ray_eq () const |
Coordinate radius at , [r_unit]. | |
double | ray_eq_pis2 () const |
Coordinate radius at , [r_unit]. | |
double | ray_eq_pi () const |
Coordinate radius at , [r_unit]. | |
double | ray_eq_3pis2 () const |
Coordinate radius at , [r_unit]. | |
double | ray_pole () const |
Coordinate radius at [r_unit]. | |
virtual const Itbl & | l_surf () const |
Description of the stellar surface: returns a 2-D Itbl containing the values of the domain index l on the surface at the collocation points in . | |
const Tbl & | xi_surf () const |
Description of the stellar surface: returns a 2-D Tbl containing the values of the radial coordinate on the surface at the collocation points in . | |
virtual double | mass_b () const =0 |
Baryon mass. | |
virtual double | mass_g () const =0 |
Gravitational mass. | |
Protected Member Functions | |
virtual void | del_deriv () const |
Deletes all the derived quantities. | |
virtual void | set_der_0x0 () const |
Sets to 0x0 all the pointers on derived quantities. | |
virtual void | del_hydro_euler () |
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer. | |
virtual ostream & | operator>> (ostream &) const |
Operator >> (virtual function called by the operator <<). | |
Protected Attributes | |
Map & | mp |
Mapping associated with the star. | |
int | nzet |
Number of domains of *mp occupied by the star. | |
const Eos & | eos |
Equation of state of the stellar matter. | |
Scalar | ent |
Log-enthalpy. | |
Scalar | nbar |
Baryon density in the fluid frame. | |
Scalar | ener |
Total energy density in the fluid frame. | |
Scalar | press |
Fluid pressure. | |
Scalar | ener_euler |
Total energy density in the Eulerian frame. | |
Scalar | s_euler |
Trace of the stress scalar in the Eulerian frame. | |
Scalar | gam_euler |
Lorentz factor between the fluid and Eulerian observers. | |
Vector | u_euler |
Fluid 3-velocity with respect to the Eulerian observer. | |
Sym_tensor | stress_euler |
Spatial part of the stress-energy tensor with respect to the Eulerian observer. | |
Scalar | logn |
Logarithm of the lapse N . | |
Scalar | nn |
Lapse function N . | |
Vector | beta |
Shift vector. | |
Scalar | lnq |
Metric | gamma |
3-metric | |
double * | p_ray_eq |
Coordinate radius at , . | |
double * | p_ray_eq_pis2 |
Coordinate radius at , . | |
double * | p_ray_eq_pi |
Coordinate radius at , . | |
double * | p_ray_eq_3pis2 |
Coordinate radius at , . | |
double * | p_ray_pole |
Coordinate radius at . | |
Itbl * | p_l_surf |
Description of the stellar surface: 2-D Itbl containing the values of the domain index l on the surface at the collocation points in . | |
Tbl * | p_xi_surf |
Description of the stellar surface: 2-D Tbl containing the values of the radial coordinate on the surface at the collocation points in . | |
double * | p_mass_b |
Baryon mass. | |
double * | p_mass_g |
Gravitational mass. | |
Friends | |
ostream & | operator<< (ostream &, const Star &) |
Display. |
Base class for stars.
()
A Star
is constructed upon (i) a mapping (derived class of Map
), the center of which defines the center of the star, and (ii) an equation of state (derived class of Eos
). It contains tensor fields (class Tensor
) which describe the hydrodynamical quantities as well as the gravitational field (spacetime metric).
According to the 3+1 formalism, the spacetime metric is written
where is the 3-metric, described by a Lorene object of class Metric
.
The 3+1 formalism introduces two kinds of privileged observers: the fluid comoving observer and the Eulerian observer, whose 4-velocity is the unit future directed normal to the t = const hypersurfaces. The hydrodynamical quantities measured by the fluid observer correspond to the members ent
, nbar
, ener
, and press
. The hydrodynamical quantities measured by the Eulerian observer correspond to the members ener_euler
, s_euler
, gam_euler
, and u_euler
.
Definition at line 171 of file star.h.
Standard constructor.
mp_i | Mapping on which the star will be defined | |
nzet_i | Number of domains occupied by the star | |
eos_i | Equation of state of the stellar matter |
Definition at line 120 of file star.C.
References beta, ener, ener_euler, ent, Map::flat_met_spher(), gam_euler, gamma, logn, mp, nbar, nn, press, s_euler, set_der_0x0(), Tensor::set_etat_zero(), Scalar::std_spectral_base(), stress_euler, and u_euler.
Star::Star | ( | const Star & | et | ) |
Constructor from a file (see sauve(FILE* )
).
mp_i | Mapping on which the star will be defined | |
eos_i | Equation of state of the stellar matter | |
fich | input file (must have been created by the function sauve ) |
Definition at line 219 of file star.C.
References beta, ent, eos, Eos::eos_from_file(), fread_be(), Map::get_mg(), mp, nn, nzet, set_der_0x0(), Tensor::set_etat_zero(), stress_euler, and u_euler.
Star::~Star | ( | ) | [virtual] |
void Star::del_deriv | ( | ) | const [protected, virtual] |
Deletes all the derived quantities.
Reimplemented in Star_bin, Star_bin_xcts, Star_bhns, Star_rot, and Star_rot_Dirac.
Definition at line 294 of file star.C.
References p_l_surf, p_mass_b, p_mass_g, p_ray_eq, p_ray_eq_3pis2, p_ray_eq_pi, p_ray_eq_pis2, p_ray_pole, p_xi_surf, and set_der_0x0().
void Star::del_hydro_euler | ( | ) | [protected, virtual] |
Sets to ETATNONDEF
(undefined state) the hydrodynamical quantities relative to the Eulerian observer.
Reimplemented in Star_bin, Star_bin_xcts, Star_rot, and Star_rot_Dirac.
Definition at line 326 of file star.C.
References del_deriv(), ener_euler, gam_euler, s_euler, Tensor::set_etat_nondef(), Scalar::set_etat_nondef(), stress_euler, and u_euler.
void Star::equation_of_state | ( | ) |
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
Reimplemented in Gravastar.
Definition at line 458 of file star.C.
References Param::add_int(), Scalar::allocate_all(), del_deriv(), ener, Eos::ener_ent(), ent, eos, Mg3d::get_grille3d(), Map::get_mg(), Mg3d::get_np(), Mg3d::get_nr(), Mg3d::get_nt(), Mg3d::get_nzone(), mp, nbar, Eos::nbar_ent(), nzet, press, Eos::press_ent(), Mtbl::set(), Scalar::set_domain(), Scalar::set_etat_qcq(), Tbl::set_etat_qcq(), Mtbl::set_etat_qcq(), Scalar::std_spectral_base(), Mtbl::t, and Grille3d::x.
void Star::equilibrium_spher | ( | double | ent_c, | |
double | precis = 1.e-14 , |
|||
const Tbl * | pent_limit = 0x0 | |||
) | [virtual] |
Computes a spherical static configuration.
ent_c | [input] central value of the enthalpy | |
precis | [input] threshold in the relative difference between the enthalpy fields of two consecutive steps to stop the iterative procedure (default value: 1.e-14) | |
ent_limit | [input] : array of enthalpy values to be set at the boundaries between the domains; if set to 0x0 (default), the initial values will be kept. |
Definition at line 91 of file star_equil_spher.C.
References Map_et::adapt(), Param::add_double(), Param::add_int(), Param::add_int_mod(), Param::add_tbl(), Scalar::annule(), diffrel(), Scalar::dsdr(), Map_af::dsdr(), ener, ener_euler, ent, equation_of_state(), exp(), gam_euler, gamma, Map_et::get_alpha(), Map_af::get_alpha(), Map_et::get_beta(), Map_af::get_beta(), Map::get_bvect_cart(), Map::get_mg(), Mg3d::get_nr(), Mg3d::get_nt(), Mg3d::get_nzone(), Map_af::homothetie(), Scalar::integrale(), logn, mass_b(), mass_g(), mp, nn, norme(), nzet, Map_af::poisson(), press, s_euler, Vector::set(), Map_af::set_alpha(), Map_af::set_beta(), Scalar::set_dzpuis(), Cmp::set_etat_qcq(), Scalar::set_etat_zero(), sqrt(), Scalar::std_spectral_base(), u_euler, Scalar::val_grid_point(), and Map::val_r().
const Vector& Star::get_beta | ( | ) | const [inline] |
const Scalar& Star::get_ener | ( | ) | const [inline] |
const Scalar& Star::get_ener_euler | ( | ) | const [inline] |
Returns the total energy density with respect to the Eulerian observer.
Definition at line 372 of file star.h.
References ener_euler.
const Scalar& Star::get_ent | ( | ) | const [inline] |
const Eos& Star::get_eos | ( | ) | const [inline] |
const Scalar& Star::get_gam_euler | ( | ) | const [inline] |
const Metric& Star::get_gamma | ( | ) | const [inline] |
const Scalar& Star::get_logn | ( | ) | const [inline] |
const Map& Star::get_mp | ( | ) | const [inline] |
const Scalar& Star::get_nbar | ( | ) | const [inline] |
const Scalar& Star::get_nn | ( | ) | const [inline] |
int Star::get_nzet | ( | ) | const [inline] |
const Scalar& Star::get_press | ( | ) | const [inline] |
const Scalar& Star::get_s_euler | ( | ) | const [inline] |
const Tensor& Star::get_stress_euler | ( | ) | const [inline] |
Returns the spatial part of the stress-energy tensor with respect to the Eulerian observer.
Definition at line 386 of file star.h.
References stress_euler.
const Vector& Star::get_u_euler | ( | ) | const [inline] |
void Star::hydro_euler | ( | ) | [virtual] |
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid frame (nbar
, ener
and press
).
Reimplemented in Star_bin, Star_bin_xcts, Star_rot, Star_rot_Dirac, and Star_rot_Dirac_diff.
const Itbl & Star::l_surf | ( | ) | const [virtual] |
Description of the stellar surface: returns a 2-D Itbl
containing the values of the domain index l on the surface at the collocation points in .
The stellar surface is defined as the location where the enthalpy (member ent
) vanishes.
Reimplemented in Star_rot.
Definition at line 59 of file star_global.C.
References ent, Map::get_mg(), Mg3d::get_np(), Mg3d::get_nt(), Scalar::get_spectral_va(), mp, nzet, p_l_surf, and p_xi_surf.
double Star::mass_b | ( | ) | const [pure virtual] |
Baryon mass.
Implemented in Star_bin, Star_bin_xcts, Star_bhns, Star_rot, and Star_rot_Dirac.
Definition at line 303 of file star_global.C.
References p_mass_b.
double Star::mass_g | ( | ) | const [pure virtual] |
Gravitational mass.
Implemented in Star_bin, Star_bin_xcts, Star_bhns, Star_rot, and Star_rot_Dirac.
Definition at line 323 of file star_global.C.
References p_mass_g.
void Star::operator= | ( | const Star & | et | ) |
Assignment to another Star
.
Reimplemented in Gravastar, Star_bin, Star_bin_xcts, Star_bhns, Star_rot, Star_rot_Dirac, and Star_rot_Dirac_diff.
Definition at line 347 of file star.C.
References beta, del_deriv(), ener, ener_euler, ent, eos, gam_euler, gamma, logn, mp, nbar, nn, nzet, press, s_euler, stress_euler, and u_euler.
ostream & Star::operator>> | ( | ostream & | ost | ) | const [protected, virtual] |
Operator >> (virtual function called by the operator <<).
Reimplemented in Gravastar, Star_bin, Star_bin_xcts, Star_bhns, Star_rot, Star_rot_Dirac, and Star_rot_Dirac_diff.
Definition at line 413 of file star.C.
References ener, ent, eos, mass_b(), mass_g(), nbar, nn, nzet, press, ray_eq(), ray_eq_pi(), ray_eq_pis2(), ray_pole(), and Scalar::val_grid_point().
double Star::ray_eq | ( | ) | const |
Coordinate radius at , [r_unit].
Definition at line 104 of file star_global.C.
References Map::get_mg(), Mg3d::get_nt(), Mg3d::get_type_p(), Mg3d::get_type_t(), l_surf(), mp, p_ray_eq, Map::val_r(), and xi_surf().
double Star::ray_eq_3pis2 | ( | ) | const |
Coordinate radius at , [r_unit].
Definition at line 229 of file star_global.C.
References Map::get_mg(), Mg3d::get_np(), Mg3d::get_nt(), Mg3d::get_type_p(), Mg3d::get_type_t(), l_surf(), mp, p_ray_eq_3pis2, ray_eq_pis2(), Map::val_r(), and xi_surf().
double Star::ray_eq_pi | ( | ) | const |
Coordinate radius at , [r_unit].
Definition at line 182 of file star_global.C.
References Map::get_mg(), Mg3d::get_np(), Mg3d::get_nt(), Mg3d::get_type_p(), Mg3d::get_type_t(), l_surf(), mp, p_ray_eq_pi, ray_eq(), Map::val_r(), and xi_surf().
double Star::ray_eq_pis2 | ( | ) | const |
Coordinate radius at , [r_unit].
Definition at line 134 of file star_global.C.
References Map::get_mg(), Mg3d::get_np(), Mg3d::get_nt(), Mg3d::get_type_p(), Mg3d::get_type_t(), l_surf(), mp, p_ray_eq_pis2, Map::val_r(), and xi_surf().
double Star::ray_pole | ( | ) | const |
Coordinate radius at [r_unit].
Definition at line 274 of file star_global.C.
References Map::get_mg(), Mg3d::get_type_t(), l_surf(), mp, p_ray_pole, Map::val_r(), and xi_surf().
void Star::sauve | ( | FILE * | fich | ) | const [virtual] |
Save in a file.
Reimplemented in Star_bin, Star_bin_xcts, Star_bhns, Star_rot, Star_rot_Dirac, and Star_rot_Dirac_diff.
Definition at line 393 of file star.C.
References ent, eos, fwrite_be(), logn, nzet, Eos::sauve(), and Scalar::sauve().
void Star::set_der_0x0 | ( | ) | const [protected, virtual] |
Sets to 0x0
all the pointers on derived quantities.
Reimplemented in Star_bin, Star_bin_xcts, Star_bhns, Star_rot, and Star_rot_Dirac.
Definition at line 312 of file star.C.
References p_l_surf, p_mass_b, p_mass_g, p_ray_eq, p_ray_eq_3pis2, p_ray_eq_pi, p_ray_eq_pis2, p_ray_pole, and p_xi_surf.
void Star::set_enthalpy | ( | const Scalar & | ent_i | ) |
Assignment of the enthalpy field.
Definition at line 375 of file star.C.
References del_deriv(), ent, and equation_of_state().
Map& Star::set_mp | ( | ) | [inline] |
const Tbl & Star::xi_surf | ( | ) | const |
Description of the stellar surface: returns a 2-D Tbl
containing the values of the radial coordinate on the surface at the collocation points in .
The stellar surface is defined as the location where the enthalpy (member ent
) vanishes.
Definition at line 85 of file star_global.C.
ostream& operator<< | ( | ostream & | , | |
const Star & | ||||
) | [friend] |
Display.
Vector Star::beta [protected] |
Scalar Star::ener [protected] |
Scalar Star::ener_euler [protected] |
Scalar Star::gam_euler [protected] |
Metric Star::gamma [protected] |
Scalar Star::logn [protected] |
Scalar Star::nbar [protected] |
int Star::nzet [protected] |
Itbl* Star::p_l_surf [mutable, protected] |
double* Star::p_mass_b [mutable, protected] |
double* Star::p_mass_g [mutable, protected] |
double* Star::p_ray_eq [mutable, protected] |
double* Star::p_ray_eq_3pis2 [mutable, protected] |
double* Star::p_ray_eq_pi [mutable, protected] |
double* Star::p_ray_eq_pis2 [mutable, protected] |
double* Star::p_ray_pole [mutable, protected] |
Tbl* Star::p_xi_surf [mutable, protected] |
Scalar Star::press [protected] |
Scalar Star::s_euler [protected] |
Sym_tensor Star::stress_euler [protected] |
Vector Star::u_euler [protected] |