30char etoile_bin_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Etoile/etoile_bin.C,v 1.13 2014/10/13 08:52:58 j_novak Exp $" ;
199Cmp raccord_c1(
const Cmp& uu,
int l1) ;
208 bool irrot,
const Base_vect& ref_triad_i)
209 :
Etoile(mpi, nzet_i, relat, eos_i),
211 ref_triad(ref_triad_i),
213 d_psi(mpi, 1, COV, ref_triad),
214 wit_w(mpi, 1, CON, ref_triad),
217 d_logn_auto(mpi, 1, COV, ref_triad),
218 d_logn_auto_regu(mpi, 1, COV, ref_triad),
219 d_logn_comp(mpi, 1, COV, ref_triad),
221 d_beta_auto(mpi, 1, COV, ref_triad),
222 d_beta_comp(mpi, 1, COV, ref_triad),
223 shift_auto(mpi, 1, CON, ref_triad),
224 shift_comp(mpi, 1, CON, ref_triad),
225 w_shift(mpi, 1, CON, mp.get_bvect_cart()),
227 tkij_auto(mpi, 2, CON, ref_triad),
228 tkij_comp(mpi, 2, CON, ref_triad),
231 bsn(mpi, 1, CON, ref_triad),
236 ssjm1_wshift(mpi, 1, CON, mp.get_bvect_cart()),
264 for (
int i=0; i<3; i++) {
283 for (
int i=0; i<3; i++) {
293 irrotational(et.irrotational),
294 ref_triad(et.ref_triad),
299 logn_comp(et.logn_comp),
300 d_logn_auto(et.d_logn_auto),
301 d_logn_auto_regu(et.d_logn_auto_regu),
302 d_logn_comp(et.d_logn_comp),
303 beta_comp(et.beta_comp),
304 d_beta_auto(et.d_beta_auto),
305 d_beta_comp(et.d_beta_comp),
306 shift_auto(et.shift_auto),
307 shift_comp(et.shift_comp),
309 khi_shift(et.khi_shift),
310 tkij_auto(et.tkij_auto),
311 tkij_comp(et.tkij_comp),
312 akcar_auto(et.akcar_auto),
313 akcar_comp(et.akcar_comp),
315 pot_centri(et.pot_centri),
316 ssjm1_logn(et.ssjm1_logn),
317 ssjm1_beta(et.ssjm1_beta),
318 ssjm1_khi(et.ssjm1_khi),
319 ssjm1_wshift(et.ssjm1_wshift),
320 ssjm1_psi(et.ssjm1_khi),
321 decouple(et.decouple)
331 :
Etoile(mpi, eos_i, fich),
332 ref_triad(ref_triad_i),
334 d_psi(mpi, 1, COV, ref_triad),
335 wit_w(mpi, 1, CON, ref_triad),
338 d_logn_auto(mpi, 1, COV, ref_triad),
339 d_logn_auto_regu(mpi, 1, COV, ref_triad),
340 d_logn_comp(mpi, 1, COV, ref_triad),
342 d_beta_auto(mpi, 1, COV, ref_triad),
343 d_beta_comp(mpi, 1, COV, ref_triad),
344 shift_auto(mpi, 1, CON, ref_triad),
345 shift_comp(mpi, 1, CON, ref_triad),
346 w_shift(mpi, 1, CON, mp.get_bvect_cart()),
348 tkij_auto(mpi, 2, CON, ref_triad),
349 tkij_comp(mpi, 2, CON, ref_triad),
352 bsn(mpi, 1, CON, ref_triad),
357 ssjm1_wshift(mpi, 1, CON, mp.get_bvect_cart()),
589 ost <<
"Star in a binary system" << endl ;
590 ost <<
"-----------------------" << endl ;
593 ost <<
"irrotational configuration" << endl ;
596 ost <<
"corotating configuration" << endl ;
599 ost <<
"Absolute abscidia of the stellar center: " <<
602 ost <<
"Absolute abscidia of the barycenter of the baryon density : " <<
607 double d_tilde = 2 * d_ns / r_0 ;
609 ost <<
"d_tilde : " << d_tilde << endl ;
611 ost <<
"Orientation with respect to the absolute frame : " <<
614 ost <<
"Central value of gam_euler : "
617 ost <<
"Central u_euler (U^X, U^Y, U^Z) [c] : "
618 <<
u_euler(0)(0, 0, 0, 0) <<
" "
619 <<
u_euler(1)(0, 0, 0, 0) <<
" "
620 <<
u_euler(2)(0, 0, 0, 0) << endl ;
623 ost <<
"Central d_psi (X, Y, Z) [c] : "
624 <<
d_psi(0)(0, 0, 0, 0) <<
" "
625 <<
d_psi(1)(0, 0, 0, 0) <<
" "
626 <<
d_psi(2)(0, 0, 0, 0) << endl ;
628 ost <<
"Central vel. / co-orb. (W^X, W^Y, W^Z) [c] : "
629 <<
wit_w(0)(0, 0, 0, 0) <<
" "
630 <<
wit_w(1)(0, 0, 0, 0) <<
" "
631 <<
wit_w(2)(0, 0, 0, 0) << endl ;
633 ost <<
"Max vel. / co-orb. (W^X, W^Y, W^Z) [c] : "
638 ost <<
"Min vel. / co-orb. (W^X, W^Y, W^Z) [c] : "
643 double r_surf =
mp.
val_r(0,1.,M_PI/4,M_PI/4) ;
645 ost <<
"Velocity at (r_surf,pi/4,pi/4) / co-orb. [c] : "
646 <<
wit_w(0).val_point(r_surf,M_PI/4,M_PI/4) <<
" "
647 <<
wit_w(1).val_point(r_surf,M_PI/4,M_PI/4) <<
" "
648 <<
wit_w(2).val_point(r_surf,M_PI/4,M_PI/4) << endl ;
650 ost <<
"Central value of loggam : "
651 <<
loggam()(0, 0, 0, 0) << endl ;
655 ost <<
"Central value of log(N) auto, comp : "
659 ost <<
"Central value of beta=log(AN) auto, comp : "
663 ost <<
"Central value of shift (N^X, N^Y, N^Z) [c] : "
664 <<
shift(0)(0, 0, 0, 0) <<
" "
665 <<
shift(1)(0, 0, 0, 0) <<
" "
666 <<
shift(2)(0, 0, 0, 0) << endl ;
668 ost <<
" ... shift_auto part of it [c] : "
673 ost <<
" ... shift_comp part of it [c] : "
678 ost <<
" ... w_shift (NB: components in the star Cartesian frame) [c] : "
680 <<
w_shift(0)(0, 0, 0, 0) <<
" "
681 <<
w_shift(1)(0, 0, 0, 0) <<
" "
682 <<
w_shift(2)(0, 0, 0, 0) << endl ;
684 ost <<
"Central value of khi_shift [km c] : "
685 <<
khi_shift()(0, 0, 0, 0) / km << endl ;
687 ost << endl <<
"Central value of (B^X, B^Y, B^Z)/N [c] : "
688 <<
bsn(0)(0, 0, 0, 0) <<
" "
689 <<
bsn(1)(0, 0, 0, 0) <<
" "
690 <<
bsn(2)(0, 0, 0, 0) << endl ;
693 "Central (d/dX,d/dY,d/dZ)(logn_auto) [km^{-1}] : "
698 ost <<
"Central (d/dX,d/dY,d/dZ)(logn_comp) [km^{-1}] : "
704 "Central (d/dX,d/dY,d/dZ)(beta_auto) [km^{-1}] : "
709 ost <<
"Central (d/dX,d/dY,d/dZ)(beta_comp) [km^{-1}] : "
715 ost << endl <<
"Central A^2 K^{ij} [c/km] : " << endl ;
716 ost <<
" A^2 K^{xx} auto, comp : "
717 <<
tkij_auto(0, 0)(0, 0, 0, 0) * km <<
" "
718 <<
tkij_comp(0, 0)(0, 0, 0, 0) * km << endl ;
719 ost <<
" A^2 K^{xy} auto, comp : "
720 <<
tkij_auto(0, 1)(0, 0, 0, 0) * km <<
" "
721 <<
tkij_comp(0, 1)(0, 0, 0, 0) * km << endl ;
722 ost <<
" A^2 K^{xz} auto, comp : "
723 <<
tkij_auto(0, 2)(0, 0, 0, 0) * km <<
" "
724 <<
tkij_comp(0, 2)(0, 0, 0, 0) * km << endl ;
725 ost <<
" A^2 K^{yy} auto, comp : "
726 <<
tkij_auto(1, 1)(0, 0, 0, 0) * km <<
" "
727 <<
tkij_comp(1, 1)(0, 0, 0, 0) * km << endl ;
728 ost <<
" A^2 K^{yz} auto, comp : "
729 <<
tkij_auto(1, 2)(0, 0, 0, 0) * km <<
" "
730 <<
tkij_comp(1, 2)(0, 0, 0, 0) * km << endl ;
731 ost <<
" A^2 K^{zz} auto, comp : "
732 <<
tkij_auto(2, 2)(0, 0, 0, 0) * km <<
" "
733 <<
tkij_comp(2, 2)(0, 0, 0, 0) * km << endl ;
735 ost << endl <<
"Central A^2 K_{ij} K^{ij} [c^2/km^2] : " << endl ;
736 ost <<
" A^2 K_{ij} K^{ij} auto, comp : "
788 for (
int i=0; i<3; i++) {
789 v_orb.
set(i) = www(i)(0, 0, 0, 0) ;
794 for (
int l=
nzet; l<=nzm1; l++)
795 for (
int i=0; i<=2; i++)
806 d_psi = d_psi0 + v_orb ;
813 if (d_psi0.
get_etat() == ETATQCQ ) {
815 for (
int i=0; i<3; i++) {
840 double lambda = double(1) / double(3) ;
848 for (
int i=0; i<3; i++) {
850 - (lambda/2./(lambda+1)) * (d_khi(i) + x_d_w(i)) ;
864 double relax_met,
int mer,
int fmer_met) {
866 double relax_ent_jm1 = 1. - relax_ent ;
867 double relax_met_jm1 = 1. - relax_met ;
869 ent = relax_ent *
ent + relax_ent_jm1 * star_jm1.
ent ;
871 if ( (mer != 0) && (mer % fmer_met == 0)) {
Vectorial bases (triads) with respect to which the tensorial components are defined.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void sauve(FILE *) const
Save in a file.
Valeur va
The numerical value of the Cmp
void annule(int l)
Sets the Cmp to zero in a given domain.
Equation of state base class.
Class for stars in binary system.
Tenseur shift_comp
Part of the shift vector generated principaly by the companion star.
Tenseur psi0
Scalar potential of the non-translational part of fluid 4-velocity (in the irrotational case)
Tenseur d_beta_auto
Gradient of beta_auto (Cartesian components with respect to ref_triad )
Tenseur d_logn_auto
Gradient of logn_auto (Cartesian components with respect to ref_triad )
double * p_xa_barycenter
Absolute coordinate X of the barycenter of the baryon density.
virtual void sauve(FILE *) const
Save in a file.
Tenseur bsn
3-vector shift, divided by N , of the rotating coordinates, .
Tenseur akcar_comp
Part of the scalar generated by shift_auto and shift_comp , i.e.
virtual void del_hydro_euler()
Sets to ETATNONDEF (undefined state) the hydrodynamical quantities relative to the Eulerian observer.
Cmp ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
Tenseur d_psi
Gradient of (in the irrotational case) (Cartesian components with respect to ref_triad )
void relaxation(const Etoile_bin &star_prev, double relax_ent, double relax_met, int mer, int fmer_met)
Performs a relaxation on ent , logn_auto , beta_auto and shift_auto .
const Base_vect & ref_triad
Reference triad ("absolute frame"), with respect to which the components of all the member Tenseur 's...
void fait_shift_auto()
Computes shift_auto from w_shift and khi_shift according to Shibata's prescription [Prog.
bool irrotational
true for an irrotational star, false for a corotating one
Tenseur w_shift
Vector used in the decomposition of shift_auto , following Shibata's prescription [Prog.
Tenseur logn_comp
Part of the lapse logarithm (gravitational potential at the Newtonian limit) generated principaly by ...
Tenseur & set_w_shift()
Read/write of w_shift.
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Tenseur d_logn_comp
Gradient of logn_comp (Cartesian components with respect to ref_triad )
Tenseur beta_comp
Part of the logarithm of AN generated principaly by the companion star.
Tenseur ssjm1_wshift
Effective source at the previous step for the resolution of the vector Poisson equation for by means...
Cmp ssjm1_logn
Effective source at the previous step for the resolution of the Poisson equation for logn_auto by mea...
virtual void del_deriv() const
Deletes all the derived quantities.
Cmp ssjm1_psi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
Tenseur pot_centri
Centrifugal potential.
Tenseur loggam
Logarithm of the Lorentz factor between the fluid and the co-orbiting observer.
Tenseur shift_auto
Part of the shift vector generated principaly by the star.
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density, defined according to the formula.
Tenseur_sym tkij_auto
Part of the extrinsic curvature tensor generated by shift_auto .
Tenseur akcar_auto
Part of the scalar generated by shift_auto , i.e.
Cmp ssjm1_beta
Effective source at the previous step for the resolution of the Poisson equation for beta_auto by mea...
Cmp decouple
Function used to construct the part of generated by the star from the total .
Tenseur wit_w
Spatial projection of the fluid 3-velocity with respect to the co-orbiting observer.
Tenseur & set_logn_comp()
Read/write the part of the lapse logarithm (gravitational potential at the Newtonian limit) generated...
Tenseur_sym tkij_comp
Part of the extrinsic curvature tensor generated by shift_comp .
Tenseur & set_khi_shift()
Read/write of khi_shift.
virtual Tenseur sprod(const Tenseur &t1, const Tenseur &t2) const
Performs the scalar product of two tensors by contracting the last index of t1 with the first index o...
Tenseur d_beta_comp
Gradient of beta_comp (Cartesian components with respect to ref_triad )
Etoile_bin(Map &mp_i, int nzet_i, bool relat, const Eos &eos_i, bool irrot, const Base_vect &ref_triad_i)
Standard constructor.
Tenseur d_logn_auto_regu
Gradient of logn_auto_regu (Cartesian components with respect to ref_triad )
virtual ~Etoile_bin()
Destructor.
Tenseur & set_pot_centri()
Read/write the centrifugal potential.
void fait_d_psi()
Computes the gradient of the total velocity potential .
void operator=(const Etoile_bin &)
Assignment to another Etoile_bin.
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Tenseur khi_shift
Scalar used in the decomposition of shift_auto , following 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.
Tenseur logn_auto_div
Divergent part (if k_div!=0 ) of the logarithm of the part of the lapse N generated principaly by t...
int nzet
Number of domains of *mp occupied by the star.
void operator=(const Etoile &)
Assignment to another Etoile.
Tenseur logn_auto_regu
Regular part of the logarithm of the part of the lapse N generated principaly by the star.
double ray_eq_pi() const
Coordinate radius at , [r_unit].
double ray_eq() const
Coordinate radius at , [r_unit].
Tenseur logn_auto
Total of the logarithm of the part of the lapse N generated principaly by the star.
virtual void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
Tenseur u_euler
Fluid 3-velocity with respect to the Eulerian observer.
Tenseur gam_euler
Lorentz factor between the fluid and Eulerian observers.
Map & mp
Mapping associated with the star.
virtual void del_deriv() const
Deletes all the derived quantities.
Tenseur d_logn_auto_div
Gradient of logn_auto_div (if k_div!=0 )
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
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 beta_auto
Logarithm of the part of the product AN generated principaly by by the star.
Tenseur a_car
Total conformal factor .
double unsurc2
: unsurc2=1 for a relativistic star, 0 for a Newtonian one.
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,...
double get_ori_x() const
Returns the x coordinate of the origin.
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
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.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
int get_nzone() const
Returns the number of domains.
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&) ).
int get_type_indice(int i) const
Returns the type of the index number i .
void sauve(FILE *) const
Save in a file.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void annule(int l)
Sets the Tenseur to zero in a given domain.
void dec2_dzpuis()
dzpuis -= 2 ;
void dec_dzpuis()
dzpuis -= 1 ;
const Tenseur & gradient() const
Returns the gradient of *this (Cartesian coordinates)
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
int get_valence() const
Returns the valence.
void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined state).
int get_etat() const
Returns the logical state.
void set_base(const Base_val &)
Sets the bases for spectral expansions (member base )
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.
Tenseur flat_scalar_prod(const Tenseur &t1, const Tenseur &t2)
Scalar product of two Tenseur when the metric is : performs the contraction of the last index of t1 w...
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.