29char etoile_rot_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Etoile/etoile_rot.C,v 1.7 2015/12/03 14:17:24 j_novak Exp $" ;
127#include "utilitaires.h"
138 :
Etoile(mpi, nzet_i, relat, eos_i),
149 w_shift(mpi, 1, CON, mp.get_bvect_cart()),
151 tkij(mpi, 2, COV, mp.get_bvect_cart()),
158 ssjm1_wshift(mpi, 1, CON, mp.get_bvect_cart())
177 for (
int i=0; i<3; i++) {
195 for (
int i=0; i<3; i++) {
220 khi_shift(et.khi_shift),
223 ssjm1_nuf(et.ssjm1_nuf),
224 ssjm1_nuq(et.ssjm1_nuq),
225 ssjm1_dzeta(et.ssjm1_dzeta),
226 ssjm1_tggg(et.ssjm1_tggg),
227 ssjm1_khi(et.ssjm1_khi),
228 ssjm1_wshift(et.ssjm1_wshift)
240 :
Etoile(mpi, eos_i, fich),
251 w_shift(mpi, 1, CON, mp.get_bvect_cart()),
253 tkij(mpi, 2, COV, mp.get_bvect_cart()),
260 ssjm1_wshift(mpi, 1, CON, mp.get_bvect_cart())
475 if (
omega != __infinity) {
476 ost <<
"Uniformly rotating star" << endl ;
477 ost <<
"-----------------------" << endl ;
479 double freq =
omega / (2.*M_PI) ;
480 ost <<
"Omega : " <<
omega * f_unit
481 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
482 ost <<
"Rotation period : " << 1000. / (freq * f_unit) <<
" ms"
487 ost <<
"Differentially rotating star" << endl ;
488 ost <<
"----------------------------" << endl ;
490 double freq = omega_c / (2.*M_PI) ;
491 ost <<
"Central value of Omega : " << omega_c * f_unit
492 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
493 ost <<
"Central rotation period : " << 1000. / (freq * f_unit) <<
" ms"
499 double nphi_c =
nphi()(0, 0, 0, 0) ;
500 if ( (omega_c==0) && (nphi_c==0) ) {
501 ost <<
"Central N^phi : " << nphi_c << endl ;
504 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c << endl ;
507 ost <<
"Error on the virial identity GRV2 : " << endl ;
508 ost <<
"GRV2 = " <<
grv2() << endl ;
509 ost <<
"Error on the virial identity GRV3 : " << endl ;
510 double xgrv3 =
grv3(&ost) ;
511 ost <<
"GRV3 = " << xgrv3 << endl ;
513 double mom_quad_38si =
mom_quad() * rho_unit * (
pow(r_unit,
double(5.))
515 ost <<
"Quadrupole moment Q : " << mom_quad_38si <<
" 10^38 kg m^2"
517 ost <<
"Q / (M R_circ^2) : "
519 ost <<
"c^4 Q / (G^2 M^3) : "
523 ost <<
"Angular momentum J : "
524 <<
angu_mom()/( qpig / (4* M_PI) * msol*msol) <<
" G M_sol^2 / c"
526 ost <<
"c J / (G M^2) : "
529 if (
omega != __infinity) {
531 double mom_iner_38si = mom_iner * rho_unit * (
pow(r_unit,
double(5.))
533 ost <<
"Moment of inertia: " << mom_iner_38si <<
" 10^38 kg m^2"
537 ost <<
"Ratio T/W : " <<
tsw() << endl ;
538 ost <<
"Circumferential equatorial radius R_circ : "
539 <<
r_circ()/km <<
" km" << endl ;
541 ost <<
"Surface area : " <<
area()/(km*km) <<
" km^2" << endl ;
542 ost <<
"Mean radius R_mean : "
546 "Skipping surface statements due to number of points in phi direction np == 1"
549 ost <<
"Coordinate equatorial radius r_eq : " <<
ray_eq()/km <<
" km"
551 ost <<
"Flattening r_pole/r_eq : " <<
aplat() << endl ;
554 ost <<
"Compaction parameter M_g / R_circ : " << compact << endl ;
556 int lsurf =
nzet - 1;
559 ost <<
"Equatorial value of the velocity U: "
560 <<
uuu()(
nzet-1, 0, nt-1, nr-1) <<
" c" << endl ;
561 ost <<
"Redshift at the equator (forward) : " <<
z_eqf() << endl ;
562 ost <<
"Redshift at the equator (backward): " <<
z_eqb() << endl ;
563 ost <<
"Redshift at the pole : " <<
z_pole() << endl ;
566 ost <<
"Central value of log(N) : "
567 <<
logn()(0, 0, 0, 0) << endl ;
569 ost <<
"Central value of dzeta=log(AN) : "
570 <<
dzeta()(0, 0, 0, 0) << endl ;
572 if ( (omega_c==0) && (nphi_c==0) ) {
573 ost <<
"Central N^phi : " << nphi_c << endl ;
576 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c << endl ;
579 ost <<
" ... w_shift (NB: components in the star Cartesian frame) [c] : "
581 <<
w_shift(0)(0, 0, 0, 0) <<
" "
582 <<
w_shift(1)(0, 0, 0, 0) <<
" "
583 <<
w_shift(2)(0, 0, 0, 0) << endl ;
585 ost <<
"Central value of khi_shift [km c] : "
586 <<
khi_shift()(0, 0, 0, 0) / km << endl ;
588 ost <<
"Central value of B^2 : " <<
b_car()(0,0,0,0) << endl ;
592 "Relative discrepancy in each domain between the metric coef. A^2 and B^2 : "
594 for (
int l=0; l<diff_a_b.get_taille(); l++) {
595 ost << diff_a_b(l) <<
" " ;
602 double r_grav = ggrav *
mass_g() ;
603 double r_isco_appr = 6. * r_grav * ( 1. -
pow(2./3.,1.5) * jdimless ) ;
608 double f_isco_appr = ( 1. + 11. /6. /
sqrt(6.) * jdimless ) / r_grav /
609 (12. * M_PI ) /
sqrt(6.) ;
611 ost << endl <<
"Innermost stable circular orbit (ISCO) : " << endl ;
612 double xr_isco =
r_isco(&ost) ;
613 ost <<
" circumferential radius r_isco = "
614 << xr_isco / km <<
" km" << endl ;
615 ost <<
" (approx. 6M + 1st order in j : "
616 << r_isco_appr / km <<
" km)" << endl ;
617 ost <<
" (approx. 6M : "
618 << 6. * r_grav / km <<
" km)" << endl ;
619 ost <<
" orbital frequency f_isco = "
620 <<
f_isco() * f_unit <<
" Hz" << endl ;
621 ost <<
" (approx. 1st order in j : "
622 << f_isco_appr * f_unit <<
" Hz)" << endl ;
635 double freq = omega_c / (2.*M_PI) ;
636 ost <<
"Central Omega : " << omega_c * f_unit
637 <<
" rad/s f : " << freq * f_unit <<
" Hz" << endl ;
638 ost <<
"Rotation period : " << 1000. / (freq * f_unit) <<
" ms"
640 ost << endl <<
"Central enthalpy : " <<
ent()(0,0,0,0) <<
" c^2" << endl ;
641 ost <<
"Central proper baryon density : " <<
nbar()(0,0,0,0)
642 <<
" x 0.1 fm^-3" << endl ;
643 ost <<
"Central proper energy density : " <<
ener()(0,0,0,0)
644 <<
" rho_nuc c^2" << endl ;
645 ost <<
"Central pressure : " <<
press()(0,0,0,0)
646 <<
" rho_nuc c^2" << endl ;
648 ost <<
"Central value of log(N) : "
649 <<
logn()(0, 0, 0, 0) << endl ;
650 ost <<
"Central lapse N : " <<
nnn()(0,0,0,0) << endl ;
651 ost <<
"Central value of dzeta=log(AN) : "
652 <<
dzeta()(0, 0, 0, 0) << endl ;
653 ost <<
"Central value of A^2 : " <<
a_car()(0,0,0,0) << endl ;
654 ost <<
"Central value of B^2 : " <<
b_car()(0,0,0,0) << endl ;
656 double nphi_c =
nphi()(0, 0, 0, 0) ;
657 if ( (omega_c==0) && (nphi_c==0) ) {
658 ost <<
"Central N^phi : " << nphi_c << endl ;
661 ost <<
"Central N^phi/Omega : " << nphi_c / omega_c
666 int lsurf =
nzet - 1;
669 ost <<
"Equatorial value of the velocity U: "
670 <<
uuu()(
nzet-1, 0, nt-1, nr-1) <<
" c" << endl ;
673 <<
"Coordinate equatorial radius r_eq = "
674 <<
ray_eq()/km <<
" km" << endl ;
675 ost <<
"Flattening r_pole/r_eq : " <<
aplat() << endl ;
696 if (p_eos_poly != 0x0) {
698 double kappa = p_eos_poly->
get_kap() ;
699 double gamma = p_eos_poly->
get_gam() ; ;
702 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1) ) ;
705 double r_poly = kap_ns2 /
sqrt(ggrav) ;
708 double t_poly = r_poly ;
711 double m_poly = r_poly / ggrav ;
714 double j_poly = r_poly * r_poly / ggrav ;
717 double rho_poly = 1. / (ggrav * r_poly * r_poly) ;
720 ost << endl <<
"Quantities in polytropic units : " << endl ;
721 ost <<
"==============================" << endl ;
722 ost <<
" ( r_poly = " << r_poly / km <<
" km )" << endl ;
723 ost <<
" n_c : " <<
nbar()(0, 0, 0, 0) / rho_poly << endl ;
724 ost <<
" e_c : " <<
ener()(0, 0, 0, 0) / rho_poly << endl ;
725 ost <<
" Omega_c : " <<
get_omega_c() * t_poly << endl ;
726 ost <<
" P_c : " << 2.*M_PI /
get_omega_c() / t_poly << endl ;
727 ost <<
" M_bar : " <<
mass_b() / m_poly << endl ;
728 ost <<
" M : " <<
mass_g() / m_poly << endl ;
729 ost <<
" J : " <<
angu_mom() / j_poly << endl ;
730 ost <<
" r_eq : " <<
ray_eq() / r_poly << endl ;
731 ost <<
" R_circ : " <<
r_circ() / r_poly << endl ;
762 double lambda = double(1) / double(3) ;
770 for (
int i=0; i<3; i++) {
772 - (lambda/2./(lambda+1)) * (d_khi(i) + x_d_w(i)) ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void sauve(FILE *) const
Save in a file.
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.
Class for isolated rotating stars *** DEPRECATED : use class Star_rot instead ***.
Tenseur ssjm1_wshift
Effective source at the previous step for the resolution of the vector Poisson equation for .
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 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 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 .
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.
Base class for stars *** DEPRECATED : use class Star instead ***.
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 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.
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 a_car
Total conformal factor .
Base class for coordinate mappings.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
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...
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Tensor handling *** DEPRECATED : use class Tensor instead ***.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
void sauve(FILE *) const
Save in a file.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void dec2_dzpuis()
dzpuis -= 2 ;
void dec_dzpuis()
dzpuis -= 1 ;
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates)
void set_std_base()
Set the standard spectal basis of decomposition for each component.
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
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 .
Standard units of space, time and mass.