29char star_bin_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Star/star_bin.C,v 1.19 2014/10/13 08:53:37 j_novak Exp $" ;
107Cmp raccord_c1(
const Cmp& uu,
int l1) ;
116 bool irrot,
bool conf_flat0)
117 :
Star(mpi, nzet_i, eos_i),
163 u_euler.change_triad(mpi.get_bvect_cart()) ;
165 beta.change_triad(mpi.get_bvect_cart()) ;
166 Metric temp_met (
mp.flat_met_cart()) ;
171 d_psi.set_etat_zero() ;
172 wit_w.set_etat_zero() ;
174 bsn.set_etat_zero() ;
188 hij.set_etat_zero() ;
199 ssjm1_wbeta.set_etat_zero() ;
242 ssjm1_wbeta(star.ssjm1_wbeta),
259 :
Star(mpi, eos_i, fich),
303 fread(&
conf_flat,
sizeof(
bool), 1, fich) ;
310 Scalar gam_euler_file(
mp, *(
mp.get_mg()), fich) ;
319 u_euler.change_triad(mpi.get_bvect_cart()) ;
321 beta.change_triad(mpi.get_bvect_cart()) ;
322 Metric temp_met (
mp.flat_met_cart()) ;
328 d_psi.set_etat_zero() ;
329 wit_w.set_etat_zero() ;
331 bsn.set_etat_zero() ;
341 hij.set_etat_zero() ;
440 ssjm1_wbeta = star.ssjm1_wbeta ;
501 ssjm1_wbeta.sauve(fich) ;
510 fwrite(&
conf_flat,
sizeof(
bool), 1, fich) ;
529 ost <<
"Star in a binary system" << endl ;
530 ost <<
"-----------------------" << endl ;
533 ost <<
"irrotational configuration" << endl ;
536 ost <<
"corotating configuration" << endl ;
539 ost <<
"Absolute abscidia of the stellar center: " <<
540 mp.get_ori_x() / km <<
" km" << endl ;
542 ost <<
"Absolute abscidia of the barycenter of the baryon density : " <<
546 double d_ns = fabs(
mp.get_ori_x() ) +
ray_eq_pi() - r_0 ;
547 double d_tilde = 2 * d_ns / r_0 ;
549 ost <<
"d_tilde : " << d_tilde << endl ;
551 ost <<
"Central value of gam_euler : "
552 <<
gam_euler.val_grid_point(0, 0, 0, 0) << endl ;
554 ost <<
"Central u_euler (U^r, U^t, U^p) [c] : "
555 <<
u_euler(1).val_grid_point(0, 0, 0, 0) <<
" "
556 <<
u_euler(2).val_grid_point(0, 0, 0, 0) <<
" "
557 <<
u_euler(3).val_grid_point(0, 0, 0, 0) << endl ;
560 ost <<
"Central d_psi (r, t, p) [c] : "
561 <<
d_psi(1).val_grid_point(0, 0, 0, 0) <<
" "
562 <<
d_psi(2).val_grid_point(0, 0, 0, 0) <<
" "
563 <<
d_psi(3).val_grid_point(0, 0, 0, 0) << endl ;
565 ost <<
"Central vel. / co-orb. (W^r, W^t, W^p) [c] : "
566 <<
wit_w(1).val_grid_point(0, 0, 0, 0) <<
" "
567 <<
wit_w(2).val_grid_point(0, 0, 0, 0) <<
" "
568 <<
wit_w(3).val_grid_point(0, 0, 0, 0) << endl ;
570 ost <<
"Max vel. / co-orb. (W^r, W^t, W^p) [c] : "
575 ost <<
"Min vel. / co-orb. (W^r, W^t, W^p) [c] : "
580 double r_surf =
mp.val_r(0,1.,M_PI/4,M_PI/4) ;
582 ost <<
"Velocity at (r_surf,pi/4,pi/4) / co-orb. [c] : "
583 <<
wit_w(1).val_point(r_surf,M_PI/4,M_PI/4) <<
" "
584 <<
wit_w(2).val_point(r_surf,M_PI/4,M_PI/4) <<
" "
585 <<
wit_w(3).val_point(r_surf,M_PI/4,M_PI/4) << endl ;
587 ost <<
"Central value of loggam : "
588 <<
loggam.val_grid_point(0, 0, 0, 0) << endl ;
592 ost <<
"Central value of log(N) auto, comp : "
593 <<
logn_auto.val_grid_point(0, 0, 0, 0) <<
" "
594 <<
logn_comp.val_grid_point(0, 0, 0, 0) << endl ;
596 ost <<
"Central value of beta (N^r, N^t, N^p) [c] : "
597 <<
beta(1).val_grid_point(0, 0, 0, 0) <<
" "
598 <<
beta(2).val_grid_point(0, 0, 0, 0) <<
" "
599 <<
beta(3).val_grid_point(0, 0, 0, 0) << endl ;
601 ost <<
" ... beta_auto part of it [c] : "
602 <<
beta_auto(1).val_grid_point(0, 0, 0, 0) <<
" "
603 <<
beta_auto(2).val_grid_point(0, 0, 0, 0) <<
" "
604 <<
beta_auto(3).val_grid_point(0, 0, 0, 0) << endl ;
606 ost << endl <<
"Central value of (B^r, B^t, B^p)/N [c] : "
607 <<
bsn(1).val_grid_point(0, 0, 0, 0) <<
" "
608 <<
bsn(2).val_grid_point(0, 0, 0, 0) <<
" "
609 <<
bsn(3).val_grid_point(0, 0, 0, 0) << endl ;
612 ost << endl <<
"Central A^{ij} [c/km] : " << endl ;
613 ost <<
" A^{xx} auto, comp : "
614 <<
tkij_auto(1, 1).val_grid_point(0, 0, 0, 0) * km <<
" "
615 <<
tkij_comp(1, 1).val_grid_point(0, 0, 0, 0) * km << endl ;
616 ost <<
" A^{xy} auto, comp : "
617 <<
tkij_auto(1, 2).val_grid_point(0, 0, 0, 0) * km <<
" "
618 <<
tkij_comp(1, 2).val_grid_point(0, 0, 0, 0) * km << endl ;
619 ost <<
" A^{xz} auto, comp : "
620 <<
tkij_auto(1, 3).val_grid_point(0, 0, 0, 0) * km <<
" "
621 <<
tkij_comp(1, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
622 ost <<
" A^{yy} auto, comp : "
623 <<
tkij_auto(2, 2).val_grid_point(0, 0, 0, 0) * km <<
" "
624 <<
tkij_comp(2, 2).val_grid_point(0, 0, 0, 0) * km << endl ;
625 ost <<
" A^{yz} auto, comp : "
626 <<
tkij_auto(2, 3).val_grid_point(0, 0, 0, 0) * km <<
" "
627 <<
tkij_comp(2, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
628 ost <<
" A^{zz} auto, comp : "
629 <<
tkij_auto(3, 3).val_grid_point(0, 0, 0, 0) * km <<
" "
630 <<
tkij_comp(3, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
632 ost << endl <<
"Central A_{ij} A^{ij} [c^2/km^2] : " << endl ;
633 ost <<
" A_{ij} A^{ij} auto, comp : "
634 <<
kcar_auto.val_grid_point(0, 0, 0, 0) * km*km <<
" "
635 <<
kcar_comp.val_grid_point(0, 0, 0, 0) * km*km << endl ;
648 d_psi.set_etat_nondef() ;
667 for (
int i=1; i<=3; i++) {
668 v_orb.
set(i) = www(i).val_grid_point(0, 0, 0, 0) ;
679 d_psi = d_psi0 + v_orb ;
680 for (
int i=1; i<=3; i++) {
681 if (
d_psi(i).get_etat() == ETATZERO)
682 d_psi.set(i).annule_hard() ;
689 int nzm1 =
mp.get_mg()->get_nzone() - 1 ;
691 for (
int i=1; i<=3; i++) {
693 d_psi_i.
va.
set_base( d_psi0(i).get_spectral_va().base ) ;
694 d_psi_i = raccord_c1(d_psi_i,
nzet) ;
695 d_psi.set(i) = d_psi_i ;
702 double relax_met,
int mer,
int fmer_met) {
704 double relax_ent_jm1 = 1. - relax_ent ;
705 double relax_met_jm1 = 1. - relax_met ;
707 ent = relax_ent *
ent + relax_ent_jm1 * star_jm1.
ent ;
709 if ( (mer != 0) && (mer % fmer_met == 0)) {
729 int nr =
mp.get_mg()->get_nr(0) ;
730 int nt =
mp.get_mg()->get_nt(0) ;
731 int np =
mp.get_mg()->get_np(0) ;
733 cout <<
"La jauge de Dirac est elle bien satisfaite ??" << endl ;
734 cout <<
"Vector Hi" << endl ;
735 for (
int i=1; i<=3; i++)
736 cout <<
" Comp. " << i <<
" : " <<
norme((
gtilde.con()
737 .divergence(
flat))(i)/(nr*nt*np)) << endl ;
740 cout <<
"Pour comparaison valeur de D_i(g^1i)" << endl ;
741 for (
int i=1; i<=3; i++)
743 (1, i, i)/(nr*nt*np)) << endl ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Valeur va
The numerical value of the Cmp.
Equation of state base class.
Metric for tensor calculation.
Tensor field of valence 0 (or component of a tensorial field).
Scalar loggam
Logarithm of the Lorentz factor between the fluid and the co-orbiting observer.
Scalar decouple
Function used to construct the part generated by the star from the total .
Scalar lnq_auto
Scalar field generated principally by the star.
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for khi.
Vector bsn
3-vector shift, divided by N, of the rotating coordinates, .
Vector dcon_logn
Contravariant derivative of the total logarithm of the lapse.
Vector d_psi
Gradient of (in the irrotational case) (Spherical components with respect to the mapping of the star...
Vector dcon_phi
Contravariant derivative of the logarithm of the conformal factor.
Sym_tensor hij_comp
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
double * p_xa_barycenter
Absolute coordinate X of the barycenter of the baryon density.
virtual void del_deriv() const
Deletes all the derived quantities.
Scalar ssjm1_h11
Effective source at the previous step for the resolution of the Poisson equation for h00_auto.
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Scalar ssjm1_logn
Effective source at the previous step for the resolution of the Poisson equation for logn_auto.
Vector dcov_logn
Covariant derivative of the total logarithm of the lapse.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Scalar logn_auto
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principally by...
Scalar psi0
Scalar potential of the non-translational part of fluid 4-velocity (in the irrotational case).
bool irrotational
true for an irrotational star, false for a corotating one
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density,.
Scalar kcar_comp
Part of the scalar generated by beta_auto and beta_comp, i.e.
Scalar logn_comp
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principally by...
Scalar ssjm1_h21
Effective source at the previous step for the resolution of the Poisson equation for h10_auto.
void fait_d_psi()
Computes the gradient of the total velocity potential .
Sym_tensor tkij_comp
Part of the extrinsic curvature tensor generated by beta_comp.
Scalar ssjm1_h33
Effective source at the previous step for the resolution of the Poisson equation for h22_auto.
void test_K_Hi() const
Test if the gauge conditions we impose are well satisfied.
Scalar lnq_comp
Scalar field generated principally by the companion star.
Scalar kcar_auto
Part of the scalar generated by beta_auto, i.e.
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Star_bin(Map &mp_i, int nzet_i, const Eos &eos_i, bool irrot, bool conf_flat)
Standard constructor.
Sym_tensor hij
Total deviation of the inverse conformal metric from the inverse flat metric.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Sym_tensor hij_auto
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Scalar & set_logn_comp()
Read/write of the logarithm of the lapse generated principally by the companion.
Scalar psi4
Conformal factor .
Scalar ssjm1_h31
Effective source at the previous step for the resolution of the Poisson equation for h20_auto.
void operator=(const Star_bin &)
Assignment to another Star_bin.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
Vector & set_beta()
Read/write of .
void relaxation(const Star_bin &star_prev, double relax_ent, double relax_met, int mer, int fmer_met)
Performs a relaxation on ent, logn_auto, lnq_auto, beta_auto and hij_auto.
Sym_tensor tkij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
Vector dcov_phi
Covariant derivative of the logarithm of the conformal factor.
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) .
Scalar ssjm1_h22
Effective source at the previous step for the resolution of the Poisson equation for h11_auto.
Vector wit_w
Spatial projection of the fluid 3-velocity with respect to the co-orbiting observer.
Scalar ssjm1_h32
Effective source at the previous step for the resolution of the Poisson equation for h21_auto.
Metric gtilde
Conformal metric .
Scalar pot_centri
Centrifugal potential.
Scalar & set_pot_centri()
Read/write the centrifugal potential.
virtual ~Star_bin()
Destructor.
Vector & set_beta_auto()
Read/write of .
virtual void sauve(FILE *) const
Save in a file.
Scalar ssjm1_lnq
Effective source at the previous step for the resolution of the Poisson equation for lnq_auto.
bool conf_flat
true if the 3-metric is conformally flat, false for a more general metric.
Star(Map &mp_i, int nzet_i, const Eos &eos_i)
Standard constructor.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
virtual void del_deriv() const
Deletes all the derived quantities.
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
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.
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
double ray_eq_pi() const
Coordinate radius at , [r_unit].
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
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.
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base ).
Tensor field of valence 1.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
Scalar & set(int)
Read/write access to a component.
Cmp exp(const Cmp &)
Exponential.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Standard units of space, time and mass.