89 #include "utilitaires.h" 90 #include "graphique.h" 103 Map& mp2,
int nzet2,
const Eos& eos2,
int irrot2,
105 : star1(mp1, nzet1, eos1, irrot1, conf_flat),
106 star2(mp2, nzet2, eos2, irrot2, conf_flat)
138 : star1(mp1, eos1, fich),
139 star2(mp2, eos2, fich)
233 ostream& operator<<(ostream& ost,
const Binary& bibi) {
244 ost <<
"Binary neutron stars" << endl ;
245 ost <<
"=============" << endl ;
247 "Orbital angular velocity : " <<
omega * f_unit <<
" rad/s" << endl ;
249 "Coordinate separation between the two stellar centers : " 252 "Absolute coordinate X of the rotation axis : " <<
x_axe / km
254 ost << endl <<
"Star 1 : " << endl ;
255 ost <<
"====== " << endl ;
256 ost <<
star1 << endl ;
257 ost <<
"Star 2 : " << endl ;
258 ost <<
"====== " << endl ;
259 ost <<
star2 << endl ;
273 if (p_eos_poly != 0x0) {
277 double kappa = p_eos_poly->
get_kap() ;
278 double gamma = p_eos_poly->
get_gam() ; ;
279 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1) ) ;
282 double r_poly = kap_ns2 /
sqrt(ggrav) ;
285 double t_poly = r_poly ;
288 double m_poly = r_poly / ggrav ;
291 double j_poly = r_poly * r_poly / ggrav ;
294 ost << endl <<
"Quantities in polytropic units : " << endl ;
295 ost <<
"==============================" << endl ;
296 ost <<
" ( r_poly = " << r_poly / km <<
" km )" << endl ;
297 ost <<
" d_e_max : " <<
separation() / r_poly << endl ;
301 ost <<
" Omega : " <<
omega * t_poly << endl ;
302 ost <<
" J : " <<
angu_mom()(2) / j_poly << endl ;
303 ost <<
" M_ADM : " <<
mass_adm() / m_poly << endl ;
304 ost <<
" M_Komar : " <<
mass_kom() / m_poly << endl ;
305 ost <<
" M_bar(star 1) : " <<
star1.
mass_b() / m_poly << endl ;
306 ost <<
" M_bar(star 2) : " <<
star2.
mass_b() / m_poly << endl ;
307 ost <<
" R_0(star 1) : " <<
309 ost <<
" R_0(star 2) : " <<
325 cout <<
"distance = " << distance << endl ;
326 double lim_un = distance/2. ;
327 double lim_deux = distance/2. ;
328 double int_un = distance/6. ;
329 double int_deux = distance/6. ;
333 fonction_f_un = 0.5*
pow(
335 fonction_f_un.std_spectral_base();
338 fonction_g_un = 0.5*
pow 340 fonction_g_un.std_spectral_base();
343 fonction_f_deux = 0.5*
pow(
344 cos((
star2.
get_mp().
r-int_deux)*M_PI/2./(lim_deux-int_deux)), 2.)+0.5 ;
345 fonction_f_deux.std_spectral_base();
348 fonction_g_deux = 0.5*
pow(
350 fonction_g_deux.std_spectral_base();
366 double xabs, yabs, zabs, air_un, air_deux, theta, phi ;
368 for (
int l=0 ; l<nz_un ; l++) {
377 for (
int k=0 ; k<np ; k++)
378 for (
int j=0 ; j<nt ; j++)
379 for (
int i=0 ; i<nr ; i++) {
381 xabs = xabs_un (l, k, j, i) ;
382 yabs = yabs_un (l, k, j, i) ;
383 zabs = zabs_un (l, k, j, i) ;
387 (xabs, yabs, zabs, air_un, theta, phi) ;
389 (xabs, yabs, zabs, air_deux, theta, phi) ;
391 if (air_un <= lim_un)
393 decouple_un.set_grid_point(l, k, j, i) = 1 ;
396 decouple_un.set_grid_point(l, k, j, i) =
397 fonction_f_un.val_grid_point(l, k, j, i) ;
399 if (air_deux <= lim_deux)
400 if (air_deux < int_deux)
401 decouple_un.set_grid_point(l, k, j, i) = 0 ;
404 decouple_un.set_grid_point(l, k, j, i) =
405 fonction_g_deux.val_point (air_deux, theta, phi) ;
409 decouple_un.set_grid_point(l, k, j, i) = 0.5 ;
414 for (
int k=0 ; k<np ; k++)
415 for (
int j=0 ; j<nt ; j++)
416 decouple_un.set_grid_point(nz_un-1, k, j, nr)=0.5 ;
419 for (
int l=0 ; l<nz_deux ; l++) {
428 for (
int k=0 ; k<np ; k++)
429 for (
int j=0 ; j<nt ; j++)
430 for (
int i=0 ; i<nr ; i++) {
432 xabs = xabs_deux (l, k, j, i) ;
433 yabs = yabs_deux (l, k, j, i) ;
434 zabs = zabs_deux (l, k, j, i) ;
438 (xabs, yabs, zabs, air_un, theta, phi) ;
440 (xabs, yabs, zabs, air_deux, theta, phi) ;
442 if (air_deux <= lim_deux)
443 if (air_deux < int_deux)
444 decouple_deux.set_grid_point(l, k, j, i) = 1 ;
447 decouple_deux.set_grid_point(l, k, j, i) =
448 fonction_f_deux.val_grid_point(l, k, j, i) ;
450 if (air_un <= lim_un)
452 decouple_deux.set_grid_point(l, k, j, i) = 0 ;
455 decouple_deux.set_grid_point(l, k, j, i) =
456 fonction_g_un.val_point (air_un, theta, phi) ;
460 decouple_deux.set_grid_point(l, k, j, i) = 0.5 ;
465 for (
int k=0 ; k<np ; k++)
466 for (
int j=0 ; j<nt ; j++)
467 decouple_deux.set_grid_point(nz_un-1, k, j, nr)=0.5 ;
470 decouple_un.std_spectral_base() ;
471 decouple_deux.std_spectral_base() ;
476 cout <<
"decouple_un" << endl <<
norme(decouple_un/(nr*nt*np)) << endl ;
477 cout <<
"decouple_deux" << endl <<
norme(decouple_deux/(nr*nt*np))
493 ost <<
"# Grid 1 : " << nz1 <<
"x" 495 <<
" R_out(l) [km] : " ;
496 for (
int l=0; l<nz1; l++) {
497 ost <<
" " << mp1.
val_r(l, 1., M_PI/2, 0) / km ;
501 ost <<
"# VE(M) " << endl ;
504 ost.setf(ios::scientific) ;
513 <<
" M_ADM_vol [M_sol] " 514 <<
" M_Komar [M_sol] " 515 <<
" M_Komar_vol [M_sol] " 516 <<
" J [G M_sol^2/c] " << endl ;
523 ost <<
omega / (2*M_PI)* f_unit ; ost.width(22) ;
524 ost <<
mass_adm() / msol ; ost.width(22) ;
526 ost <<
mass_kom() / msol ; ost.width(22) ;
528 ost <<
angu_mom()(2)/ ( qpig / (4* M_PI) * msol*msol) << endl ;
530 ost <<
"# H_c(1)[c^2] " 531 <<
" e_c(1)[rho_nuc] " 532 <<
" M_B(1) [M_sol] " 535 <<
" a3/a1(1) " << endl ;
545 ost <<
"# H_c(2)[c^2] " 546 <<
" e_c(2)[rho_nuc] " 547 <<
" M_B(2) [M_sol] " 550 <<
" a3/a1(2) " << endl ;
567 double kappa = p_eos_poly->
get_kap() ;
568 double gamma = p_eos_poly->
get_gam() ; ;
569 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1.) ) ;
572 double r_poly = kap_ns2 /
sqrt(ggrav) ;
575 double t_poly = r_poly ;
578 double m_poly = r_poly / ggrav ;
581 double j_poly = r_poly * r_poly / ggrav ;
589 <<
" M_B(2) [poly] " << endl ;
592 ost <<
separation() / r_poly ; ost.width(22) ;
594 ost <<
omega * t_poly ; ost.width(22) ;
595 ost <<
mass_adm() / m_poly ; ost.width(22) ;
596 ost <<
angu_mom()(2) / j_poly ; ost.width(22) ;
616 return sqrt( dx*dx + dy*dy + dz*dz ) ;
Coord xa
Absolute x coordinate.
double mass_kom_vol() const
Total Komar mass (computed by a volume integral)
Map & mp
Mapping associated with the star.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
virtual double mass_b() const
Baryon mass.
Cmp sqrt(const Cmp &)
Square root.
double get_ori_y() const
Returns the y coordinate of the origin.
Star_bin star1
First star of the system.
Standard units of space, time and mass.
Equation of state base class.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
double omega
Angular velocity with respect to an asymptotically inertial observer.
Tensor field of valence 0 (or component of a tensorial field).
const Scalar & get_ener() const
Returns the proper total energy density.
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
Base class for coordinate mappings.
double get_ori_x() const
Returns the x coordinate of the origin.
const Map & get_mp() const
Returns the mapping.
void fait_decouple()
Calculates decouple which is used to obtain qq_auto by the formula : qq_auto = decouple * qq...
virtual void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
double mass_adm_vol() const
Total ADM mass (computed by a volume integral)
Cmp cos(const Cmp &)
Cosine.
double * p_mass_adm
Total ADM mass of the system.
double get_gam() const
Returns the adiabatic index (cf. Eq. (3))
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
double virial() const
Estimates the relative error on the virial theorem.
void display_poly(ostream &) const
Display in polytropic units.
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.
double * p_ham_constr
Relative error on the Hamiltonian constraint.
Scalar decouple
Function used to construct the part generated by the star from the total .
double separation() const
Returns the coordinate separation of the two stellar centers [r_unit].
const Tbl & angu_mom() const
Total angular momentum.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
double get_kap() const
Returns the pressure coefficient (cf.
Tbl * p_mom_constr
Relative error on the momentum constraint.
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
double ray_eq_pis2() const
Coordinate radius at , [r_unit].
void operator=(const Binary &)
Assignment to another Binary.
double * p_total_ener
Total energy of the system.
Polytropic equation of state (relativistic case).
void del_deriv() const
Deletes all the derived quantities.
int get_nzone() const
Returns the number of domains.
double * p_virial
Virial theorem error.
double ray_eq_pi() const
Coordinate radius at , [r_unit].
virtual void sauve(FILE *) const
Save in a file.
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.
double x_axe
Absolute X coordinate of the rotation axis.
Cmp pow(const Cmp &, int)
Power .
double ray_pole() const
Coordinate radius at [r_unit].
Star_bin * et[2]
Array of the two stars (to perform loops on the stars): et[0] contains the address of star1 and et[1]...
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 get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Coord ya
Absolute y coordinate.
void write_global(ostream &) const
Write global quantities in a formatted file.
Tbl * p_angu_mom
Total angular momentum of the system.
const Scalar & get_ent() const
Returns the enthalpy field.
Coord za
Absolute z coordinate.
double mass_kom() const
Total Komar mass.
double ray_eq() const
Coordinate radius at , [r_unit].
double get_ori_z() const
Returns the z coordinate of the origin.
Binary(Map &mp1, int nzet1, const Eos &eos1, int irrot1, Map &mp2, int nzet2, const Eos &eos2, int irrot2, int conf_flat)
Standard constructor.
const Eos & get_eos() const
Returns the equation of state.
Cmp sin(const Cmp &)
Sine.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
void convert_absolute(double xx, double yy, double zz, double &rr, double &theta, double &pphi) const
Determines the coordinates corresponding to given absolute Cartesian coordinates (X...
double mass_adm() const
Total ADM mass.
Star_bin star2
Second star of the system.
double * p_mass_kom
Total Komar mass of the system.
Coord r
r coordinate centered on the grid
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density,.