101 #include "utilitaires.h" 113 Map& mp2,
int nzet2,
const Eos& eos2,
int irrot2,
115 : ref_triad(0.,
"Absolute frame Cartesian basis"),
116 star1(mp1, nzet1, relat, eos1, irrot1, ref_triad),
117 star2(mp2, nzet2, relat, eos2, irrot2, ref_triad)
133 : ref_triad(0.,
"Absolute frame Cartesian basis"),
150 : ref_triad(0.,
"Absolute frame Cartesian basis"),
151 star1(mp1, eos1, ref_triad, fich),
152 star2(mp2, eos2, ref_triad, fich)
242 void Binaire::sauve(FILE* fich)
const {
254 ostream& operator<<(ostream& ost,
const Binaire& bibi) {
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 ;
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 ;
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) : " <<
329 ost <<
" R_0(star 2) : " <<
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 ;
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 ;
395 ost <<
"# H_c(2)[c^2] " 396 <<
" e_c(2)[rho_nuc] " 397 <<
" M_B(2) [M_sol] " 400 <<
" a3/a1(2) " << endl ;
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) ;
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) ;
466 return sqrt( dx*dx + dy*dy + dz*dz ) ;
double total_ener() const
Total energy (excluding the rest mass energy).
virtual void sauve(FILE *) const
Save in a file.
const Map & get_mp() const
Returns the mapping.
Etoile_bin star1
First star of the system.
double mass_adm() const
Total ADM mass.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
Cmp sqrt(const Cmp &)
Square root.
double ray_eq_pis2() const
Coordinate radius at , [r_unit].
double get_ori_y() const
Returns the y coordinate of the origin.
Tbl * p_mom_constr
Relative error on the momentum constraint.
void display_poly(ostream &) const
Display in polytropic units.
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 * p_ham_constr
Relative error on the Hamiltonian constraint.
double ray_eq() const
Coordinate radius at , [r_unit].
double * p_virial
Virial theorem error.
Base class for coordinate mappings.
double get_ori_x() const
Returns the x coordinate of the origin.
const Base_vect_cart ref_triad
Cartesian triad of the absolute reference frame.
double virial_gb() const
Estimates the relative error on the virial theorem calculated by E.Gourgoulhon and S...
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
double x_axe
Absolute X coordinate of the rotation axis.
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density, defined according to the formula wher...
double * p_total_ener
Total energy of the system.
double get_gam() const
Returns the adiabatic index (cf. Eq. (3))
Etoile_bin * et[2]
Array of the two stars (to perform loops on the stars): { et[0]} contains the address of { star1} and...
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.
void operator=(const Binaire &)
Assignment to another { Binaire}.
double omega
Angular velocity with respect to an asymptotically inertial observer.
double separation() const
Returns the coordinate separation of the two stellar centers [{ r_unit}].
double get_kap() const
Returns the pressure coefficient (cf.
double * p_virial_fus
Virial theorem error by J.L.Friedman, K.Uryu, and M.Shibata.
Polytropic equation of state (relativistic case).
int get_nzone() const
Returns the number of domains.
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.
Cmp pow(const Cmp &, int)
Power .
const Tbl & angu_mom() const
Total angular momentum.
void write_global(ostream &) const
Write global quantities in a formatted file.
Tbl * p_angu_mom
Total angular momentum of the system.
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.
double ray_pole() const
Coordinate radius at [r_unit].
double ray_eq_pi() const
Coordinate radius at , [r_unit].
double mass_kom() const
Total Komar mass.
double virial_fus() const
Estimates the relative error on the virial theorem calculated by J.L.Friedman, K.Uryu, and M.Shibata (PRD accepted, gr-qc/0108070)
double * p_mass_adm
Total ADM mass of the system.
double * p_mass_kom
Total Komar mass of the system.
double * p_virial_gb
Virial theorem error by E.Gourgoulhon and S.Bonazzola.
void del_deriv() const
Destructor.
const Tenseur & get_ener() const
Returns the proper total energy density.
double virial() const
Estimates the relative error on the virial theorem (for a relativistic one, it returns $|1 - M_{ Koma...
double get_ori_z() const
Returns the z coordinate of the origin.
void set_der_0x0() const
Sets to { 0x0} all the pointers on derived quantities.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Binaire(Map &mp1, int nzet1, const Eos &eos1, int irrot1, Map &mp2, int nzet2, const Eos &eos2, int irrot2, int relat)
Standard constructor.
virtual double mass_b() const
Baryon mass.
const Eos & get_eos() const
Returns the equation of state.
const Tenseur & get_ent() const
Returns the enthalpy field.
Etoile_bin star2
Second star of the system.