29 char star_bin_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Star/star_bin.C,v 1.19 2014/10/13 08:53:37 j_novak Exp $" ;
107 Cmp raccord_c1(
const Cmp& uu,
int l1) ;
116 bool irrot,
bool conf_flat0)
117 :
Star(mpi, nzet_i, eos_i),
120 d_psi(mpi, COV, mpi.get_bvect_cart()),
121 wit_w(mpi, CON, mpi.get_bvect_cart()),
123 bsn(mpi, CON, mpi.get_bvect_cart()),
127 dcov_logn(mpi, COV, mpi.get_bvect_cart()),
128 dcon_logn(mpi, CON, mpi.get_bvect_cart()),
132 dcov_phi(mpi, COV, mpi.get_bvect_cart()),
133 dcon_phi(mpi, CON, mpi.get_bvect_cart()),
134 flat(mpi, mpi.get_bvect_cart()),
136 beta_auto(mpi, CON, mpi.get_bvect_cart()),
137 beta_comp(mpi, CON, mpi.get_bvect_cart()),
138 hij(mpi, CON, mpi.get_bvect_cart()),
139 hij_auto(mpi, CON, mpi.get_bvect_cart()),
140 hij_comp(mpi, CON, mpi.get_bvect_cart()),
141 tkij_auto(mpi, CON, mpi.get_bvect_cart()),
142 tkij_comp(mpi, CON, mpi.get_bvect_cart()),
148 ssjm1_wbeta(mpi, CON, mpi.get_bvect_cart()),
156 conf_flat(conf_flat0){
242 ssjm1_wbeta(star.ssjm1_wbeta),
259 :
Star(mpi, eos_i, fich),
261 d_psi(mpi, COV, mpi.get_bvect_cart()),
262 wit_w(mpi, CON, mpi.get_bvect_cart()),
264 bsn(mpi, CON, mpi.get_bvect_cart()),
268 dcov_logn(mpi, COV, mpi.get_bvect_cart()),
269 dcon_logn(mpi, CON, mpi.get_bvect_cart()),
270 lnq_auto(mpi, *(mpi.get_mg()), fich),
273 dcov_phi(mpi, COV, mpi.get_bvect_cart()),
274 dcon_phi(mpi, CON, mpi.get_bvect_cart()),
275 flat(mpi, mpi.get_bvect_cart()),
277 beta_auto(mpi, mpi.get_bvect_cart(), fich),
278 beta_comp(mpi, CON, mpi.get_bvect_cart()),
279 hij(mpi, CON, mpi.get_bvect_cart()),
280 hij_auto(mpi, mpi.get_bvect_cart(), fich),
281 hij_comp(mpi, CON, mpi.get_bvect_cart()),
282 tkij_auto(mpi, CON, mpi.get_bvect_cart()),
283 tkij_comp(mpi, CON, mpi.get_bvect_cart()),
289 ssjm1_wbeta(mpi, mpi.get_bvect_cart(), fich),
303 fread(&
conf_flat,
sizeof(
bool), 1, fich) ;
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: " <<
542 ost <<
"Absolute abscidia of the barycenter of the baryon density : " <<
547 double d_tilde = 2 * d_ns / r_0 ;
549 ost <<
"d_tilde : " << d_tilde << endl ;
551 ost <<
"Central value of gam_euler : " 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 : " 592 ost <<
"Central value of log(N) auto, comp : " 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 : " 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)
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) ;
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)) {
733 cout <<
"La jauge de Dirac est elle bien satisfaite ??" << endl ;
734 cout <<
"Vector Hi" << endl ;
735 for (
int i=1; i<=3; i++)
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 ;
Sym_tensor hij_comp
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Vector dcov_phi
Covariant derivative of the logarithm of the conformal factor.
bool irrotational
true for an irrotational star, false for a corotating one
Metric for tensor calculation.
virtual void sauve(FILE *) const
Save in a binary file.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
void operator=(const Star_bin &)
Assignment to another Star_bin.
Scalar psi0
Scalar potential of the non-translational part of fluid 4-velocity (in the irrotational case) ...
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Cmp exp(const Cmp &)
Exponential.
Vector wit_w
Spatial projection of the fluid 3-velocity with respect to the co-orbiting observer.
Map & mp
Mapping associated with the star.
Scalar ssjm1_lnq
Effective source at the previous step for the resolution of the Poisson equation for lnq_auto...
Sym_tensor hij_auto
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
Vector d_psi
Gradient of (in the irrotational case) (Spherical components with respect to the mapping of the star...
Scalar ssjm1_h31
Effective source at the previous step for the resolution of the Poisson equation for h20_auto...
Scalar ssjm1_h11
Effective source at the previous step for the resolution of the Poisson equation for h00_auto...
Standard units of space, time and mass.
Equation of state base class.
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Tensor field of valence 0 (or component of a tensorial field).
virtual void set_etat_nondef()
Sets the logical state of all components to ETATNONDEF (undefined state).
Scalar & set_logn_comp()
Read/write of the logarithm of the lapse generated principally by the companion.
Base class for coordinate mappings.
double get_ori_x() const
Returns the x coordinate of the origin.
Scalar ssjm1_h33
Effective source at the previous step for the resolution of the Poisson equation for h22_auto...
Scalar logn_comp
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principally by...
Scalar loggam
Logarithm of the Lorentz factor between the fluid and the co-orbiting observer.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Scalar kcar_auto
Part of the scalar generated by beta_auto, i.e.
virtual void sauve(FILE *) const
Save in a binary file.
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
double * p_xa_barycenter
Absolute coordinate X of the barycenter of the baryon density.
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Tensor field of valence 1.
Scalar logn_auto
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principally by...
const Tensor_sym & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
const Metric_flat & flat_met_cart() const
Returns the flat metric associated with the Cartesian coordinates and with components expressed in th...
Scalar ssjm1_h21
Effective source at the previous step for the resolution of the Poisson equation for h10_auto...
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
void annule_hard()
Sets the Scalar to zero in a hard way.
void operator=(const Star &)
Assignment to another Star.
int nzet
Number of domains of *mp occupied by the star.
void test_K_Hi() const
Test if the gauge conditions we impose are well satisfied.
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
virtual void sauve(FILE *) const
Save in a file.
virtual double val_r(int l, double xi, double theta, double pphi) const =0
Returns the value of the radial coordinate r for a given in a given domain.
Scalar decouple
Function used to construct the part generated by the star from the total .
const Vector & divergence(const Metric &) const
Returns the divergence of this with respect to a Metric .
Star_bin(Map &mp_i, int nzet_i, const Eos &eos_i, bool irrot, bool conf_flat)
Standard constructor.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Sym_tensor hij
Total deviation of the inverse conformal metric from the inverse flat metric.
Scalar pot_centri
Centrifugal potential.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
virtual ~Star_bin()
Destructor.
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) ...
Scalar lnq_auto
Scalar field generated principally by the star.
Scalar lnq_comp
Scalar field generated principally by the companion star.
int get_nzone() const
Returns the number of domains.
virtual void del_deriv() const
Deletes all the derived quantities.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
Sym_tensor tkij_comp
Part of the extrinsic curvature tensor generated by beta_comp.
double ray_eq_pi() const
Coordinate radius at , [r_unit].
virtual void sauve(FILE *) const
Save in a file.
void fait_d_psi()
Computes the gradient of the total velocity potential .
Vector dcov_logn
Covariant derivative of the total logarithm of the lapse.
Class for stars in binary system.
Metric gtilde
Conformal metric .
Vector dcon_logn
Contravariant derivative of the total logarithm of the lapse.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
virtual void del_deriv() const
Deletes all the derived quantities.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer...
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Scalar ssjm1_h22
Effective source at the previous step for the resolution of the Poisson equation for h11_auto...
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Sym_tensor tkij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
bool conf_flat
true if the 3-metric is conformally flat, false for a more general metric.
double ray_eq() const
Coordinate radius at , [r_unit].
Scalar ssjm1_h32
Effective source at the previous step for the resolution of the Poisson equation for h21_auto...
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Scalar kcar_comp
Part of the scalar generated by beta_auto and beta_comp, i.e.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
virtual void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Scalar & set_pot_centri()
Read/write the centrifugal potential.
virtual void sauve(FILE *) const
Save in a file.
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
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.
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for khi...
Scalar & set(int)
Read/write access to a component.
Vector & set_beta()
Read/write of .
void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this.
virtual void annule(int l_min, int l_max)
Sets the Tensor to zero in several domains.
Vector bsn
3-vector shift, divided by N, of the rotating coordinates, .
Valeur va
The numerical value of the Cmp.
Scalar psi4
Conformal factor .
Vector dcon_phi
Contravariant derivative of the logarithm of the conformal factor.
Vector & set_beta_auto()
Read/write of .
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density,.
Scalar ssjm1_logn
Effective source at the previous step for the resolution of the Poisson equation for logn_auto...