26char binary_xcts_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Binary_xcts/binary_xcts.C,v 1.6 2014/10/13 08:52:45 j_novak Exp $" ;
57#include "binary_xcts.h"
59#include "utilitaires.h"
80 : star1(mp1, nzet1, eos1, irrot1),
81 star2(mp2, nzet2, eos2, irrot2)
116 : star1(mp1, eos1, fich),
117 star2(mp2, eos2, fich)
224 ost <<
"Binary neutron stars" << endl ;
225 ost <<
"=============" << endl ;
227 "Orbital angular velocity : " <<
omega * f_unit <<
" rad/s" << endl ;
229 "Coordinate separation between the two stellar centers : "
232 "Absolute coordinate X of the rotation axis : " <<
x_axe / km
234 ost << endl <<
"Star 1 : " << endl ;
235 ost <<
"====== " << endl ;
236 ost <<
star1 << endl ;
237 ost <<
"Star 2 : " << endl ;
238 ost <<
"====== " << endl ;
239 ost <<
star2 << endl ;
253 if (p_eos_poly != 0x0) {
257 double kappa = p_eos_poly->
get_kap() ;
258 double gamma = p_eos_poly->
get_gam() ; ;
259 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1) ) ;
262 double r_poly = kap_ns2 /
sqrt(ggrav) ;
265 double t_poly = r_poly ;
268 double m_poly = r_poly / ggrav ;
271 double j_poly = r_poly * r_poly / ggrav ;
274 ost << endl <<
"Quantities in polytropic units : " << endl ;
275 ost <<
"==============================" << endl ;
276 ost <<
" ( r_poly = " << r_poly / km <<
" km )" << endl ;
277 ost <<
" d_e_max : " <<
separation() / r_poly << endl ;
281 ost <<
" Omega : " <<
omega * t_poly << endl ;
282 ost <<
" J : " <<
angu_mom()(2) / j_poly << endl ;
283 ost <<
" M_ADM : " <<
mass_adm() / m_poly << endl ;
284 ost <<
" M_Komar : " <<
mass_kom() / m_poly << endl ;
285 ost <<
" M_bar(star 1) : " <<
star1.
mass_b() / m_poly << endl ;
286 ost <<
" M_bar(star 2) : " <<
star2.
mass_b() / m_poly << endl ;
287 ost <<
" R_0(star 1) : " <<
289 ost <<
" R_0(star 2) : " <<
307 double chi1 = fabs( dent1_eq / dent1_pole ) ;
311 double chi2 = fabs( dent2_eq / dent2_pole ) ;
314 ost <<
"# Grid 1 : " << nz1 <<
"x"
316 <<
" R_out(l) [km] : " ;
317 for (
int l=0; l<nz1; l++) {
318 ost <<
" " << mp1.
val_r(l, 1., M_PI/2, 0) / km ;
322 ost <<
"# VE(M) VE(M) [vol]" << endl ;
325 ost.setf(ios::scientific) ;
334 <<
" M_ADM_vol [M_sol] "
335 <<
" M_Komar [M_sol] "
336 <<
" M_Komar_vol [M_sol] "
337 <<
" J [G M_sol^2/c] " << endl ;
344 ost <<
omega / (2*M_PI)* f_unit ; ost.width(22) ;
345 ost <<
mass_adm() / msol ; ost.width(22) ;
347 ost <<
mass_kom() / msol ; ost.width(22) ;
349 ost <<
angu_mom()(2)/ ( qpig / (4* M_PI) * msol*msol) << endl ;
351 ost <<
"# H_c(1)[c^2] "
352 <<
" e_c(1)[rho_nuc] "
353 <<
" M_B(1) [M_sol] "
357 <<
" chi1 " << endl ;
366 ost << chi1 << endl ;
368 ost <<
"# H_c(2)[c^2] "
369 <<
" e_c(2)[rho_nuc] "
370 <<
" M_B(2) [M_sol] "
374 <<
" chi2 " << endl ;
384 ost << chi2 << endl ;
393 double kappa = p_eos_poly->
get_kap() ;
394 double gamma = p_eos_poly->
get_gam() ; ;
395 double kap_ns2 =
pow( kappa, 0.5 /(gamma-1.) ) ;
398 double r_poly = kap_ns2 /
sqrt(ggrav) ;
401 double t_poly = r_poly ;
404 double m_poly = r_poly / ggrav ;
407 double j_poly = r_poly * r_poly / ggrav ;
415 <<
" M_B(2) [poly] " << endl ;
418 ost <<
separation() / r_poly ; ost.width(22) ;
420 ost <<
omega * t_poly ; ost.width(22) ;
421 ost <<
mass_adm() / m_poly ; ost.width(22) ;
422 ost <<
angu_mom()(2) / j_poly ; ost.width(22) ;
440 return sqrt( dx*dx + dy*dy + dz*dz ) ;
Binary systems in eXtended Conformal Thin Sandwich formulation.
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
double virial_vol() const
Estimates the relative error on the virial theorem (volume version)
double * p_mass_kom
Total Komar mass of the system.
double x_axe
Absolute X coordinate of the rotation axis.
void write_global(ostream &) const
Write global quantities in a formatted file.
Star_bin_xcts star2
Second star of the system.
double mass_adm_vol() const
Total ADM mass (computed by a volume integral)
double * p_virial_vol
Virial theorem error (volume version)
Tbl * p_lin_mom
Total linear momentum of the system.
void operator=(const Binary_xcts &)
Assignment to another Binary_xcts.
double mass_kom_vol() const
Total Komar mass (computed by a volume integral)
Star_bin_xcts star1
First star of the system.
void sauve(FILE *) const
Save in a file.
double mass_adm() const
Total ADM mass.
double separation() const
Returns the coordinate separation of the two stellar centers [r_unit].
void del_deriv() const
Deletes all the derived quantities.
Binary_xcts(Map &mp1, int nzet1, const Eos &eos1, int irrot1, Map &mp2, int nzet2, const Eos &eos2, int irrot2)
Standard constructor.
double * p_mass_adm
Total ADM mass of the system.
double * p_total_ener
Total energy of the system.
void display_poly(ostream &) const
Display in polytropic units.
ostream & operator>>(ostream &) const
Operator >> (function called by the operator <<).
double mass_kom() const
Total Komar mass.
~Binary_xcts()
Destructor.
double virial() const
Estimates the relative error on the virial theorem.
Tbl * p_angu_mom
Total angular momentum of the system.
Star_bin_xcts * et[2]
Array of the two stars (to perform loops on the stars): et[0] contains the address of star1 and et[1]...
double * p_virial
Virial theorem error.
const Tbl & angu_mom() const
Total angular momentum.
double omega
Angular velocity with respect to an asymptotically inertial observer.
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.
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.
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
virtual double xa_barycenter() const
Absolute coordinate X of the barycenter of the baryon density,.
virtual void sauve(FILE *) const
Save in a file.
virtual double mass_b() const
Baryon mass.
const Map & get_mp() const
Returns the mapping.
const Eos & get_eos() const
Returns the equation of state.
const Scalar & get_ener() const
Returns the proper total energy density.
double ray_eq() const
Coordinate radius at , [r_unit].
double ray_eq_pis2() const
Coordinate radius at , [r_unit].
const Scalar & get_ent() const
Returns the enthalpy field.
double ray_eq_pi() const
Coordinate radius at , [r_unit].
Map & mp
Mapping associated with the star.
double ray_pole() const
Coordinate radius at [r_unit].
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.