101#include "utilitaires.h"
113 Map& mp2,
int nzet2,
const Eos& eos2,
int irrot2,
115 :
ref_triad(0.,
"Absolute frame Cartesian basis"),
133 : ref_triad(0.,
"Absolute frame Cartesian basis"),
150 :
ref_triad(0.,
"Absolute frame Cartesian basis"),
242void Binaire::sauve(FILE* fich)
const {
265 ost <<
"Binary system" << endl ;
266 ost <<
"=============" << endl ;
268 "Orbital angular velocity : " <<
omega * f_unit <<
" rad/s" << endl ;
270 "Coordinate separation between the two stellar centers : "
273 "Absolute coordinate X of the rotation axis : " <<
x_axe / km
275 ost << endl <<
"Star 1 : " << endl ;
276 ost <<
"====== " << endl ;
277 ost <<
star1 << endl ;
278 ost <<
"Star 2 : " << endl ;
279 ost <<
"====== " << endl ;
280 ost <<
star2 << endl ;
291 const Eos* p_eos1 = &(
star1.get_eos() ) ;
294 if ((p_eos_poly != 0x0) && (
star1.get_eos() ==
star2.get_eos() )) {
296 double kappa = p_eos_poly->
get_kap() ;
297 double gamma = p_eos_poly->
get_gam() ; ;
298 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1) ) ;
301 double r_poly = kap_ns2 /
sqrt(ggrav) ;
304 double t_poly = r_poly ;
307 double m_poly = r_poly / ggrav ;
310 double j_poly = r_poly * r_poly / ggrav ;
313 ost << endl <<
"Quantities in polytropic units : " << endl ;
314 ost <<
"==============================" << endl ;
315 ost <<
" ( r_poly = " << r_poly / km <<
" km )" << endl ;
316 ost <<
" d_e_max : " <<
separation() / r_poly << endl ;
318 << (
star2.xa_barycenter() -
star1.xa_barycenter() ) / r_poly
320 ost <<
" Omega : " <<
omega * t_poly << endl ;
321 ost <<
" J : " <<
angu_mom()(2) / j_poly << endl ;
322 ost <<
" M_ADM : " <<
mass_adm() / m_poly << endl ;
323 ost <<
" M_Komar : " <<
mass_kom() / m_poly << endl ;
324 ost <<
" E : " <<
total_ener() / m_poly << endl ;
325 ost <<
" M_bar(star 1) : " <<
star1.mass_b() / m_poly << endl ;
326 ost <<
" M_bar(star 2) : " <<
star2.mass_b() / m_poly << endl ;
327 ost <<
" R_0(star 1) : " <<
328 0.5 * (
star1.ray_eq() +
star1.ray_eq_pi() ) / r_poly << endl ;
329 ost <<
" R_0(star 2) : " <<
330 0.5 * (
star2.ray_eq() +
star2.ray_eq_pi() ) / r_poly << endl ;
342 const Mg3d* mg1 = mp1.get_mg() ;
346 ost <<
"# Grid 1 : " << nz1 <<
"x"
348 <<
" R_out(l) [km] : " ;
349 for (
int l=0; l<nz1; l++) {
350 ost <<
" " << mp1.val_r(l, 1., M_PI/2, 0) / km ;
356 <<
" VE(FUS) " << endl ;
358 ost.setf(ios::scientific) ;
360 ost <<
virial() ; ost.width(14) ;
369 <<
" J [G M_sol^2/c] " << endl ;
374 ost << (
star2.xa_barycenter() -
star1.xa_barycenter() ) / km ; ost.width(22) ;
376 ost <<
omega / (2*M_PI)* f_unit ; ost.width(22) ;
377 ost <<
mass_adm() / msol ; ost.width(22) ;
378 ost <<
angu_mom()(2)/ ( qpig / (4* M_PI) * msol*msol) << endl ;
380 ost <<
"# H_c(1)[c^2] "
381 <<
" e_c(1)[rho_nuc] "
382 <<
" M_B(1) [M_sol] "
385 <<
" a3/a1(1) " << endl ;
388 ost <<
star1.get_ent()()(0,0,0,0) ; ost.width(22) ;
389 ost <<
star1.get_ener()()(0,0,0,0) ; ost.width(22) ;
390 ost <<
star1.mass_b() / msol ; ost.width(22) ;
391 ost <<
star1.ray_eq() / km ; ost.width(22) ;
392 ost <<
star1.ray_eq_pis2() /
star1.ray_eq() ; ost.width(22) ;
393 ost <<
star1.ray_pole() /
star1.ray_eq() << endl ;
395 ost <<
"# H_c(2)[c^2] "
396 <<
" e_c(2)[rho_nuc] "
397 <<
" M_B(2) [M_sol] "
400 <<
" a3/a1(2) " << endl ;
403 ost <<
star2.get_ent()()(0,0,0,0) ; ost.width(22) ;
404 ost <<
star2.get_ener()()(0,0,0,0) ; ost.width(22) ;
405 ost <<
star2.mass_b() / msol ; ost.width(22) ;
406 ost <<
star2.ray_eq() / km ; ost.width(22) ;
407 ost <<
star2.ray_eq_pis2() /
star1.ray_eq() ; ost.width(22) ;
408 ost <<
star2.ray_pole() /
star1.ray_eq() << endl ;
412 const Eos* p_eos1 = &(
star1.get_eos() ) ;
415 if ((p_eos_poly != 0x0) && (
star1.get_eos() ==
star2.get_eos() )) {
417 double kappa = p_eos_poly->
get_kap() ;
418 double gamma = p_eos_poly->
get_gam() ; ;
419 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1.) ) ;
422 double r_poly = kap_ns2 /
sqrt(ggrav) ;
425 double t_poly = r_poly ;
428 double m_poly = r_poly / ggrav ;
431 double j_poly = r_poly * r_poly / ggrav ;
439 <<
" M_B(2) [poly] " << endl ;
442 ost <<
separation() / r_poly ; ost.width(22) ;
443 ost << (
star2.xa_barycenter() -
star1.xa_barycenter() ) / r_poly ; ost.width(22) ;
444 ost <<
omega * t_poly ; ost.width(22) ;
445 ost <<
mass_adm() / m_poly ; ost.width(22) ;
446 ost <<
angu_mom()(2) / j_poly ; ost.width(22) ;
447 ost <<
star1.mass_b() / m_poly ; ost.width(22) ;
448 ost <<
star2.mass_b() / m_poly << endl ;
462 double dx =
star1.get_mp().get_ori_x() -
star2.get_mp().get_ori_x() ;
463 double dy =
star1.get_mp().get_ori_y() -
star2.get_mp().get_ori_y() ;
464 double dz =
star1.get_mp().get_ori_z() -
star2.get_mp().get_ori_z() ;
466 return sqrt( dx*dx + dy*dy + dz*dz ) ;
void write_global(ostream &) const
Write global quantities in a formatted file.
double * p_ham_constr
Relative error on the Hamiltonian constraint.
Binaire(Map &mp1, int nzet1, const Eos &eos1, int irrot1, Map &mp2, int nzet2, const Eos &eos2, int irrot2, int relat)
Standard constructor.
Tbl * p_angu_mom
Total angular momentum of the system.
double * p_virial_gb
Virial theorem error by E.Gourgoulhon and S.Bonazzola.
double mass_adm() const
Total ADM mass.
void set_der_0x0() const
Sets to {\tt 0x0} all the pointers on derived quantities.
double virial_gb() const
Estimates the relative error on the virial theorem calculated by E.Gourgoulhon and S....
Etoile_bin * et[2]
Array of the two stars (to perform loops on the stars): {\tt et[0]} contains the address of {\tt star...
const Tbl & angu_mom() const
Total angular momentum.
double * p_mass_adm
Total ADM mass of the system.
double separation() const
Returns the coordinate separation of the two stellar centers [{\tt r_unit}].
void del_deriv() const
Destructor.
double * p_total_ener
Total energy of the system.
double * p_virial
Virial theorem error.
Tbl * p_mom_constr
Relative error on the momentum constraint.
friend ostream & operator<<(ostream &, const Binaire &)
Save in a file.
Etoile_bin star2
Second star of the system.
double mass_kom() const
Total Komar mass.
double * p_mass_kom
Total Komar mass of the system.
const Base_vect_cart ref_triad
Cartesian triad of the absolute reference frame.
double virial() const
Estimates the relative error on the virial theorem (for a relativistic one, it returns $|1 - M_{\rm K...
void display_poly(ostream &) const
Display in polytropic units.
double omega
Angular velocity with respect to an asymptotically inertial observer.
double * p_virial_fus
Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata.
void operator=(const Binaire &)
Assignment to another {\tt Binaire}.
Etoile_bin star1
First star of the system.
double total_ener() const
Total energy (excluding the rest mass energy).
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
double virial_fus() const
Estimates the relative error on the virial theorem calculated by J.L.Friedman, K.Uryu,...
double x_axe
Absolute X coordinate of the rotation axis.
Polytropic equation of state (relativistic case).
double get_gam() const
Returns the adiabatic index (cf. Eq. (3)).
double get_kap() const
Returns the pressure coefficient (cf.
Equation of state base class.
virtual void sauve(FILE *) const
Save in a file.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nzone() const
Returns the number of domains.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
Cmp sqrt(const Cmp &)
Square root.
Cmp pow(const Cmp &, int)
Power .
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 fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Standard units of space, time and mass.