29char binaire_bin_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Binaire/binaire.C,v 1.8 2014/10/13 08:52:44 j_novak Exp $" ;
98#include "utilitaires.h"
110 Map& mp2,
int nzet2,
const Eos& eos2,
int irrot2,
112 : ref_triad(0.,
"Absolute frame Cartesian basis"),
113 star1(mp1, nzet1, relat, eos1, irrot1, ref_triad),
114 star2(mp2, nzet2, relat, eos2, irrot2, ref_triad)
130 : ref_triad(0.,
"Absolute frame Cartesian basis"),
147 : ref_triad(0.,
"Absolute frame Cartesian basis"),
148 star1(mp1, eos1, ref_triad, fich),
149 star2(mp2, eos2, ref_triad, fich)
239void Binaire::sauve(FILE* fich)
const {
251ostream& operator<<(ostream& ost,
const Binaire& bibi) {
262 ost <<
"Binary system" << endl ;
263 ost <<
"=============" << endl ;
265 "Orbital angular velocity : " <<
omega * f_unit <<
" rad/s" << endl ;
267 "Coordinate separation between the two stellar centers : "
270 "Absolute coordinate X of the rotation axis : " <<
x_axe / km
272 ost << endl <<
"Star 1 : " << endl ;
273 ost <<
"====== " << endl ;
274 ost <<
star1 << endl ;
275 ost <<
"Star 2 : " << endl ;
276 ost <<
"====== " << endl ;
277 ost <<
star2 << endl ;
293 double kappa = p_eos_poly->
get_kap() ;
294 double gamma = p_eos_poly->
get_gam() ; ;
295 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1) ) ;
298 double r_poly = kap_ns2 /
sqrt(ggrav) ;
301 double t_poly = r_poly ;
304 double m_poly = r_poly / ggrav ;
307 double j_poly = r_poly * r_poly / ggrav ;
310 ost << endl <<
"Quantities in polytropic units : " << endl ;
311 ost <<
"==============================" << endl ;
312 ost <<
" ( r_poly = " << r_poly / km <<
" km )" << endl ;
313 ost <<
" d_e_max : " <<
separation() / r_poly << endl ;
317 ost <<
" Omega : " <<
omega * t_poly << endl ;
318 ost <<
" J : " <<
angu_mom()(2) / j_poly << endl ;
319 ost <<
" M_ADM : " <<
mass_adm() / m_poly << endl ;
320 ost <<
" M_Komar : " <<
mass_kom() / m_poly << endl ;
321 ost <<
" E : " <<
total_ener() / m_poly << endl ;
322 ost <<
" M_bar(star 1) : " <<
star1.
mass_b() / m_poly << endl ;
323 ost <<
" M_bar(star 2) : " <<
star2.
mass_b() / m_poly << endl ;
324 ost <<
" R_0(star 1) : " <<
326 ost <<
" R_0(star 2) : " <<
343 ost <<
"# Grid 1 : " << nz1 <<
"x"
345 <<
" R_out(l) [km] : " ;
346 for (
int l=0; l<nz1; l++) {
347 ost <<
" " << mp1.
val_r(l, 1., M_PI/2, 0) / km ;
353 <<
" VE(FUS) " << endl ;
355 ost.setf(ios::scientific) ;
357 ost <<
virial() ; ost.width(14) ;
366 <<
" J [G M_sol^2/c] " << endl ;
373 ost <<
omega / (2*M_PI)* f_unit ; ost.width(22) ;
374 ost <<
mass_adm() / msol ; ost.width(22) ;
375 ost <<
angu_mom()(2)/ ( qpig / (4* M_PI) * msol*msol) << endl ;
377 ost <<
"# H_c(1)[c^2] "
378 <<
" e_c(1)[rho_nuc] "
379 <<
" M_B(1) [M_sol] "
382 <<
" a3/a1(1) " << endl ;
392 ost <<
"# H_c(2)[c^2] "
393 <<
" e_c(2)[rho_nuc] "
394 <<
" M_B(2) [M_sol] "
397 <<
" a3/a1(2) " << endl ;
414 double kappa = p_eos_poly->
get_kap() ;
415 double gamma = p_eos_poly->
get_gam() ; ;
416 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1.) ) ;
419 double r_poly = kap_ns2 /
sqrt(ggrav) ;
422 double t_poly = r_poly ;
425 double m_poly = r_poly / ggrav ;
428 double j_poly = r_poly * r_poly / ggrav ;
436 <<
" M_B(2) [poly] " << endl ;
439 ost <<
separation() / r_poly ; ost.width(22) ;
441 ost <<
omega * t_poly ; ost.width(22) ;
442 ost <<
mass_adm() / m_poly ; ost.width(22) ;
443 ost <<
angu_mom()(2) / j_poly ; ost.width(22) ;
463 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.
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 double mass_b() const
Baryon mass.
virtual void sauve(FILE *) const
Save in a file.
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density, defined according to the formula.
double ray_eq_pi() const
Coordinate radius at , [r_unit].
double ray_eq() const
Coordinate radius at , [r_unit].
const Map & get_mp() const
Returns the mapping.
const Tenseur & get_ent() const
Returns the enthalpy field.
const Eos & get_eos() const
Returns the equation of state.
double ray_eq_pis2() const
Coordinate radius at , [r_unit].
const Tenseur & get_ener() const
Returns the proper total energy density.
double ray_pole() const
Coordinate radius at [r_unit].
Base class for coordinate mappings.
double get_ori_z() const
Returns the z coordinate of the origin.
double get_ori_y() const
Returns the y coordinate of the origin.
double get_ori_x() const
Returns the x coordinate of the origin.
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_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.
Standard units of space, time and mass.