26 char star_bin_xcts_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_xcts.C,v 1.9 2014/10/13 08:53:39 j_novak Exp $" ;
73 Cmp raccord_c1(
const Cmp& uu,
int l1) ;
85 :
Star(mpi, nzet_i, eos_i),
88 d_psi(mpi, COV, mpi.get_bvect_cart()),
89 wit_w(mpi, CON, mpi.get_bvect_cart()),
91 bsn(mpi, CON, mpi.get_bvect_cart()),
100 w_beta(mpi, CON, mpi.get_bvect_cart()),
102 dcov_Psi(mpi, COV, mpi.get_bvect_cart()),
103 dcov_chi(mpi, COV, mpi.get_bvect_cart()),
104 flat(mpi, mpi.get_bvect_cart()),
105 beta_auto(mpi, CON, mpi.get_bvect_cart()),
106 beta_comp(mpi, CON, mpi.get_bvect_cart()),
107 haij_auto(mpi, CON, mpi.get_bvect_cart()),
108 haij_comp(mpi, CON, mpi.get_bvect_cart()),
114 ssjm1_wbeta(mpi, CON, mpi.get_bvect_cart()) {
167 irrotational(star.irrotational),
173 pot_centri(star.pot_centri),
174 chi_auto(star.chi_auto),
175 chi_comp(star.chi_comp),
176 Psi_auto(star.Psi_auto),
177 Psi_comp(star.Psi_comp),
183 dcov_Psi(star.dcov_Psi),
184 dcov_chi(star.dcov_chi),
186 beta_auto(star.beta_auto),
187 beta_comp(star.beta_comp),
188 haij_auto(star.haij_auto),
189 haij_comp(star.haij_comp),
190 hacar_auto(star.hacar_auto),
191 hacar_comp(star.hacar_comp),
192 ssjm1_chi(star.ssjm1_chi),
193 ssjm1_psi(star.ssjm1_psi),
194 ssjm1_khi(star.ssjm1_khi),
195 ssjm1_wbeta(star.ssjm1_wbeta) {
206 :
Star(mpi, eos_i, fich),
208 d_psi(mpi, COV, mpi.get_bvect_cart()),
209 wit_w(mpi, CON, mpi.get_bvect_cart()),
211 bsn(mpi, CON, mpi.get_bvect_cart()),
213 chi_auto(mpi, *(mpi.get_mg()), fich),
215 Psi_auto(mpi, *(mpi.get_mg()), fich),
220 w_beta(mpi, mpi.get_bvect_cart(), fich),
221 khi(mpi, *(mpi.get_mg()), fich),
222 dcov_Psi(mpi, COV, mpi.get_bvect_cart()),
223 dcov_chi(mpi, COV, mpi.get_bvect_cart()),
224 flat(mpi, mpi.get_bvect_cart()),
225 beta_auto(mpi, mpi.get_bvect_cart(), fich),
226 beta_comp(mpi, CON, mpi.get_bvect_cart()),
227 haij_auto(mpi, CON, mpi.get_bvect_cart()),
228 haij_comp(mpi, CON, mpi.get_bvect_cart()),
231 ssjm1_chi(mpi, *(mpi.get_mg()), fich),
232 ssjm1_psi(mpi, *(mpi.get_mg()), fich),
233 ssjm1_khi(mpi, *(mpi.get_mg()), fich),
234 ssjm1_wbeta(mpi, mpi.get_bvect_cart(), fich) {
240 bool status = fread(&
irrotational,
sizeof(
bool), 1, fich) ;
242 cout <<
"Star_bin_xcts::Constructor from a file: Problem with reading ! " << endl ;
471 ost <<
"Number of domains occupied by the star : " <<
nzet << endl ;
473 ost <<
"Equation of state : " << endl ;
476 ost << endl <<
"Central enthalpy : " <<
ent.
val_grid_point(0,0,0,0) <<
" c^2" << endl ;
478 <<
" x 0.1 fm^-3" << endl ;
480 <<
" rho_nuc c^2" << endl ;
482 <<
" rho_nuc c^2" << endl ;
490 ost <<
"Central value of Psi^4 : " << psi4_local.
val_grid_point(0,0,0,0) << endl ;
493 <<
"Coordinate equatorial radius (phi=0) a1 = "
494 <<
ray_eq()/km <<
" km" << endl ;
495 ost <<
"Coordinate equatorial radius (phi=pi/2) a2 = "
497 ost <<
"Coordinate equatorial radius (phi=pi): "
499 ost <<
"Coordinate polar radius a3 = "
506 double mass_shedd_chi = fabs( dent_eq / dent_pole ) ;
508 ost <<
"Mass-shedding estimator = " << mass_shedd_chi << endl ;
510 ost << endl <<
"Baryon mass : " <<
mass_b() / msol <<
" M_sol" << endl ;
511 ost <<
"Gravitational mass : " <<
mass_g() / msol <<
" M_sol" << endl ;
516 ost <<
"Star in a binary system" << endl ;
517 ost <<
"-----------------------" << endl ;
520 ost <<
"irrotational configuration" << endl ;
523 ost <<
"corotating configuration" << endl ;
526 ost <<
"Absolute abscidia of the stellar center: " <<
529 ost <<
"Absolute abscidia of the barycenter of the baryon density : " <<
534 double d_tilde = 2 * d_ns / r_0 ;
536 ost <<
"d_tilde : " << d_tilde << endl ;
538 ost <<
"Central value of gam_euler : "
541 ost <<
"Central u_euler (U^r, U^t, U^p) [c] : "
542 <<
u_euler(1).val_grid_point(0, 0, 0, 0) <<
" "
543 <<
u_euler(2).val_grid_point(0, 0, 0, 0) <<
" "
544 <<
u_euler(3).val_grid_point(0, 0, 0, 0) << endl ;
547 ost <<
"Central d_psi (r, t, p) [c] : "
548 <<
d_psi(1).val_grid_point(0, 0, 0, 0) <<
" "
549 <<
d_psi(2).val_grid_point(0, 0, 0, 0) <<
" "
550 <<
d_psi(3).val_grid_point(0, 0, 0, 0) << endl ;
552 ost <<
"Central vel. / co-orb. (W^r, W^t, W^p) [c] : "
553 <<
wit_w(1).val_grid_point(0, 0, 0, 0) <<
" "
554 <<
wit_w(2).val_grid_point(0, 0, 0, 0) <<
" "
555 <<
wit_w(3).val_grid_point(0, 0, 0, 0) << endl ;
557 ost <<
"Max vel. / co-orb. (W^r, W^t, W^p) [c] : "
562 ost <<
"Min vel. / co-orb. (W^r, W^t, W^p) [c] : "
567 double r_surf =
mp.
val_r(0,1.,M_PI/4,M_PI/4) ;
569 ost <<
"Velocity at (r_surf,pi/4,pi/4) / co-orb. [c] : "
570 <<
wit_w(1).val_point(r_surf,M_PI/4,M_PI/4) <<
" "
571 <<
wit_w(2).val_point(r_surf,M_PI/4,M_PI/4) <<
" "
572 <<
wit_w(3).val_point(r_surf,M_PI/4,M_PI/4) << endl ;
574 ost <<
"Central value of loggam : "
578 ost <<
"Central value of Psi auto, comp : "
582 ost <<
"Central value of beta (N^r, N^t, N^p) [c] : "
583 <<
beta(1).val_grid_point(0, 0, 0, 0) <<
" "
584 <<
beta(2).val_grid_point(0, 0, 0, 0) <<
" "
585 <<
beta(3).val_grid_point(0, 0, 0, 0) << endl ;
587 ost <<
" ... beta_auto part of it [c] : "
588 <<
beta_auto(1).val_grid_point(0, 0, 0, 0) <<
" "
589 <<
beta_auto(2).val_grid_point(0, 0, 0, 0) <<
" "
590 <<
beta_auto(3).val_grid_point(0, 0, 0, 0) << endl ;
592 ost << endl <<
"Central value of (B^r, B^t, B^p)/N [c] : "
593 <<
bsn(1).val_grid_point(0, 0, 0, 0) <<
" "
594 <<
bsn(2).val_grid_point(0, 0, 0, 0) <<
" "
595 <<
bsn(3).val_grid_point(0, 0, 0, 0) << endl ;
598 ost << endl <<
"Central \\hat{A}^{ij} [c/km] : " << endl ;
599 ost <<
" \\hat{A}^{xx} auto, comp : "
600 <<
haij_auto(1, 1).val_grid_point(0, 0, 0, 0) * km <<
" "
601 <<
haij_comp(1, 1).val_grid_point(0, 0, 0, 0) * km << endl ;
602 ost <<
" A^{xy} auto, comp : "
603 <<
haij_auto(1, 2).val_grid_point(0, 0, 0, 0) * km <<
" "
604 <<
haij_comp(1, 2).val_grid_point(0, 0, 0, 0) * km << endl ;
605 ost <<
" A^{xz} auto, comp : "
606 <<
haij_auto(1, 3).val_grid_point(0, 0, 0, 0) * km <<
" "
607 <<
haij_comp(1, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
608 ost <<
" A^{yy} auto, comp : "
609 <<
haij_auto(2, 2).val_grid_point(0, 0, 0, 0) * km <<
" "
610 <<
haij_comp(2, 2).val_grid_point(0, 0, 0, 0) * km << endl ;
611 ost <<
" A^{yz} auto, comp : "
612 <<
haij_auto(2, 3).val_grid_point(0, 0, 0, 0) * km <<
" "
613 <<
haij_comp(2, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
614 ost <<
" A^{zz} auto, comp : "
615 <<
haij_auto(3, 3).val_grid_point(0, 0, 0, 0) * km <<
" "
616 <<
haij_comp(3, 3).val_grid_point(0, 0, 0, 0) * km << endl ;
618 ost << endl <<
"Central \\hat{A}_{ij}\\hat{A}^{ij} [c^2/km^2] : "
620 ost <<
" \\hat{A}_{ij}\\hat{A}^{ij} auto, comp : "
653 for (
int i=1; i<=3; i++)
654 v_orb.
set(i) = www(i).val_grid_point(0, 0, 0, 0) ;
664 d_psi = d_psi0 + v_orb ;
666 for (
int i=1; i<=3; i++) {
667 if (
d_psi(i).get_etat() == ETATZERO)
678 for (
int i=1; i<=3; i++) {
680 d_psi_i.
va.
set_base( d_psi0(i).get_spectral_va().base ) ;
681 d_psi_i = raccord_c1(d_psi_i,
nzet) ;
695 double relax_ent_jm1 = 1. - relax_ent ;
696 double relax_met_jm1 = 1. - relax_met ;
698 ent = relax_ent *
ent + relax_ent_jm1 * star_jm1.
ent ;
700 if ( (mer != 0) && (mer % fmer_met == 0)) {
703 + relax_met_jm1 * star_jm1.
Psi_auto ;
706 + relax_met_jm1 * star_jm1.
chi_auto ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Valeur va
The numerical value of the Cmp
Equation of state base class.
Base class for coordinate mappings.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
const Metric_flat & flat_met_cart() const
Returns the flat metric associated with the Cartesian coordinates and with components expressed in th...
double get_ori_x() const
Returns the x coordinate of the origin.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
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.
Metric for tensor calculation.
int get_nzone() const
Returns the number of domains.
Tensor field of valence 0 (or component of a tensorial field).
virtual void sauve(FILE *) const
Save in a file.
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
const Scalar & dsdr() const
Returns of *this .
void annule_hard()
Sets the Scalar to zero in a hard way.
double val_point(double r, double theta, double phi) const
Computes the value of the field at an arbitrary point , by means of the spectral expansion.
Class for stars in binary system in eXtended Conformal Thin Sandwich formulation.
Scalar Psi
Total conformal factor .
Scalar psi0
Scalar potential of the non-translational part of fluid 4-velocity (in the irrotational case)
Scalar & set_pot_centri()
Read/write the centrifugal potential.
void operator=(const Star_bin_xcts &)
Assignment to another Star_bin_xcts.
Scalar pot_centri
Centrifugal potential.
Sym_tensor haij_auto
Part of the extrinsic curvature tensor generated by beta_auto.
Vector & set_beta_auto()
Read/write of .
void fait_d_psi()
Computes the gradient of the total velocity potential .
Scalar psi4
Conformal factor .
Vector wit_w
Spatial projection of the fluid 3-velocity with respect to the co-orbiting observer.
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density,.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) .
Vector & set_beta()
Read/write of .
Scalar ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for khi.
Scalar khi
Solution for the scalar part of the vector Poisson equation for .
Star_bin_xcts(Map &mp_i, int nzet_i, const Eos &eos_i, bool irrot)
Standard constructor.
Vector ssjm1_wbeta
Effective source at the previous step for wbeta of the vector Poisson equation for wbeta (needed for ...
Scalar Psi_comp
Scalar field generated principally by the companion star.
Scalar ssjm1_chi
Effective source at the previous step for the resolution of the Poisson equation for \chi_auto .
Vector dcov_Psi
Covariant derivative of the conformal factor .
Vector beta_comp
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Vector beta_auto
Part of the shift vector generated principally by the star (Spherical components with respect to the ...
Scalar Psi_auto
Scalar field generated principally by the star.
Scalar hacar_comp
Part of the scalar generated by beta_auto and beta_comp, i.e.
Scalar chi
Total function .
Scalar & set_chi_comp()
Read/write the conformal factor .
Vector bsn
3-vector shift, divided by N, of the rotating coordinates, .
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
Scalar loggam
Logarithm of the Lorentz factor between the fluid and the co-orbiting observer.
Scalar & set_chi_auto()
Read/write the conformal factor .
Sym_tensor haij_comp
Part of the extrinsic curvature tensor generated by beta_comp.
Scalar & set_Psi_comp()
Read/write the conformal factor .
Scalar & set_Psi_auto()
Read/write the conformal factor .
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Vector dcov_chi
Covariant derivative of the function .
Scalar chi_auto
Scalar field generated principally by the star.
virtual double mass_g() const
Gravitational mass.
Vector w_beta
Solution for the vector part of the vector Poisson equation for .
Scalar chi_comp
Scalar field generated principally by the companion star.
Scalar ssjm1_psi
Effective source at the previous step for the resolution of the Poisson equation for \Psi_auto .
void relaxation(const Star_bin_xcts &star_prev, double relax_ent, double relax_met, int mer, int fmer_met)
Performs a relaxation on ent, Psi_auto, chi_auto and beta_auto.
bool irrotational
true for an irrotational star, false for a corotating one
virtual void del_deriv() const
Deletes all the derived quantities.
Vector d_psi
Gradient of (in the irrotational case) (Spherical components with respect to the mapping of the star...
virtual void sauve(FILE *) const
Save in a file.
virtual double mass_b() const
Baryon mass.
virtual ~Star_bin_xcts()
Destructor.
double * p_xa_barycenter
Absolute coordinate X of the barycenter of the baryon density.
Scalar hacar_auto
Part of the scalar generated by beta_auto, i.e.
Scalar ener
Total energy density in the fluid frame.
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.
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 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.
double ray_eq_pis2() const
Coordinate radius at , [r_unit].
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
Scalar press
Fluid pressure.
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.
double ray_pole() const
Coordinate radius at [r_unit].
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 min(const Cmp &)
Minimum values of a Cmp in each domain.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Cmp pow(const Cmp &, int)
Power .
virtual void sauve(FILE *) const
Save in a binary file.
virtual void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
virtual void set_etat_nondef()
Sets the logical state of all components to ETATNONDEF (undefined state).
virtual void annule(int l_min, int l_max)
Sets the Tensor to zero in several domains.
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
Standard units of space, time and mass.