85#include "utilitaires.h"
98 : Star(mpi, nzet_i, eos_i),
132 bbb.std_spectral_base() ;
144 beta.set_etat_zero() ;
145 beta.set_triad(
mp.get_bvect_cart() ) ;
147 tkij.set_etat_zero() ;
201 : Star(mpi, eos_i, fich),
228 size_t nread = fread(&
relativistic,
sizeof(
bool), 1, fich) ;
230 cerr <<
"Star_rot::Star_rot(FILE*): Problem reading the data file." << endl ;
254 Vector w_shift_file(
mp,
mp.get_bvect_cart(), fich) ;
257 Scalar khi_shift_file(
mp, *(
mp.get_mg()), fich) ;
263 Scalar ssjm1_nuf_file(
mp, *(
mp.get_mg()), fich) ;
266 Scalar ssjm1_nuq_file(
mp, *(
mp.get_mg()), fich) ;
269 Scalar ssjm1_dzeta_file(
mp, *(
mp.get_mg()), fich) ;
272 Scalar ssjm1_tggg_file(
mp, *(
mp.get_mg()), fich) ;
275 Scalar ssjm1_khi_file(
mp, *(
mp.get_mg()), fich) ;
278 Vector ssjm1_wshift_file(
mp,
mp.get_bvect_cart(), fich) ;
287 tkij.set_etat_zero() ;
455 if (
omega != __infinity) {
456 ost <<
"Uniformly rotating star" << endl ;
457 ost <<
"-----------------------" << endl ;
459 double freq =
omega / (2.*M_PI) ;
460 ost <<
"Omega : " <<
omega * f_unit
461 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
462 ost <<
"Rotation period : " << 1000. / (freq * f_unit) <<
" ms"
467 ost <<
"Differentially rotating star" << endl ;
468 ost <<
"----------------------------" << endl ;
470 double freq = omega_c / (2.*M_PI) ;
471 ost <<
"Central value of Omega : " << omega_c * f_unit
472 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
473 ost <<
"Central rotation period : " << 1000. / (freq * f_unit) <<
" ms"
477 ost <<
"Relativistic star" << endl ;
480 ost <<
"Newtonian star" << endl ;
483 ost <<
"Compactness G M_g /(c^2 R_circ) : " << compact << endl ;
485 double nphi_c =
nphi.val_grid_point(0, 0, 0, 0) ;
486 if ( (omega_c==0) && (nphi_c==0) ) {
487 ost <<
"Central N^phi : " << nphi_c << endl ;
490 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c << endl ;
493 ost <<
"Error on the virial identity GRV2 : " <<
grv2() << endl ;
494 double xgrv3 =
grv3(&ost) ;
495 ost <<
"Error on the virial identity GRV3 : " << xgrv3 << endl ;
497 double mom_quad_38si =
mom_quad() * rho_unit * (
pow(r_unit,
double(5.))
499 ost <<
"Quadrupole moment Q : " << mom_quad_38si <<
" 10^38 kg m^2"
501 ost <<
"Q / (M R_circ^2) : "
503 ost <<
"c^4 Q / (G^2 M^3) : "
507 ost <<
"Angular momentum J : "
508 <<
angu_mom()/( qpig / (4* M_PI) * msol*msol) <<
" G M_sol^2 / c"
510 ost <<
"c J / (G M^2) : "
513 if (
omega != __infinity) {
515 double mom_iner_38si = mom_iner * rho_unit * (
pow(r_unit,
double(5.))
517 ost <<
"Moment of inertia: " << mom_iner_38si <<
" 10^38 kg m^2"
521 ost <<
"Ratio T/W : " <<
tsw() << endl ;
522 ost <<
"Circumferential equatorial radius R_circ : "
523 <<
r_circ()/km <<
" km" << endl ;
524 if (
mp.get_mg()->get_np(0) == 1) {
525 ost <<
"Circumferential polar (meridional) radius R_circ_merid : "
527 ost <<
"Flattening R_circ_merid / R_circ_eq : "
529 ost <<
"Surface area : " <<
area()/(km*km) <<
" km^2" << endl ;
530 ost <<
"Mean radius : " <<
mean_radius()/km <<
" km" << endl ;
533 "Skipping polar radius / surface statements due to number of points in phi direction np > 1"
536 ost <<
"Coordinate equatorial radius r_eq : " <<
ray_eq()/km <<
" km"
538 ost <<
"Flattening r_pole/r_eq : " <<
aplat() << endl ;
539 int lsurf =
nzet - 1;
540 int nt =
mp.get_mg()->get_nt(lsurf) ;
541 int nr =
mp.get_mg()->get_nr(lsurf) ;
542 ost <<
"Equatorial value of the velocity U: "
543 <<
uuu.val_grid_point(
nzet-1, 0, nt-1, nr-1) <<
" c" << endl ;
544 ost <<
"Redshift at the equator (forward) : " <<
z_eqf() << endl ;
545 ost <<
"Redshift at the equator (backward): " <<
z_eqb() << endl ;
546 ost <<
"Redshift at the pole : " <<
z_pole() << endl ;
549 ost <<
"Central value of log(N) : "
550 <<
logn.val_grid_point(0, 0, 0, 0) << endl ;
552 ost <<
"Central value of dzeta=log(AN) : "
553 <<
dzeta.val_grid_point(0, 0, 0, 0) << endl ;
555 if ( (omega_c==0) && (nphi_c==0) ) {
556 ost <<
"Central N^phi : " << nphi_c << endl ;
559 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c << endl ;
562 ost <<
" ... w_shift (NB: components in the star Cartesian frame) [c] : "
564 <<
w_shift(1).val_grid_point(0, 0, 0, 0) <<
" "
565 <<
w_shift(2).val_grid_point(0, 0, 0, 0) <<
" "
566 <<
w_shift(3).val_grid_point(0, 0, 0, 0) << endl ;
568 ost <<
"Central value of khi_shift [km c] : "
569 <<
khi_shift.val_grid_point(0, 0, 0, 0) / km << endl ;
571 ost <<
"Central value of B^2 : " <<
b_car.val_grid_point(0,0,0,0) << endl ;
575 "Relative discrepancy in each domain between the metric coef. A^2 and B^2 : "
578 ost << diff_a_b(l) <<
" " ;
585 double r_grav = ggrav *
mass_g() ;
586 double r_isco_appr = 6. * r_grav * ( 1. -
pow(2./3.,1.5) * jdimless ) ;
591 double f_isco_appr = ( 1. + 11. /6. /
sqrt(6.) * jdimless ) / r_grav /
592 (12. * M_PI ) /
sqrt(6.) ;
594 ost << endl <<
"Innermost stable circular orbit (ISCO) : " << endl ;
595 double xr_isco =
r_isco(&ost) ;
596 ost <<
" circumferential radius r_isco = "
597 << xr_isco / km <<
" km" << endl ;
598 ost <<
" (approx. 6M + 1st order in j : "
599 << r_isco_appr / km <<
" km)" << endl ;
600 ost <<
" (approx. 6M : "
601 << 6. * r_grav / km <<
" km)" << endl ;
602 ost <<
" orbital frequency f_isco = "
603 <<
f_isco() * f_unit <<
" Hz" << endl ;
604 ost <<
" (approx. 1st order in j : "
605 << f_isco_appr * f_unit <<
" Hz)" << endl ;
618 double freq = omega_c / (2.*M_PI) ;
619 ost <<
"Central Omega : " << omega_c * f_unit
620 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
621 ost <<
"Rotation period : " << 1000. / (freq * f_unit) <<
" ms"
623 ost << endl <<
"Central enthalpy : " <<
ent.val_grid_point(0,0,0,0) <<
" c^2" << endl ;
624 ost <<
"Central proper baryon density : " <<
nbar.val_grid_point(0,0,0,0)
625 <<
" x 0.1 fm^-3" << endl ;
626 ost <<
"Central proper energy density : " <<
ener.val_grid_point(0,0,0,0)
627 <<
" rho_nuc c^2" << endl ;
628 ost <<
"Central pressure : " <<
press.val_grid_point(0,0,0,0)
629 <<
" rho_nuc c^2" << endl ;
631 ost <<
"Central value of log(N) : "
632 <<
logn.val_grid_point(0, 0, 0, 0) << endl ;
633 ost <<
"Central lapse N : " <<
nn.val_grid_point(0,0,0,0) << endl ;
634 ost <<
"Central value of dzeta=log(AN) : "
635 <<
dzeta.val_grid_point(0, 0, 0, 0) << endl ;
636 ost <<
"Central value of A^2 : " <<
a_car.val_grid_point(0,0,0,0) << endl ;
637 ost <<
"Central value of B^2 : " <<
b_car.val_grid_point(0,0,0,0) << endl ;
639 double nphi_c =
nphi.val_grid_point(0, 0, 0, 0) ;
640 if ( (omega_c==0) && (nphi_c==0) ) {
641 ost <<
"Central N^phi : " << nphi_c << endl ;
644 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c
649 int lsurf =
nzet - 1;
650 int nt =
mp.get_mg()->get_nt(lsurf) ;
651 int nr =
mp.get_mg()->get_nr(lsurf) ;
652 ost <<
"Equatorial value of the velocity U: "
653 <<
uuu.val_grid_point(
nzet-1, 0, nt-1, nr-1) <<
" c" << endl ;
656 <<
"Coordinate equatorial radius r_eq = "
657 <<
ray_eq()/km <<
" km" << endl ;
658 ost <<
"Flattening r_pole/r_eq : " <<
aplat() << endl ;
659 if (
mp.get_mg()->get_np(0) == 1)
660 ost <<
"Flattening r_circ_pole/r_circ_eq : "
681 if (p_eos_poly != 0x0) {
683 double kappa = p_eos_poly->
get_kap() ;
686 double kap_ns2 =
pow( kappa, 0.5 /(p_eos_poly->
get_gam()-1) ) ;
689 double r_poly = kap_ns2 /
sqrt(ggrav) ;
692 double t_poly = r_poly ;
695 double m_poly = r_poly / ggrav ;
698 double j_poly = r_poly * r_poly / ggrav ;
701 double rho_poly = 1. / (ggrav * r_poly * r_poly) ;
704 ost << endl <<
"Quantities in polytropic units : " << endl ;
705 ost <<
"==============================" << endl ;
706 ost <<
" ( r_poly = " << r_poly / km <<
" km )" << endl ;
707 ost <<
" n_c : " <<
nbar.val_grid_point(0, 0, 0, 0) / rho_poly << endl ;
708 ost <<
" e_c : " <<
ener.val_grid_point(0, 0, 0, 0) / rho_poly << endl ;
709 ost <<
" Omega_c : " <<
get_omega_c() * t_poly << endl ;
710 ost <<
" P_c : " << 2.*M_PI /
get_omega_c() / t_poly << endl ;
711 ost <<
" M_bar : " <<
mass_b() / m_poly << endl ;
712 ost <<
" M : " <<
mass_g() / m_poly << endl ;
713 ost <<
" J : " <<
angu_mom() / j_poly << endl ;
714 ost <<
" r_eq : " <<
ray_eq() / r_poly << endl ;
715 ost <<
" R_circ_eq : " <<
r_circ() / r_poly << endl ;
716 ost <<
" R_circ_merid : " <<
r_circ_merid() / r_poly << endl ;
717 ost <<
" R_mean : " <<
mean_radius() / r_poly << endl ;
746 sintcosp =
mp.sint *
mp.cosp ;
747 sintsinp =
mp.sint *
mp.sinp ;
750 int nz =
mp.get_mg()->get_nzone() ;
768 double lambda = double(1) / double(3) ;
770 if (
mp.get_mg()->get_np(0) == 1 ) {
775 + (lambda/2./(lambda+1)) * (d_khi + x_d_w) ;
781 if ( (
beta(1).get_etat() == ETATZERO) && (
beta(2).get_etat() == ETATZERO) ) {
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.
Tensor field of valence 0 (or component of a tensorial field).
Tbl & set_domain(int l)
Read/write of the value in a given domain.
void set_dzpuis(int)
Modifies the dzpuis flag.
const Tbl & domain(int l) const
Read-only of the value in a given domain.
double * p_angu_mom
Angular momentum.
virtual void display_poly(ostream &) const
Display in polytropic units.
virtual double mean_radius() const
Mean star radius from the area .
double * p_r_isco
Circumferential radius of the ISCO.
double * p_aplat
Flatening r_pole/r_eq.
Star_rot(Map &mp_i, int nzet_i, bool relat, const Eos &eos_i)
Standard constructor.
double * p_mom_quad
Quadrupole moment.
Scalar ssjm1_tggg
Effective source at the previous step for the resolution of the Poisson equation for tggg .
Sym_tensor tkij
Tensor related to the extrinsic curvature tensor by .
virtual double mom_quad() const
Quadrupole moment.
double * p_z_eqf
Forward redshift factor at equator.
Scalar tggg
Metric potential .
Scalar tnphi
Component of the shift vector.
void fait_shift()
Computes shift from w_shift and khi_shift according to Shibata's prescription [Prog.
virtual ~Star_rot()
Destructor.
virtual double z_pole() const
Redshift factor at North pole.
virtual double r_isco(ostream *ost=0x0) const
Circumferential radius of the innermost stable circular orbit (ISCO).
virtual double z_eqb() const
Backward redshift factor at equator.
double unsurc2
: unsurc2=1 for a relativistic star, 0 for a Newtonian one.
Vector w_shift
Vector used in the decomposition of shift , following Shibata's prescription [Prog.
Scalar b_car
Square of the metric factor B.
void operator=(const Star_rot &)
Assignment to another Star_rot.
double * p_lspec_isco
Specific angular momentum of a particle on the ISCO.
Scalar bbb
Metric factor B.
virtual double mass_b() const
Baryon mass.
virtual double get_omega_c() const
Returns the central value of the rotation angular velocity ([f_unit] ).
double omega
Rotation angular velocity ([f_unit] ).
virtual double r_circ() const
Circumferential equatorial radius.
Scalar uuu
Norm of u_euler.
virtual double z_eqf() const
Forward redshift factor at equator.
Scalar nphi
Metric coefficient .
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
double * p_f_isco
Orbital frequency of the ISCO.
virtual double f_isco() const
Orbital frequency at the innermost stable circular orbit (ISCO).
virtual double mass_g() const
Gravitational mass.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
virtual void sauve(FILE *) const
Save in a file.
double * p_area
Integrated surface area.
virtual double aplat() const
Flatening r_pole/r_eq.
double * p_grv3
Error on the virial identity GRV3.
Scalar ssjm1_nuq
Effective source at the previous step for the resolution of the Poisson equation for nuq by means of ...
double * p_espec_isco
Specific energy of a particle on the ISCO.
Scalar nuf
Part of the Metric potential = logn generated by the matter terms.
Tbl * p_surf_grav
Surface gravity (along the theta direction).
bool relativistic
Indicator of relativity: true for a relativistic star, false for a Newtonian one.
double * p_f_eq
Orbital frequency at the equator.
Scalar ssjm1_dzeta
Effective source at the previous step for the resolution of the Poisson equation for dzeta .
virtual double tsw() const
Ratio T/W.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
virtual double grv3(ostream *ost=0x0) const
Error on the virial identity GRV3.
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
Scalar dzeta
Metric potential .
virtual double area() const
Integrated surface area in .
Scalar a_car
Square of the metric factor A.
Scalar ssjm1_nuf
Effective source at the previous step for the resolution of the Poisson equation for nuf by means of ...
Scalar nuq
Part of the Metric potential = logn generated by the quadratic terms.
virtual double r_circ_merid() const
Crcumferential meridional radius.
double * p_grv2
Error on the virial identity GRV2.
virtual void del_deriv() const
Deletes all the derived quantities.
Vector ssjm1_wshift
Effective source at the previous step for the resolution of the vector Poisson equation for .
double * p_r_circ
Circumferential radius (equator).
double * p_r_circ_merid
Circumferential radius (meridian).
virtual double grv2() const
Error on the virial identity GRV2.
virtual double angu_mom() const
Angular momentum.
double * p_z_eqb
Backward redshift factor at equator.
virtual void partial_display(ostream &) const
Printing of some informations, excluding all global quantities.
double * p_z_pole
Redshift factor at North pole.
Scalar khi_shift
Scalar used in the decomposition of shift , following Shibata's prescription [Prog.
void fait_nphi()
Computes tnphi and nphi from the Cartesian components of the shift, stored in shift .
Scalar ener
Total energy density in the fluid frame.
Scalar logn
Logarithm of the lapse N .
Scalar nn
Lapse function N .
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
const Eos & eos
Equation of state of the stellar matter.
Scalar nbar
Baryon density in the fluid frame.
virtual void del_deriv() const
Deletes all the derived quantities.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
double ray_eq() const
Coordinate radius at , [r_unit].
virtual void sauve(FILE *) const
Save in a file.
Scalar press
Fluid pressure.
Map & mp
Mapping associated with the star.
void operator=(const Star &)
Assignment to another Star.
int nzet
Number of domains of *mp occupied by the star.
int get_taille() const
Gives the total size (ie dim.taille).
Tensor field of valence 1.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Scalar & set(int)
Read/write access to a component.
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.
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values in the compactified ext...
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
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.