136#include "utilitaires.h"
147 :
Etoile(mpi, nzet_i, relat, eos_i),
178 b_car.set_std_base() ;
186 for (
int i=0; i<3; i++) {
193 tkij.set_etat_zero() ;
204 for (
int i=0; i<3; i++) {
249 :
Etoile(mpi, eos_i, fich),
291 Tenseur w_shift_file(
mp,
mp.get_bvect_cart(), fich) ;
300 Cmp ssjm1_nuf_file(
mp, *(
mp.get_mg()), fich) ;
303 Cmp ssjm1_nuq_file(
mp, *(
mp.get_mg()), fich) ;
306 Cmp ssjm1_dzeta_file(
mp, *(
mp.get_mg()), fich) ;
309 Cmp ssjm1_tggg_file(
mp, *(
mp.get_mg()), fich) ;
312 Cmp ssjm1_khi_file(
mp, *(
mp.get_mg()), fich) ;
315 Tenseur ssjm1_wshift_file(
mp,
mp.get_bvect_cart(), fich) ;
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 ;
551 if (
mp.get_mg()->get_np(0) == 1) {
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;
572 int nt =
mp.get_mg()->get_nt(lsurf) ;
573 int nr =
mp.get_mg()->get_nr(lsurf) ;
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;
682 int nt =
mp.get_mg()->get_nt(lsurf) ;
683 int nr =
mp.get_mg()->get_nr(lsurf) ;
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 ;
691 if (
mp.get_mg()->get_np(0) == 1)
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) ;
782 if (
mp.get_mg()->get_np(0) == 1 ) {
790 shift.set_etat_qcq() ;
792 for (
int i=0; i<3; i++) {
794 - (lambda/2./(lambda+1)) * (d_khi(i) + x_d_w(i)) ;
805 if (
shift.get_etat() == ETATZERO ) {
811 assert(
shift.get_etat() == ETATQCQ ) ;
815 tnphi.set_etat_qcq() ;
823 (
nphi.set()).div_rsint() ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Polytropic equation of state (relativistic case).
double get_gam() const
Returns the adiabatic index (cf. Eq. (3)).
double get_kap() const
Returns the pressure coefficient (cf.
Equation of state base class.
Tenseur ssjm1_wshift
Effective source at the previous step for the resolution of the vector Poisson equation for .
double * p_r_circ_merid
Circumferential meridional radius.
Tenseur uuu
Norm of u_euler.
virtual void del_deriv() const
Deletes all the derived quantities.
double omega
Rotation angular velocity ([f_unit] ).
double * p_z_pole
Redshift factor at North pole.
virtual double mom_quad() const
Quadrupole moment.
double * p_z_eqf
Forward redshift factor at equator.
void operator=(const Etoile_rot &)
Assignment to another Etoile_rot.
virtual double r_circ() const
Circumferential equatorial radius.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Tenseur & logn
Metric potential = logn_auto.
double * p_mom_quad_old
Part of the quadrupole moment.
Cmp ssjm1_dzeta
Effective source at the previous step for the resolution of the Poisson equation for dzeta .
Tenseur nuq
Part of the Metric potential = logn generated by the quadratic terms.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
double * p_z_eqb
Backward redshift factor at equator.
virtual double mass_g() const
Gravitational mass.
virtual double f_isco() const
Orbital frequency at the innermost stable circular orbit (ISCO).
double * p_r_circ
Circumferential equatorial radius.
Tenseur khi_shift
Scalar used in the decomposition of shift , following Shibata's prescription [Prog.
virtual double aplat() const
Flatening r_pole/r_eq.
virtual double grv3(ostream *ost=0x0) const
Error on the virial identity GRV3.
Etoile_rot(Map &mp_i, int nzet_i, bool relat, const Eos &eos_i)
Standard constructor.
virtual double tsw() const
Ratio T/W.
Tenseur tggg
Metric potential .
Tenseur nuf
Part of the Metric potential = logn generated by the matter terms.
Cmp ssjm1_tggg
Effective source at the previous step for the resolution of the Poisson equation for tggg .
Tenseur nphi
Metric coefficient .
virtual double mass_b() const
Baryon mass.
virtual double r_isco(ostream *ost=0x0) const
Circumferential radius of the innermost stable circular orbit (ISCO).
Tenseur bbb
Metric factor B.
double * p_area
Surface area.
virtual ~Etoile_rot()
Destructor.
Tenseur & dzeta
Metric potential = beta_auto.
virtual double mean_radius() const
Mean radius.
double * p_grv3
Error on the virial identity GRV3.
double * p_grv2
Error on the virial identity GRV2.
double * p_aplat
Flatening r_pole/r_eq.
Cmp ssjm1_nuf
Effective source at the previous step for the resolution of the Poisson equation for nuf by means of ...
double * p_mom_quad_Bo
Part of the quadrupole moment.
virtual double grv2() const
Error on the virial identity GRV2.
void fait_nphi()
Computes tnphi and nphi from the Cartesian components of the shift, stored in shift .
virtual double r_circ_merid() const
Circumferential meridional radius.
double * p_mom_quad
Quadrupole moment.
double * p_f_eq
Orbital frequency at the equator.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
virtual double area() const
Surface area.
double * p_angu_mom
Angular momentum.
Cmp ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
virtual double angu_mom() const
Angular momentum.
Tenseur_sym tkij
Tensor related to the extrinsic curvature tensor by .
virtual double z_eqf() const
Forward redshift factor at equator.
virtual void display_poly(ostream &) const
Display in polytropic units.
double * p_f_isco
Orbital frequency of the ISCO.
double * p_lspec_isco
Specific angular momentum of a particle on the ISCO.
Tenseur b_car
Square of the metric factor B.
virtual double z_eqb() const
Backward redshift factor at equator.
Tenseur tnphi
Component of the shift vector.
double * p_espec_isco
Specific energy of a particle on the ISCO.
double * p_r_isco
Circumferential radius of the ISCO.
virtual void sauve(FILE *) const
Save in a file.
virtual double get_omega_c() const
Returns the central value of the rotation angular velocity ([f_unit] ).
Cmp ssjm1_nuq
Effective source at the previous step for the resolution of the Poisson equation for nuq by means of ...
virtual double z_pole() const
Redshift factor at North pole.
Tenseur w_shift
Vector used in the decomposition of shift , following Shibata's prescription [Prog.
virtual void partial_display(ostream &) const
Printing of some informations, excluding all global quantities.
void fait_shift()
Computes shift from w_shift and khi_shift according to Shibata's prescription [Prog.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
int nzet
Number of domains of *mp occupied by the star.
void operator=(const Etoile &)
Assignment to another Etoile.
double ray_eq() const
Coordinate radius at , [r_unit].
Tenseur nnn
Total lapse function.
Tenseur logn_auto
Total of the logarithm of the part of the lapse N generated principaly by the star.
Tenseur nbar
Baryon density in the fluid frame.
const Eos & eos
Equation of state of the stellar matter.
Map & mp
Mapping associated with the star.
virtual void del_deriv() const
Deletes all the derived quantities.
Tenseur ener
Total energy density in the fluid frame.
Etoile(Map &mp_i, int nzet_i, bool relat, const Eos &eos_i)
Standard constructor.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Tenseur press
Fluid pressure.
virtual void sauve(FILE *) const
Save in a file.
Tenseur shift
Total shift vector.
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.
Tenseur beta_auto
Logarithm of the part of the product AN generated principaly by by the star.
Tenseur a_car
Total conformal factor .
Tensor handling *** DEPRECATED : use class Tensor instead ***.
void dec2_dzpuis()
dzpuis -= 2 ;
void dec_dzpuis()
dzpuis -= 1 ;
int get_etat() const
Returns the logical state.
Cmp sqrt(const Cmp &)
Square root.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Cmp pow(const Cmp &, int)
Power .
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 fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
Tenseur skxk(const Tenseur &)
Contraction of the last index of (*this) with or , depending on the type of S .
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Standard units of space, time and mass.