00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 char bin_bhns_extr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_bhns_extr/bin_bhns_extr.C,v 1.8 2005/02/28 23:06:16 k_taniguchi Exp $" ;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 #include <math.h>
00065
00066
00067 #include "bin_bhns_extr.h"
00068 #include "eos.h"
00069 #include "utilitaires.h"
00070 #include "unites.h"
00071
00072
00073
00074
00075
00076
00077
00078 Bin_bhns_extr::Bin_bhns_extr(Map& mp, int nzet, const Eos& eos, bool irrot,
00079 bool relat, bool kerrs, bool multi)
00080 : ref_triad(0., "Absolute frame Cartesian basis"),
00081 star(mp, nzet, relat, eos, irrot, ref_triad, kerrs, multi)
00082 {
00083
00084 omega = 0. ;
00085 separ = 0. ;
00086 mass_bh = 0. ;
00087
00088
00089 set_der_0x0() ;
00090
00091 }
00092
00093
00094
00095 Bin_bhns_extr::Bin_bhns_extr(const Bin_bhns_extr& bibi)
00096 : ref_triad(0., "Absolute frame Cartesian basis"),
00097 star(bibi.star),
00098 omega(bibi.omega),
00099 separ(bibi.separ),
00100 mass_bh(bibi.mass_bh)
00101 {
00102
00103
00104 set_der_0x0() ;
00105
00106 }
00107
00108
00109
00110 Bin_bhns_extr::Bin_bhns_extr(Map& mp, const Eos& eos, FILE* fich)
00111 : ref_triad(0., "Absolute frame Cartesian basis"),
00112 star(mp, eos, ref_triad, fich)
00113 {
00114
00115
00116 fread_be(&omega, sizeof(double), 1, fich) ;
00117 fread_be(&separ, sizeof(double), 1, fich) ;
00118 fread_be(&mass_bh, sizeof(double), 1, fich) ;
00119
00120
00121 set_der_0x0() ;
00122
00123 }
00124
00125
00126
00127
00128
00129 Bin_bhns_extr::~Bin_bhns_extr()
00130 {
00131 del_deriv() ;
00132 }
00133
00134
00135
00136
00137
00138 void Bin_bhns_extr::del_deriv() const {
00139
00140 if (p_xa_barycenter_extr != 0x0) delete p_xa_barycenter_extr ;
00141 if (p_ya_barycenter_extr != 0x0) delete p_ya_barycenter_extr ;
00142 if (p_mass_b_extr != 0x0) delete p_mass_b_extr ;
00143
00144 set_der_0x0() ;
00145
00146 }
00147
00148 void Bin_bhns_extr::set_der_0x0() const {
00149
00150 p_xa_barycenter_extr = 0x0 ;
00151 p_ya_barycenter_extr = 0x0 ;
00152 p_mass_b_extr = 0x0 ;
00153
00154 }
00155
00156
00157
00158
00159
00160
00161
00162 void Bin_bhns_extr::operator=(const Bin_bhns_extr& bibi) {
00163
00164 assert( bibi.ref_triad == ref_triad ) ;
00165
00166 star = bibi.star ;
00167
00168 omega = bibi.omega ;
00169 separ = bibi.separ ;
00170 mass_bh = bibi.mass_bh ;
00171
00172
00173
00174 del_deriv() ;
00175
00176 }
00177
00178
00179
00180
00181
00182
00183
00184 void Bin_bhns_extr::sauve(FILE* fich) const {
00185
00186 star.sauve(fich) ;
00187
00188 fwrite_be(&omega, sizeof(double), 1, fich) ;
00189 fwrite_be(&separ, sizeof(double), 1, fich) ;
00190 fwrite_be(&mass_bh, sizeof(double), 1, fich) ;
00191
00192 }
00193
00194
00195
00196 ostream& operator<<(ostream& ost, const Bin_bhns_extr& bibi) {
00197
00198 bibi >> ost ;
00199 return ost ;
00200
00201 }
00202
00203 ostream& Bin_bhns_extr::operator>>(ostream& ost) const {
00204
00205 using namespace Unites ;
00206
00207 ost << endl ;
00208 ost << "Binary BH-NS system" << endl ;
00209 ost << "===================" << endl ;
00210 ost << endl ;
00211 if (star.in_kerrschild()) {
00212 ost << "Kerr-Schild background metric" << endl ;
00213 ost << "-----------------------------" << endl ;
00214 }
00215 else {
00216 ost << "Conformally flat background metric" << endl ;
00217 ost << "----------------------------------" << endl ;
00218 }
00219 if (star.with_multipole()) {
00220 ost << "Multipole falloff boundary condition" << endl ;
00221 ost << "------------------------------------" << endl ;
00222 }
00223 else {
00224 ost << "1/r falloff boundary condition" << endl ;
00225 ost << "------------------------------" << endl ;
00226 }
00227 ost << endl
00228 << "Orbital angular velocity : "
00229 << omega * f_unit << " rad/s" << endl ;
00230 ost << "Coordinate separation between BH and NS : "
00231 << separ / km << " km" << endl ;
00232
00233 ost << endl << "Neutron star : " ;
00234 ost << endl << "============ " << endl ;
00235 ost << endl ;
00236 if (star.is_relativistic()) {
00237 ost << "Relativistic star" << endl ;
00238 ost << "-----------------" << endl ;
00239 }
00240 else {
00241 ost << "WARNING : BH-NS binary should be relativistic !!!" << endl ;
00242 ost << "-------------------------------------------------" << endl ;
00243 }
00244 ost << "Number of domains occupied by the star : " << star.get_nzet()
00245 << endl ;
00246 ost << "Equation of state : " << endl ;
00247 ost << star.get_eos() << endl ;
00248
00249 ost << endl
00250 << "Enthalpy at the coordinate origin : "
00251 << star.get_ent()()(0,0,0,0) << " c^2" << endl ;
00252 ost << "Proper baryon density at the coordinate origin : "
00253 << star.get_nbar()()(0,0,0,0) << " x 0.1 fm^-3" << endl ;
00254 ost << "Proper energy density at the coordinate origin : "
00255 << star.get_ener()()(0,0,0,0) << " rho_nuc c^2" << endl ;
00256 ost << "Pressure at the coordinate origin : "
00257 << star.get_press()()(0,0,0,0) << " rho_nuc c^2" << endl ;
00258 ost << endl
00259 << "Lapse N at the coordinate origin : "
00260 << star.get_nnn()()(0,0,0,0) << endl ;
00261 ost << "Conformal factor A^2 at the coordinate origin : "
00262 << star.get_a_car()()(0,0,0,0) << endl ;
00263
00264 ost << endl
00265 << "Equatorial radius (to BH) a_to : "
00266 << star.ray_eq_pi()/km << " km" << endl ;
00267 ost << "Equatorial radius (opp. to BH) a_opp : "
00268 << star.ray_eq()/km << " km" << endl ;
00269
00270 ost << endl
00271 << "Baryon mass in isolation : " << star.mass_b() / msol
00272 << " Mo" << endl
00273 << "Gravitational mass in isolation : " << star.mass_g() / msol
00274 << " Mo" << endl
00275 << "Baryon mass in a binary system : " << mass_b_extr() / msol
00276 << " Mo" << endl ;
00277
00278 ost << endl ;
00279 ost << "Star in a binary system" << endl ;
00280 ost << "-----------------------" << endl ;
00281
00282 if (star.is_irrotational()) {
00283 ost << "irrotational configuration" << endl ;
00284 }
00285 else {
00286 ost << "corotating configuration" << endl ;
00287 }
00288
00289 ost << "Absolute abscidia of the stellar center: "
00290 << star.get_mp().get_ori_x()/km << " km" << endl ;
00291 ost << "Orientation with respect to the absolute frame : "
00292 << star.get_mp().get_rot_phi() << " rad" << endl ;
00293
00294 double r0 = 0.5 * ( star.ray_eq() + star.ray_eq_pi() ) ;
00295
00296 double d_ns = separ + star.ray_eq() - r0 ;
00297
00298 double d_tilde = d_ns / r0 ;
00299
00300 ost << endl << "Comparison with those by Baumgarte et al. :" << endl ;
00301 ost << " Radius r0 : " << r0 / km << " km " << endl ;
00302 ost << " Separation d : " << d_ns / km << " km " << endl ;
00303 ost << " Normalized sep. (d/r0) : " << d_tilde << endl ;
00304
00305 ost << endl << "Black hole : " ;
00306 ost << endl << "========== " << endl ;
00307 ost << "Gravitational mass of BH : "
00308 << mass_bh / msol << " M_sol" << endl ;
00309
00310 return ost ;
00311
00312 }
00313
00314
00315
00316 void Bin_bhns_extr::display_poly(ostream& ost) const {
00317
00318 using namespace Unites ;
00319
00320 const Eos* p_eos = &( star.get_eos() ) ;
00321 const Eos_poly* p_eos_poly = dynamic_cast<const Eos_poly*>( p_eos ) ;
00322
00323 if (p_eos_poly != 0x0) {
00324
00325 double kappa = p_eos_poly->get_kap() ;
00326 double gamma = p_eos_poly->get_gam() ;
00327 double kap_ns2 = pow( kappa, 0.5 /(gamma-1) ) ;
00328
00329
00330 double r_poly = kap_ns2 / sqrt(ggrav) ;
00331
00332
00333 double t_poly = r_poly ;
00334
00335
00336 double m_poly = r_poly / ggrav ;
00337
00338
00339
00340
00341 double r0 = 0.5 * ( star.ray_eq() + star.ray_eq_pi() ) ;
00342
00343 double d_ns = separ + star.ray_eq() - r0 ;
00344
00345
00346 ost.precision(16) ;
00347 ost << endl << "Quantities in polytropic units : " ;
00348 ost << endl << "==============================" << endl ;
00349 ost << " ( r_poly = " << r_poly / km << " km )" << endl ;
00350 ost << " d_e_max : " << separ / r_poly << endl ;
00351 ost << " d_G_x : " << xa_barycenter_extr() / r_poly << endl
00352 << " d_G_y : " << ya_barycenter_extr() / r_poly << endl ;
00353 ost << " d_bh/M_bh : " << d_ns/r_poly / (mass_bh/m_poly) << endl ;
00354 ost << " Omega : " << omega * t_poly << endl ;
00355 ost << " Omega M_bh : " << omega * t_poly * mass_bh / m_poly
00356 << endl ;
00357 ost << " M_bar(NS) : " << mass_b_extr() / m_poly << endl ;
00358 ost << " M_bar(NS_0) : " << star.mass_b() / m_poly << endl ;
00359 ost << " R_0(NS) : "
00360 << 0.5 * (star.ray_eq() + star.ray_eq_pi()) / r_poly << endl ;
00361 ost << " M_grv(BH) : " << mass_bh / m_poly << endl ;
00362
00363 }
00364
00365 }