136 #include "utilitaires.h" 147 :
Etoile(mpi, nzet_i, relat, eos_i),
158 w_shift(mpi, 1, CON, mp.get_bvect_cart()),
160 tkij(mpi, 2, COV, mp.get_bvect_cart()),
167 ssjm1_wshift(mpi, 1, CON, mp.get_bvect_cart())
186 for (
int i=0; i<3; i++) {
204 for (
int i=0; i<3; i++) {
229 khi_shift(et.khi_shift),
232 ssjm1_nuf(et.ssjm1_nuf),
233 ssjm1_nuq(et.ssjm1_nuq),
234 ssjm1_dzeta(et.ssjm1_dzeta),
235 ssjm1_tggg(et.ssjm1_tggg),
236 ssjm1_khi(et.ssjm1_khi),
237 ssjm1_wshift(et.ssjm1_wshift)
249 :
Etoile(mpi, eos_i, fich),
260 w_shift(mpi, 1, CON, mp.get_bvect_cart()),
262 tkij(mpi, 2, COV, mp.get_bvect_cart()),
269 ssjm1_wshift(mpi, 1, CON, mp.get_bvect_cart())
486 if (
omega != __infinity) {
487 ost <<
"Uniformly rotating star" << endl ;
488 ost <<
"-----------------------" << endl ;
490 double freq =
omega / (2.*M_PI) ;
491 ost <<
"Omega : " <<
omega * f_unit
492 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
493 ost <<
"Rotation period : " << 1000. / (freq * f_unit) <<
" ms" 498 ost <<
"Differentially rotating star" << endl ;
499 ost <<
"----------------------------" << endl ;
501 double freq = omega_c / (2.*M_PI) ;
502 ost <<
"Central value of Omega : " << omega_c * f_unit
503 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
504 ost <<
"Central rotation period : " << 1000. / (freq * f_unit) <<
" ms" 510 double nphi_c =
nphi()(0, 0, 0, 0) ;
511 if ( (omega_c==0) && (nphi_c==0) ) {
512 ost <<
"Central N^phi : " << nphi_c << endl ;
515 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c << endl ;
518 ost <<
"Error on the virial identity GRV2 : " << endl ;
519 ost <<
"GRV2 = " <<
grv2() << endl ;
520 ost <<
"Error on the virial identity GRV3 : " << endl ;
521 double xgrv3 =
grv3(&ost) ;
522 ost <<
"GRV3 = " << xgrv3 << endl ;
524 double mom_quad_38si =
mom_quad() * rho_unit * (
pow(r_unit,
double(5.))
526 ost <<
"Quadrupole moment Q : " << mom_quad_38si <<
" 10^38 kg m^2" 528 ost <<
"Q / (M R_circ^2) : " 530 ost <<
"c^4 Q / (G^2 M^3) : " 534 ost <<
"Angular momentum J : " 535 <<
angu_mom()/( qpig / (4* M_PI) * msol*msol) <<
" G M_sol^2 / c" 537 ost <<
"c J / (G M^2) : " 540 if (
omega != __infinity) {
542 double mom_iner_38si = mom_iner * rho_unit * (
pow(r_unit,
double(5.))
544 ost <<
"Moment of inertia: " << mom_iner_38si <<
" 10^38 kg m^2" 548 ost <<
"Ratio T/W : " <<
tsw() << endl ;
549 ost <<
"Circumferential equatorial radius R_circ_eq : " 550 <<
r_circ()/km <<
" km" << endl ;
552 ost <<
"Circumferential meridional radius R_circ_merid : " 554 ost <<
"Flattening r_circ_merid/r_circ_eq : " 556 ost <<
"Surface area : " <<
area()/(km*km) <<
" km^2" << endl ;
557 ost <<
"Mean radius R_mean : " 561 "Skipping polar radius / surface statements due to number of points in phi direction np > 1" 564 ost <<
"Coordinate equatorial radius r_eq : " <<
ray_eq()/km <<
" km" 566 ost <<
"Flattening r_pole/r_eq : " <<
aplat() << endl ;
569 ost <<
"Compaction parameter M_g / R_circ : " << compact << endl ;
571 int lsurf =
nzet - 1;
574 ost <<
"Equatorial value of the velocity U: " 575 <<
uuu()(
nzet-1, 0, nt-1, nr-1) <<
" c" << endl ;
576 ost <<
"Redshift at the equator (forward) : " <<
z_eqf() << endl ;
577 ost <<
"Redshift at the equator (backward): " <<
z_eqb() << endl ;
578 ost <<
"Redshift at the pole : " <<
z_pole() << endl ;
581 ost <<
"Central value of log(N) : " 582 <<
logn()(0, 0, 0, 0) << endl ;
584 ost <<
"Central value of dzeta=log(AN) : " 585 <<
dzeta()(0, 0, 0, 0) << endl ;
587 if ( (omega_c==0) && (nphi_c==0) ) {
588 ost <<
"Central N^phi : " << nphi_c << endl ;
591 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c << endl ;
594 ost <<
" ... w_shift (NB: components in the star Cartesian frame) [c] : " 596 <<
w_shift(0)(0, 0, 0, 0) <<
" " 597 <<
w_shift(1)(0, 0, 0, 0) <<
" " 598 <<
w_shift(2)(0, 0, 0, 0) << endl ;
600 ost <<
"Central value of khi_shift [km c] : " 601 <<
khi_shift()(0, 0, 0, 0) / km << endl ;
603 ost <<
"Central value of B^2 : " <<
b_car()(0,0,0,0) << endl ;
607 "Relative discrepancy in each domain between the metric coef. A^2 and B^2 : " 609 for (
int l=0; l<diff_a_b.get_taille(); l++) {
610 ost << diff_a_b(l) <<
" " ;
617 double r_grav = ggrav *
mass_g() ;
618 double r_isco_appr = 6. * r_grav * ( 1. -
pow(2./3.,1.5) * jdimless ) ;
623 double f_isco_appr = ( 1. + 11. /6. /
sqrt(6.) * jdimless ) / r_grav /
624 (12. * M_PI ) /
sqrt(6.) ;
626 ost << endl <<
"Innermost stable circular orbit (ISCO) : " << endl ;
627 double xr_isco =
r_isco(&ost) ;
628 ost <<
" circumferential radius r_isco = " 629 << xr_isco / km <<
" km" << endl ;
630 ost <<
" (approx. 6M + 1st order in j : " 631 << r_isco_appr / km <<
" km)" << endl ;
632 ost <<
" (approx. 6M : " 633 << 6. * r_grav / km <<
" km)" << endl ;
634 ost <<
" orbital frequency f_isco = " 635 <<
f_isco() * f_unit <<
" Hz" << endl ;
636 ost <<
" (approx. 1st order in j : " 637 << f_isco_appr * f_unit <<
" Hz)" << endl ;
650 double freq = omega_c / (2.*M_PI) ;
651 ost <<
"Central Omega : " << omega_c * f_unit
652 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
653 ost <<
"Rotation period : " << 1000. / (freq * f_unit) <<
" ms" 655 ost << endl <<
"Central enthalpy : " <<
ent()(0,0,0,0) <<
" c^2" << endl ;
656 ost <<
"Central proper baryon density : " <<
nbar()(0,0,0,0)
657 <<
" x 0.1 fm^-3" << endl ;
658 ost <<
"Central proper energy density : " <<
ener()(0,0,0,0)
659 <<
" rho_nuc c^2" << endl ;
660 ost <<
"Central pressure : " <<
press()(0,0,0,0)
661 <<
" rho_nuc c^2" << endl ;
663 ost <<
"Central value of log(N) : " 664 <<
logn()(0, 0, 0, 0) << endl ;
665 ost <<
"Central lapse N : " <<
nnn()(0,0,0,0) << endl ;
666 ost <<
"Central value of dzeta=log(AN) : " 667 <<
dzeta()(0, 0, 0, 0) << endl ;
668 ost <<
"Central value of A^2 : " <<
a_car()(0,0,0,0) << endl ;
669 ost <<
"Central value of B^2 : " <<
b_car()(0,0,0,0) << endl ;
671 double nphi_c =
nphi()(0, 0, 0, 0) ;
672 if ( (omega_c==0) && (nphi_c==0) ) {
673 ost <<
"Central N^phi : " << nphi_c << endl ;
676 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c
681 int lsurf =
nzet - 1;
684 ost <<
"Equatorial value of the velocity U: " 685 <<
uuu()(
nzet-1, 0, nt-1, nr-1) <<
" c" << endl ;
688 <<
"Coordinate equatorial radius r_eq = " 689 <<
ray_eq()/km <<
" km" << endl ;
690 ost <<
"Flattening r_pole/r_eq : " <<
aplat() << endl ;
692 ost <<
"Flattening r_circ_pole/r_circ_eq : " 714 if (p_eos_poly != 0x0) {
716 double kappa = p_eos_poly->
get_kap() ;
717 double gamma = p_eos_poly->
get_gam() ; ;
720 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1) ) ;
723 double r_poly = kap_ns2 /
sqrt(ggrav) ;
726 double t_poly = r_poly ;
729 double m_poly = r_poly / ggrav ;
732 double j_poly = r_poly * r_poly / ggrav ;
735 double rho_poly = 1. / (ggrav * r_poly * r_poly) ;
738 ost << endl <<
"Quantities in polytropic units : " << endl ;
739 ost <<
"==============================" << endl ;
740 ost <<
" ( r_poly = " << r_poly / km <<
" km )" << endl ;
741 ost <<
" n_c : " <<
nbar()(0, 0, 0, 0) / rho_poly << endl ;
742 ost <<
" e_c : " <<
ener()(0, 0, 0, 0) / rho_poly << endl ;
743 ost <<
" Omega_c : " <<
get_omega_c() * t_poly << endl ;
744 ost <<
" P_c : " << 2.*M_PI /
get_omega_c() / t_poly << endl ;
745 ost <<
" M_bar : " <<
mass_b() / m_poly << endl ;
746 ost <<
" M : " <<
mass_g() / m_poly << endl ;
747 ost <<
" J : " <<
angu_mom() / j_poly << endl ;
748 ost <<
" r_eq : " <<
ray_eq() / r_poly << endl ;
749 ost <<
" R_circ : " <<
r_circ() / r_poly << endl ;
780 double lambda = double(1) / double(3) ;
792 for (
int i=0; i<3; i++) {
794 - (lambda/2./(lambda+1)) * (d_khi(i) + x_d_w(i)) ;
double * p_z_eqb
Backward redshift factor at equator.
virtual double z_eqf() const
Forward redshift factor at equator.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
double * p_z_pole
Redshift factor at North pole.
Base class for stars *** DEPRECATED : use class Star instead ***.
virtual double r_circ() const
Circumferential equatorial radius.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
double * p_mom_quad_old
Part of the quadrupole moment.
Tenseur khi_shift
Scalar used in the decomposition of shift , following Shibata's prescription [Prog.
double * p_r_circ
Circumferential equatorial radius.
Cmp ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
double * p_mom_quad_Bo
Part of the quadrupole moment.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
double * p_r_isco
Circumferential radius of the ISCO.
Tenseur tnphi
Component of the shift vector.
void dec2_dzpuis()
dzpuis -= 2 ;
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
Cmp sqrt(const Cmp &)
Square root.
virtual void display_poly(ostream &) const
Display in polytropic units.
void set_std_base()
Set the standard spectal basis of decomposition for each component.
virtual void sauve(FILE *) const
Save in a file.
void fait_nphi()
Computes tnphi and nphi from the Cartesian components of the shift, stored in shift ...
void operator=(const Etoile &)
Assignment to another Etoile.
Tenseur w_shift
Vector used in the decomposition of shift , following Shibata's prescription [Prog.
Standard units of space, time and mass.
Equation of state base class.
virtual void comp_p_from_cartesian(const Scalar &v_x, const Scalar &v_y, Scalar &v_p) const =0
Computes the Spherical component (with respect to bvect_spher ) of a vector given by its cartesian c...
Tenseur ssjm1_wshift
Effective source at the previous step for the resolution of the vector Poisson equation for ...
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Tenseur nnn
Total lapse function.
double * p_z_eqf
Forward redshift factor at equator.
Tenseur nphi
Metric coefficient .
double ray_eq() const
Coordinate radius at , [r_unit].
Base class for coordinate mappings.
Class for isolated rotating stars *** DEPRECATED : use class Star_rot instead ***.
double * p_mom_quad
Quadrupole moment.
Tenseur b_car
Square of the metric factor B.
void operator=(const Etoile_rot &)
Assignment to another Etoile_rot.
virtual double r_isco(ostream *ost=0x0) const
Circumferential radius of the innermost stable circular orbit (ISCO).
Tenseur press
Fluid pressure.
Etoile_rot(Map &mp_i, int nzet_i, bool relat, const Eos &eos_i)
Standard constructor.
virtual double mean_radius() const
Mean radius.
Tenseur shift
Total shift vector.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
double * p_aplat
Flatening r_pole/r_eq.
double get_gam() const
Returns the adiabatic index (cf. Eq. (3))
virtual void del_deriv() const
Deletes all the derived quantities.
virtual double r_circ_merid() const
Circumferential meridional radius.
virtual void del_deriv() const
Deletes all the derived quantities.
virtual double get_omega_c() const
Returns the central value of the rotation angular velocity ([f_unit] )
Cmp ssjm1_dzeta
Effective source at the previous step for the resolution of the Poisson equation for dzeta ...
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Cmp ssjm1_nuq
Effective source at the previous step for the resolution of the Poisson equation for nuq by means of ...
double * p_r_circ_merid
Circumferential meridional radius.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
virtual ~Etoile_rot()
Destructor.
double * p_grv3
Error on the virial identity GRV3.
virtual double angu_mom() const
Angular momentum.
void sauve(FILE *) const
Save in a file.
Tenseur skxk(const Tenseur &)
Contraction of the last index of (*this) with or , depending on the type of S .
double get_kap() const
Returns the pressure coefficient (cf.
virtual double z_pole() const
Redshift factor at North pole.
Tenseur nbar
Baryon density in the fluid frame.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
virtual double grv3(ostream *ost=0x0) const
Error on the virial identity GRV3.
virtual void sauve(FILE *) const
Save in a file.
virtual double grv2() const
Error on the virial identity GRV2.
virtual double mass_b() const
Baryon mass.
double * p_area
Surface area.
Polytropic equation of state (relativistic case).
Map & mp
Mapping associated with the star.
const Eos & eos
Equation of state of the stellar matter.
virtual double z_eqb() const
Backward redshift factor at equator.
Cmp ssjm1_nuf
Effective source at the previous step for the resolution of the Poisson equation for nuf by means of ...
int get_etat() const
Returns the logical state.
double * p_f_isco
Orbital frequency of the ISCO.
virtual double tsw() const
Ratio T/W.
Tenseur bbb
Metric factor B.
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
Cmp pow(const Cmp &, int)
Power .
Tenseur uuu
Norm of u_euler.
Tenseur tggg
Metric potential .
double omega
Rotation angular velocity ([f_unit] )
virtual void partial_display(ostream &) const
Printing of some informations, excluding all global quantities.
Tenseur nuf
Part of the Metric potential = logn generated by the matter terms.
int nzet
Number of domains of *mp occupied by the star.
virtual double mom_quad() const
Quadrupole moment.
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Tenseur a_car
Total conformal factor .
void fait_shift()
Computes shift from w_shift and khi_shift according to Shibata's prescription [Prog.
Tenseur ener
Total energy density in the fluid frame.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
void dec_dzpuis()
dzpuis -= 1 ;
Tenseur ent
Log-enthalpy (relativistic case) or specific enthalpy (Newtonian case)
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
virtual double area() const
Surface area.
Tenseur & logn
Metric potential = logn_auto.
double * p_lspec_isco
Specific angular momentum of a particle on the ISCO.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
virtual double mass_g() const
Gravitational mass.
double * p_grv2
Error on the virial identity GRV2.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void sauve(FILE *) const
Save in a file.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
Tenseur nuq
Part of the Metric potential = logn generated by the quadratic terms.
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
virtual double f_isco() const
Orbital frequency at the innermost stable circular orbit (ISCO).
Tenseur & dzeta
Metric potential = beta_auto.
Cmp ssjm1_tggg
Effective source at the previous step for the resolution of the Poisson equation for tggg ...
Tenseur_sym tkij
Tensor related to the extrinsic curvature tensor by .
Tensor handling *** DEPRECATED : use class Tensor instead ***.
double * p_espec_isco
Specific energy of a particle on the ISCO.
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates)
double * p_angu_mom
Angular momentum.
virtual double aplat() const
Flatening r_pole/r_eq.
double * p_f_eq
Orbital frequency at the equator.