LORENE
Lorene::Star Class Referenceabstract

Base class for stars. More...

#include <star.h>

Inheritance diagram for Lorene::Star:
Lorene::Star_bhns Lorene::Star_bin Lorene::Star_bin_xcts Lorene::Star_rot Lorene::Star_rot_CFC Lorene::Star_rot_Dirac Lorene::Gravastar Lorene::Star_rot_Dirac_diff

Public Member Functions

 Star (Map &mp_i, int nzet_i, const Eos &eos_i)
 Standard constructor. More...
 
 Star (const Star &)
 Copy constructor. More...
 
 Star (Map &mp_i, const Eos &eos_i, FILE *fich)
 Constructor from a file (see sauve(FILE* )). More...
 
virtual ~Star ()
 Destructor. More...
 
void operator= (const Star &)
 Assignment to another Star. More...
 
Mapset_mp ()
 Read/write of the mapping. More...
 
void set_enthalpy (const Scalar &)
 Assignment of the enthalpy field. More...
 
void equation_of_state ()
 Computes the proper baryon and energy density, as well as pressure from the enthalpy. More...
 
virtual void hydro_euler ()
 Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid frame (nbar, ener and press). More...
 
virtual void equilibrium_spher (double ent_c, double precis=1.e-14, const Tbl *pent_limit=0x0)
 Computes a spherical static configuration. More...
 
const Mapget_mp () const
 Returns the mapping. More...
 
int get_nzet () const
 Returns the number of domains occupied by the star. More...
 
const Eosget_eos () const
 Returns the equation of state. More...
 
const Scalarget_ent () const
 Returns the enthalpy field. More...
 
const Scalarget_nbar () const
 Returns the proper baryon density. More...
 
const Scalarget_ener () const
 Returns the proper total energy density. More...
 
const Scalarget_press () const
 Returns the fluid pressure. More...
 
const Scalarget_ener_euler () const
 Returns the total energy density with respect to the Eulerian observer. More...
 
const Scalarget_s_euler () const
 Returns the trace of the stress tensor in the Eulerian frame. More...
 
const Scalarget_gam_euler () const
 Returns the Lorentz factor between the fluid and Eulerian observers. More...
 
const Vectorget_u_euler () const
 Returns the fluid 3-velocity with respect to the Eulerian observer. More...
 
const Tensorget_stress_euler () const
 Returns the spatial part of the stress-energy tensor with respect to the Eulerian observer. More...
 
const Scalarget_logn () const
 Returns the logarithm of the lapse N. More...
 
const Scalarget_nn () const
 Returns the lapse function N. More...
 
const Vectorget_beta () const
 Returns the shift vector $\beta^i$. More...
 
const Scalarget_lnq () const
 
const Metricget_gamma () const
 Returns the 3-metric $\gamma$. More...
 
virtual void sauve (FILE *) const
 Save in a file. More...
 
double ray_eq () const
 Coordinate radius at $\phi=0$, $\theta=\pi/2$ [r_unit]. More...
 
double ray_eq_pis2 () const
 Coordinate radius at $\phi=\pi/2$, $\theta=\pi/2$ [r_unit]. More...
 
double ray_eq_pi () const
 Coordinate radius at $\phi=\pi$, $\theta=\pi/2$ [r_unit]. More...
 
double ray_eq_3pis2 () const
 Coordinate radius at $\phi=3\pi/2$, $\theta=\pi/2$ [r_unit]. More...
 
double ray_pole () const
 Coordinate radius at $\theta=0$ [r_unit]. More...
 
virtual const Itbll_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 $(\theta', \phi')$. More...
 
const Tblxi_surf () const
 Description of the stellar surface: returns a 2-D Tbl containing the values of the radial coordinate $\xi$ on the surface at the collocation points in $(\theta', \phi')$. More...
 
virtual double mass_b () const =0
 Baryon mass. More...
 
virtual double mass_g () const =0
 Gravitational mass. More...
 

Protected Member Functions

virtual void del_deriv () const
 Deletes all the derived quantities. More...
 
virtual void set_der_0x0 () const
 Sets to 0x0 all the pointers on derived quantities. More...
 
virtual void del_hydro_euler ()
 Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer. More...
 
virtual ostream & operator>> (ostream &) const
 Operator >> (virtual function called by the operator <<). More...
 

Protected Attributes

Mapmp
 Mapping associated with the star. More...
 
int nzet
 Number of domains of *mp occupied by the star. More...
 
const Eoseos
 Equation of state of the stellar matter. More...
 
Scalar ent
 Log-enthalpy. More...
 
Scalar nbar
 Baryon density in the fluid frame. More...
 
Scalar ener
 Total energy density in the fluid frame. More...
 
Scalar press
 Fluid pressure. More...
 
Scalar ener_euler
 Total energy density in the Eulerian frame. More...
 
Scalar s_euler
 Trace of the stress scalar in the Eulerian frame. More...
 
Scalar gam_euler
 Lorentz factor between the fluid and Eulerian observers. More...
 
Vector u_euler
 Fluid 3-velocity with respect to the Eulerian observer. More...
 
Sym_tensor stress_euler
 Spatial part of the stress-energy tensor with respect to the Eulerian observer. More...
 
Scalar logn
 Logarithm of the lapse N . More...
 
Scalar nn
 Lapse function N . More...
 
Vector beta
 Shift vector. More...
 
Scalar lnq
 
Metric gamma
 3-metric More...
 
double * p_ray_eq
 Coordinate radius at $\phi=0$, $\theta=\pi/2$. More...
 
double * p_ray_eq_pis2
 Coordinate radius at $\phi=\pi/2$, $\theta=\pi/2$. More...
 
double * p_ray_eq_pi
 Coordinate radius at $\phi=\pi$, $\theta=\pi/2$. More...
 
double * p_ray_eq_3pis2
 Coordinate radius at $\phi=3\pi/2$, $\theta=\pi/2$. More...
 
double * p_ray_pole
 Coordinate radius at $\theta=0$. More...
 
Itblp_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 $(\theta', \phi')$. More...
 
Tblp_xi_surf
 Description of the stellar surface: 2-D Tbl containing the values of the radial coordinate $\xi$ on the surface at the collocation points in $(\theta', \phi')$. More...
 
double * p_mass_b
 Baryon mass. More...
 
double * p_mass_g
 Gravitational mass. More...
 

Friends

ostream & operator<< (ostream &, const Star &)
 Display. More...
 

Detailed Description

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

\[ ds^2 = - N^2 dt^2 + \gamma_{ij} ( dx^i + \beta^i dt ) (dx^j + \beta^j dt ) \]

where $\gamma_{ij}$ 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.

Version
Id
star.h,v 1.32 2014/10/13 08:52:36 j_novak Exp

Definition at line 175 of file star.h.

Constructor & Destructor Documentation

◆ Star() [1/3]

Lorene::Star::Star ( Map mp_i,
int  nzet_i,
const Eos eos_i 
)

Standard constructor.

Parameters
mp_iMapping on which the star will be defined
nzet_iNumber of domains occupied by the star
eos_iEquation of state of the stellar matter

Definition at line 127 of file star.C.

References beta, Lorene::Metric::cov(), ener, ener_euler, ent, Lorene::Map::flat_met_spher(), gam_euler, gamma, logn, mp, nbar, nn, press, s_euler, set_der_0x0(), Lorene::Tensor::set_etat_zero(), Lorene::Scalar::std_spectral_base(), stress_euler, and u_euler.

◆ Star() [2/3]

Lorene::Star::Star ( const Star et)

Copy constructor.

Definition at line 201 of file star.C.

References set_der_0x0().

◆ Star() [3/3]

Lorene::Star::Star ( Map mp_i,
const Eos eos_i,
FILE *  fich 
)

Constructor from a file (see sauve(FILE* )).

Parameters
mp_iMapping on which the star will be defined
eos_iEquation of state of the stellar matter
fichinput file (must have been created by the function sauve)

Definition at line 226 of file star.C.

References beta, ent, eos, Lorene::Eos::eos_from_file(), Lorene::fread_be(), Lorene::Map::get_mg(), mp, nn, nzet, set_der_0x0(), Lorene::Tensor::set_etat_zero(), stress_euler, and u_euler.

◆ ~Star()

Lorene::Star::~Star ( )
virtual

Destructor.

Definition at line 290 of file star.C.

References del_deriv().

Member Function Documentation

◆ del_deriv()

void Lorene::Star::del_deriv ( ) const
protectedvirtual

◆ del_hydro_euler()

void Lorene::Star::del_hydro_euler ( )
protectedvirtual

Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.

Reimplemented in Lorene::Star_bin_xcts, Lorene::Star_bin, Lorene::Star_rot, Lorene::Star_rot_Dirac, and Lorene::Star_rot_CFC.

Definition at line 333 of file star.C.

References del_deriv(), ener_euler, gam_euler, s_euler, Lorene::Scalar::set_etat_nondef(), Lorene::Tensor::set_etat_nondef(), stress_euler, and u_euler.

◆ equation_of_state()

◆ equilibrium_spher()

void Lorene::Star::equilibrium_spher ( double  ent_c,
double  precis = 1.e-14,
const Tbl pent_limit = 0x0 
)
virtual

Computes a spherical static configuration.

Parameters
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 101 of file star_equil_spher.C.

References Lorene::Star_rot::a_car, Lorene::Map_et::adapt(), Lorene::Param::add_double(), Lorene::Param::add_int(), Lorene::Param::add_int_mod(), Lorene::Param::add_tbl(), Lorene::Scalar::annule(), Lorene::Star_rot::b_car, Lorene::Star_rot::bbb, Lorene::diffrel(), Lorene::Scalar::dsdr(), Lorene::Map_af::dsdr(), Lorene::Star_rot::dzeta, ener, ener_euler, ent, equation_of_state(), Lorene::exp(), gam_euler, gamma, Lorene::Map_af::get_alpha(), Lorene::Map_et::get_alpha(), Lorene::Map_af::get_beta(), Lorene::Map_et::get_beta(), Lorene::Map::get_bvect_cart(), Lorene::Map::get_mg(), Lorene::Mg3d::get_nr(), Lorene::Mg3d::get_nt(), Lorene::Mg3d::get_nzone(), Lorene::Map_af::homothetie(), Lorene::Scalar::integrale(), logn, mass_b(), mass_g(), mp, nn, Lorene::norme(), nzet, Lorene::Map_af::poisson(), press, s_euler, Lorene::Vector::set(), Lorene::Map_af::set_alpha(), Lorene::Map_af::set_beta(), Lorene::Scalar::set_dzpuis(), Lorene::Cmp::set_etat_qcq(), Lorene::Tensor::set_etat_zero(), Lorene::sqrt(), Lorene::Scalar::std_spectral_base(), u_euler, Lorene::Scalar::val_grid_point(), and Lorene::Map::val_r().

◆ get_beta()

const Vector& Lorene::Star::get_beta ( ) const
inline

Returns the shift vector $\beta^i$.

Definition at line 402 of file star.h.

References beta.

◆ get_ener()

const Scalar& Lorene::Star::get_ener ( ) const
inline

Returns the proper total energy density.

Definition at line 370 of file star.h.

References ener.

◆ get_ener_euler()

const Scalar& Lorene::Star::get_ener_euler ( ) const
inline

Returns the total energy density with respect to the Eulerian observer.

Definition at line 376 of file star.h.

References ener_euler.

◆ get_ent()

const Scalar& Lorene::Star::get_ent ( ) const
inline

Returns the enthalpy field.

Definition at line 364 of file star.h.

References ent.

◆ get_eos()

const Eos& Lorene::Star::get_eos ( ) const
inline

Returns the equation of state.

Definition at line 361 of file star.h.

References eos.

◆ get_gam_euler()

const Scalar& Lorene::Star::get_gam_euler ( ) const
inline

Returns the Lorentz factor between the fluid and Eulerian observers.

Definition at line 382 of file star.h.

References gam_euler.

◆ get_gamma()

const Metric& Lorene::Star::get_gamma ( ) const
inline

Returns the 3-metric $\gamma$.

Definition at line 409 of file star.h.

References gamma.

◆ get_logn()

const Scalar& Lorene::Star::get_logn ( ) const
inline

Returns the logarithm of the lapse N.

In the Newtonian case, this is the Newtonian gravitational potential (in units of $c^2$).

Definition at line 396 of file star.h.

References logn.

◆ get_mp()

const Map& Lorene::Star::get_mp ( ) const
inline

Returns the mapping.

Definition at line 355 of file star.h.

References mp.

◆ get_nbar()

const Scalar& Lorene::Star::get_nbar ( ) const
inline

Returns the proper baryon density.

Definition at line 367 of file star.h.

References nbar.

◆ get_nn()

const Scalar& Lorene::Star::get_nn ( ) const
inline

Returns the lapse function N.

Definition at line 399 of file star.h.

References nn.

◆ get_nzet()

int Lorene::Star::get_nzet ( ) const
inline

Returns the number of domains occupied by the star.

Definition at line 358 of file star.h.

References nzet.

◆ get_press()

const Scalar& Lorene::Star::get_press ( ) const
inline

Returns the fluid pressure.

Definition at line 373 of file star.h.

References press.

◆ get_s_euler()

const Scalar& Lorene::Star::get_s_euler ( ) const
inline

Returns the trace of the stress tensor in the Eulerian frame.

Definition at line 379 of file star.h.

References s_euler.

◆ get_stress_euler()

const Tensor& Lorene::Star::get_stress_euler ( ) const
inline

Returns the spatial part of the stress-energy tensor with respect to the Eulerian observer.

Definition at line 390 of file star.h.

References stress_euler.

◆ get_u_euler()

const Vector& Lorene::Star::get_u_euler ( ) const
inline

Returns the fluid 3-velocity with respect to the Eulerian observer.

Definition at line 385 of file star.h.

References u_euler.

◆ hydro_euler()

void Lorene::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 Lorene::Star_bin_xcts, Lorene::Star_bin, Lorene::Star_rot, Lorene::Star_rot_Dirac, Lorene::Star_rot_CFC, and Lorene::Star_rot_Dirac_diff.

Definition at line 580 of file star.C.

◆ l_surf()

const Itbl & Lorene::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 $(\theta', \phi')$.

The stellar surface is defined as the location where the enthalpy (member ent) vanishes.

Reimplemented in Lorene::Star_rot.

Definition at line 66 of file star_global.C.

References ent, Lorene::Map::get_mg(), Lorene::Mg3d::get_np(), Lorene::Mg3d::get_nt(), Lorene::Scalar::get_spectral_va(), mp, nzet, p_l_surf, and p_xi_surf.

◆ mass_b()

double Lorene::Star::mass_b ( ) const
pure virtual

◆ mass_g()

double Lorene::Star::mass_g ( ) const
pure virtual

Gravitational mass.

Implemented in Lorene::Star_bin_xcts, Lorene::Star_bin, Lorene::Star_rot, Lorene::Star_bhns, Lorene::Star_rot_Dirac, and Lorene::Star_rot_CFC.

Definition at line 330 of file star_global.C.

References p_mass_g.

◆ operator=()

void Lorene::Star::operator= ( const Star et)

Assignment to another Star.

Definition at line 354 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.

◆ operator>>()

ostream & Lorene::Star::operator>> ( ostream &  ost) const
protectedvirtual

◆ ray_eq()

double Lorene::Star::ray_eq ( ) const

Coordinate radius at $\phi=0$, $\theta=\pi/2$ [r_unit].

Definition at line 111 of file star_global.C.

References Lorene::Map::get_mg(), Lorene::Mg3d::get_nt(), Lorene::Mg3d::get_type_p(), Lorene::Mg3d::get_type_t(), mp, and p_ray_eq.

◆ ray_eq_3pis2()

double Lorene::Star::ray_eq_3pis2 ( ) const

◆ ray_eq_pi()

double Lorene::Star::ray_eq_pi ( ) const

◆ ray_eq_pis2()

double Lorene::Star::ray_eq_pis2 ( ) const

◆ ray_pole()

double Lorene::Star::ray_pole ( ) const

Coordinate radius at $\theta=0$ [r_unit].

Definition at line 281 of file star_global.C.

References Lorene::Map::get_mg(), Lorene::Mg3d::get_type_t(), mp, and p_ray_pole.

◆ sauve()

void Lorene::Star::sauve ( FILE *  fich) const
virtual

◆ set_der_0x0()

void Lorene::Star::set_der_0x0 ( ) const
protectedvirtual

Sets to 0x0 all the pointers on derived quantities.

Reimplemented in Lorene::Star_bin_xcts, Lorene::Star_bin, Lorene::Star_rot, Lorene::Star_bhns, Lorene::Star_rot_Dirac, and Lorene::Star_rot_CFC.

Definition at line 319 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.

◆ set_enthalpy()

void Lorene::Star::set_enthalpy ( const Scalar ent_i)

Assignment of the enthalpy field.

Definition at line 382 of file star.C.

References del_deriv(), ent, and equation_of_state().

◆ set_mp()

Map& Lorene::Star::set_mp ( )
inline

Read/write of the mapping.

Definition at line 322 of file star.h.

References mp.

◆ xi_surf()

const Tbl & Lorene::Star::xi_surf ( ) const

Description of the stellar surface: returns a 2-D Tbl containing the values of the radial coordinate $\xi$ on the surface at the collocation points in $(\theta', \phi')$.

The stellar surface is defined as the location where the enthalpy (member ent) vanishes.

Definition at line 92 of file star_global.C.

References l_surf(), p_l_surf, and p_xi_surf.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  ost,
const Star et 
)
friend

Display.

Definition at line 415 of file star.C.

Member Data Documentation

◆ beta

Vector Lorene::Star::beta
protected

Shift vector.

Definition at line 228 of file star.h.

◆ ener

Scalar Lorene::Star::ener
protected

Total energy density in the fluid frame.

Definition at line 193 of file star.h.

◆ ener_euler

Scalar Lorene::Star::ener_euler
protected

Total energy density in the Eulerian frame.

Definition at line 198 of file star.h.

◆ ent

Scalar Lorene::Star::ent
protected

Log-enthalpy.

Definition at line 190 of file star.h.

◆ eos

const Eos& Lorene::Star::eos
protected

Equation of state of the stellar matter.

Definition at line 185 of file star.h.

◆ gam_euler

Scalar Lorene::Star::gam_euler
protected

Lorentz factor between the fluid and Eulerian observers.

Definition at line 204 of file star.h.

◆ gamma

Metric Lorene::Star::gamma
protected

3-metric

Definition at line 235 of file star.h.

◆ logn

Scalar Lorene::Star::logn
protected

Logarithm of the lapse N .

In the Newtonian case, this is the Newtonian gravitational potential (in units of $c^2$).

Definition at line 222 of file star.h.

◆ mp

Map& Lorene::Star::mp
protected

Mapping associated with the star.

Definition at line 180 of file star.h.

◆ nbar

Scalar Lorene::Star::nbar
protected

Baryon density in the fluid frame.

Definition at line 192 of file star.h.

◆ nn

Scalar Lorene::Star::nn
protected

Lapse function N .

Definition at line 225 of file star.h.

◆ nzet

int Lorene::Star::nzet
protected

Number of domains of *mp occupied by the star.

Definition at line 183 of file star.h.

◆ p_l_surf

Itbl* Lorene::Star::p_l_surf
mutableprotected

Description of the stellar surface: 2-D Itbl containing the values of the domain index l on the surface at the collocation points in $(\theta', \phi')$.

Definition at line 260 of file star.h.

◆ p_mass_b

double* Lorene::Star::p_mass_b
mutableprotected

Baryon mass.

Definition at line 268 of file star.h.

◆ p_mass_g

double* Lorene::Star::p_mass_g
mutableprotected

Gravitational mass.

Definition at line 269 of file star.h.

◆ p_ray_eq

double* Lorene::Star::p_ray_eq
mutableprotected

Coordinate radius at $\phi=0$, $\theta=\pi/2$.

Definition at line 242 of file star.h.

◆ p_ray_eq_3pis2

double* Lorene::Star::p_ray_eq_3pis2
mutableprotected

Coordinate radius at $\phi=3\pi/2$, $\theta=\pi/2$.

Definition at line 251 of file star.h.

◆ p_ray_eq_pi

double* Lorene::Star::p_ray_eq_pi
mutableprotected

Coordinate radius at $\phi=\pi$, $\theta=\pi/2$.

Definition at line 248 of file star.h.

◆ p_ray_eq_pis2

double* Lorene::Star::p_ray_eq_pis2
mutableprotected

Coordinate radius at $\phi=\pi/2$, $\theta=\pi/2$.

Definition at line 245 of file star.h.

◆ p_ray_pole

double* Lorene::Star::p_ray_pole
mutableprotected

Coordinate radius at $\theta=0$.

Definition at line 254 of file star.h.

◆ p_xi_surf

Tbl* Lorene::Star::p_xi_surf
mutableprotected

Description of the stellar surface: 2-D Tbl containing the values of the radial coordinate $\xi$ on the surface at the collocation points in $(\theta', \phi')$.

Definition at line 266 of file star.h.

◆ press

Scalar Lorene::Star::press
protected

Fluid pressure.

Definition at line 194 of file star.h.

◆ s_euler

Scalar Lorene::Star::s_euler
protected

Trace of the stress scalar in the Eulerian frame.

Definition at line 201 of file star.h.

◆ stress_euler

Sym_tensor Lorene::Star::stress_euler
protected

Spatial part of the stress-energy tensor with respect to the Eulerian observer.

Definition at line 212 of file star.h.

◆ u_euler

Vector Lorene::Star::u_euler
protected

Fluid 3-velocity with respect to the Eulerian observer.

Definition at line 207 of file star.h.


The documentation for this class was generated from the following files: