62 #include "utilitaires.h" 66 double func_binbhns_orbit_ks(
double ,
const Param& ) ;
67 double func_binbhns_orbit_is(
double ,
const Param& ) ;
81 double dnulg, p6sl2, dp6sl2 ;
82 double shiftx, shifty, dshiftx, dshifty, shift2, dshift2 ;
83 double x_orb, y_orb, y_separ, xbh_orb, mhsr ;
100 double mass = ggrav * massbh ;
117 cout <<
"Bin_bhns::orbit_omega : unknown value of rot_phi !" 128 dnulg = factx * ( ((lapconf_auto.
dsdx()).val_grid_point(0,0,0,0)
129 + dlapconf_comp(1).val_grid_point(0,0,0,0))
131 - ((confo_auto.
dsdx()).val_grid_point(0,0,0,0)
132 + dconfo_comp(1).val_grid_point(0,0,0,0))
134 + (tmp1.
dsdx()).val_grid_point(0,0,0,0) ) ;
144 p6sl2 =
pow(confo_c,6.) / lapconf_c / lapconf_c ;
151 double dlapconf_c = factx *
152 ( (lapconf_auto.
dsdx()).val_grid_point(0,0,0,0)
153 + dlapconf_comp(1).val_grid_point(0,0,0,0) ) ;
155 double dpsi6_c = 6. * factx *
pow(confo_c,5.)
156 * ((confo_auto.
dsdx()).val_grid_point(0,0,0,0)
157 + dconfo_comp(1).val_grid_point(0,0,0,0)) ;
159 dp6sl2 = (dpsi6_c - 2.*
pow(confo_c,6.)*dlapconf_c/lapconf_c)
160 / lapconf_c / lapconf_c ;
167 shiftx = shift(1).val_grid_point(0,0,0,0) ;
168 shifty = shift(2).val_grid_point(0,0,0,0) ;
175 dshiftx = factx * ((shift_auto(1).dsdx()).val_grid_point(0,0,0,0)
176 + dshift_comp(1,1).val_grid_point(0,0,0,0)) ;
178 dshifty = factx * ((shift_auto(2).dsdx()).val_grid_point(0,0,0,0)
179 + dshift_comp(1,2).val_grid_point(0,0,0,0)) ;
188 tmp2 = shift(1)%shift(1) + shift(2)%shift(2) + shift(3)%shift(3) ;
189 tmp2.std_spectral_base() ;
191 shift2 = tmp2.val_grid_point(0,0,0,0) ;
199 dshift2 = 2.*factx*((shift(1).val_grid_point(0,0,0,0))
200 * ((shift_auto(1).dsdx()).val_grid_point(0,0,0,0)
201 + dshift_comp(1,1).val_grid_point(0,0,0,0))
202 +(shift(2).val_grid_point(0,0,0,0))
203 * ((shift_auto(2).dsdx()).val_grid_point(0,0,0,0)
204 + dshift_comp(1,2).val_grid_point(0,0,0,0))
205 +(shift(3).val_grid_point(0,0,0,0))
206 * ((shift_auto(3).dsdx()).val_grid_point(0,0,0,0)
207 + dshift_comp(1,3).val_grid_point(0,0,0,0)) ) ;
229 cout <<
"Bin_bhns::orbit_omega: central d(log(lap)+log(Gam))/dX : " 231 cout <<
"Bin_bhns::orbit_omega: central psi^6/lapconf^2 : " 233 cout <<
"Bin_bhns::orbit_omega: central d(psi^6/lapconf^2)/dX : " 235 cout <<
"Bin_bhns::orbit_omega: central shift^X : " 237 cout <<
"Bin_bhns::orbit_omega: central shift^Y : " 239 cout <<
"Bin_bhns::orbit_omega: central d(shift^X)/dX : " 241 cout <<
"Bin_bhns::orbit_omega: central d(shift^Y)/dX : " 243 cout <<
"Bin_bhns::orbit_omega: central shift^i shift_i : " 245 cout <<
"Bin_bhns::orbit_omega: central d(shift^i shift_i)/dX : " 270 double omega1 = fact_omeg_min *
omega ;
271 double omega2 = fact_omeg_max *
omega ;
273 cout <<
"Bin_bhns::orbit_omega: omega1, omega2 [rad/s] : " 274 << omega1 * f_unit <<
" " << omega2 * f_unit << endl ;
282 zero_list(func_binbhns_orbit_ks, parorb, omega1, omega2, nsub,
288 double omeg_min, omeg_max ;
291 cout <<
"Bin_bhns::orbit_omega: " << nzer
292 <<
" zero(s) found in the interval [omega1, omega2]." << endl ;
293 cout <<
"omega, omega1, omega2 : " <<
omega <<
" " << omega1
294 <<
" " << omega2 << endl ;
295 cout <<
"azer : " << *azer << endl ;
296 cout <<
"bzer : " << *bzer << endl ;
300 "Bin_bhns::orbit_omega: WARNING : no zero detected in the interval" 301 << endl <<
" [" << omega1 * f_unit <<
", " 302 << omega2 * f_unit <<
"] rad/s !" << endl ;
307 double dist_min = fabs(omega2 - omega1) ;
308 int i_dist_min = -1 ;
309 for (
int i=0; i<nzer; i++) {
313 double dist = fabs(
omega - 0.5 * ( (*azer)(i) + (*bzer)(i) ) ) ;
315 if (dist < dist_min) {
320 omeg_min = (*azer)(i_dist_min) ;
321 omeg_max = (*bzer)(i_dist_min) ;
327 cout <<
"Bin_bhns::orbit_omega: interval selected for the search of the zero : " 328 << endl <<
" [" << omeg_min <<
", " << omeg_max <<
"] = [" 329 << omeg_min * f_unit <<
", " << omeg_max * f_unit <<
"] rad/s " << endl ;
336 double precis = 1.e-13 ;
337 omega =
zerosec_b(func_binbhns_orbit_ks, parorb, omeg_min, omeg_max,
338 precis, nitermax, niter) ;
340 cout <<
"Bin_bhns::orbit_omega: Number of iterations in zerosec for omega : " 343 cout <<
"Bin_bhns::orbit_omega: omega [rad/s] : " 344 <<
omega * f_unit << endl ;
354 double dnulg, p6sl2, dp6sl2 ;
355 double shiftx, shifty, dshiftx, dshifty, shift2, dshift2 ;
356 double x_orb, y_orb ;
387 cout <<
"Bin_bhns::orbit_omega: unknown value of rot_phi !" 398 dnulg = factx * ( ((lapconf_auto.
dsdx()).val_grid_point(0,0,0,0)
399 + dlapconf_comp(1).val_grid_point(0,0,0,0))
401 - ((confo_auto.
dsdx()).val_grid_point(0,0,0,0)
402 + dconfo_comp(1).val_grid_point(0,0,0,0))
404 + (tmp1.
dsdx()).val_grid_point(0,0,0,0) ) ;
414 p6sl2 =
pow(confo_c,6.) / lapconf_c / lapconf_c ;
421 double dlapconf_c = factx *
422 ( (lapconf_auto.
dsdx()).val_grid_point(0,0,0,0)
423 + dlapconf_comp(1).val_grid_point(0,0,0,0) ) ;
425 double dpsi6_c = 6. * factx *
pow(confo_c,5.)
426 * ((confo_auto.
dsdx()).val_grid_point(0,0,0,0)
427 + dconfo_comp(1).val_grid_point(0,0,0,0)) ;
429 dp6sl2 = (dpsi6_c - 2.*
pow(confo_c,6.)*dlapconf_c/lapconf_c)
430 / lapconf_c / lapconf_c ;
437 shiftx = shift(1).val_grid_point(0,0,0,0) ;
438 shifty = shift(2).val_grid_point(0,0,0,0) ;
445 dshiftx = factx * ( (shift_auto(1).dsdx()).val_grid_point(0,0,0,0)
446 + dshift_comp(1,1).val_grid_point(0,0,0,0) ) ;
448 dshifty = factx * ( (shift_auto(2).dsdx()).val_grid_point(0,0,0,0)
449 + dshift_comp(1,2).val_grid_point(0,0,0,0) ) ;
458 tmp2 = shift(1)%shift(1) + shift(2)%shift(2) + shift(3)%shift(3) ;
459 tmp2.std_spectral_base() ;
461 shift2 = tmp2.val_grid_point(0,0,0,0) ;
469 dshift2 = 2.*factx*( (shift(1).val_grid_point(0,0,0,0))
470 * ((shift_auto(1).dsdx()).val_grid_point(0,0,0,0)
471 + dshift_comp(1,1).val_grid_point(0,0,0,0))
472 +(shift(2).val_grid_point(0,0,0,0))
473 * ((shift_auto(2).dsdx()).val_grid_point(0,0,0,0)
474 + dshift_comp(1,2).val_grid_point(0,0,0,0))
475 +(shift(3).val_grid_point(0,0,0,0))
476 * ((shift_auto(3).dsdx()).val_grid_point(0,0,0,0)
477 + dshift_comp(1,3).val_grid_point(0,0,0,0)) ) ;
491 cout <<
"Bin_bhns::orbit_omega: central d(log(lap)+log(Gam))/dX : " 493 cout <<
"Bin_bhns::orbit_omega: central psi^6/lapconf^2 : " 495 cout <<
"Bin_bhns::orbit_omega: central d(psi^6/lapconf^2)/dX : " 497 cout <<
"Bin_bhns::orbit_omega: central shift^X : " 499 cout <<
"Bin_bhns::orbit_omega: central shift^Y : " 501 cout <<
"Bin_bhns::orbit_omega: central d(shift^X)/dX : " 503 cout <<
"Bin_bhns::orbit_omega: central d(shift^Y)/dX : " 505 cout <<
"Bin_bhns::orbit_omega: central shift^i shift_i : " 507 cout <<
"Bin_bhns::orbit_omega: central d(shift^i shift_i)/dX : " 528 double omega1 = fact_omeg_min *
omega ;
529 double omega2 = fact_omeg_max *
omega ;
531 cout <<
"Bin_bhns::orbit_omega: omega1, omega2 [rad/s] : " 532 << omega1 * f_unit <<
" " << omega2 * f_unit << endl ;
540 zero_list(func_binbhns_orbit_is, parorb, omega1, omega2, nsub,
546 double omeg_min, omeg_max ;
549 cout <<
"Bin_bhns::orbit_omega: " << nzer
550 <<
" zero(s) found in the interval [omega1, omega2]." << endl ;
551 cout <<
"omega, omega1, omega2 : " <<
omega <<
" " << omega1
552 <<
" " << omega2 << endl ;
553 cout <<
"azer : " << *azer << endl ;
554 cout <<
"bzer : " << *bzer << endl ;
558 "Bin_bhns::orbit_omega: WARNING : no zero detected in the interval" 559 << endl <<
" [" << omega1 * f_unit <<
", " 560 << omega2 * f_unit <<
"] rad/s !" << endl ;
565 double dist_min = fabs(omega2 - omega1) ;
566 int i_dist_min = -1 ;
567 for (
int i=0; i<nzer; i++) {
571 double dist = fabs(
omega - 0.5 * ( (*azer)(i) + (*bzer)(i) ) ) ;
573 if (dist < dist_min) {
578 omeg_min = (*azer)(i_dist_min) ;
579 omeg_max = (*bzer)(i_dist_min) ;
585 cout <<
"Bin_bhns::orbit_omega: interval selected for the search of the zero : " 586 << endl <<
" [" << omeg_min <<
", " << omeg_max <<
"] = [" 587 << omeg_min * f_unit <<
", " << omeg_max * f_unit <<
"] rad/s " << endl ;
594 double precis = 1.e-13 ;
595 omega =
zerosec_b(func_binbhns_orbit_is, parorb, omeg_min, omeg_max,
596 precis, nitermax, niter) ;
598 cout <<
"Bin_bhns::orbit_omega: Number of iterations in zerosec for omega : " 601 cout <<
"Bin_bhns::orbit_omega: omega [rad/s] : " 602 <<
omega * f_unit << endl ;
611 double func_binbhns_orbit_ks(
double om,
const Param& parorb) {
629 double om2 = om * om ;
638 double bpb = om2 * (x_orb * x_orb + y_orb * y_orb
639 + 2.*mhsr*(x_separ*x_separ+y_separ*y_separ)
640 * y_separ * y_separ * xbh_orb * xbh_orb)
641 + 2.*om*(shifty * x_orb - shiftx * y_orb
642 + 2.*mhsr*(x_separ*x_separ+y_separ*y_separ)
643 * (shiftx*x_separ + shifty*y_separ) * y_separ * xbh_orb)
644 + shift2 + 2.*mhsr*(x_separ*x_separ+y_separ*y_separ)
645 * (shiftx*x_separ + shifty*y_separ)
646 * (shiftx*x_separ + shifty*y_separ) ;
650 + p6sl2 * (0.5*dshift2
651 + om * (shifty - dshiftx*y_orb + dshifty*x_orb)
653 - mhsr * x_separ * (x_separ*shiftx+y_separ*shifty)
654 * (x_separ*shiftx+y_separ*shifty)
655 + 2. * mhsr * (x_separ*shiftx+y_separ*shifty)
656 * (y_separ*y_separ*shiftx - x_separ*y_separ*shifty
657 +(x_separ*x_separ+y_separ*y_separ)*(x_separ*dshiftx
659 + 2. * mhsr * om * y_separ * xbh_orb
660 * ( (y_separ*y_separ-2.*x_separ*x_separ)*shiftx
661 - 3. * x_separ * y_separ * shifty
662 +(x_separ*x_separ+y_separ*y_separ)*(x_separ*dshiftx
664 - 3. * mhsr * om2 * x_separ * y_separ * y_separ * xbh_orb
666 ) / (1 - p6sl2 * bpb) ;
668 return dnulg - dlngam0 ;
672 double func_binbhns_orbit_is(
double om,
const Param& parorb) {
674 double dnulg = parorb.get_double(0) ;
675 double p6sl2 = parorb.get_double(1) ;
676 double dp6sl2 = parorb.get_double(2) ;
677 double shiftx = parorb.get_double(3) ;
678 double shifty = parorb.get_double(4) ;
679 double dshiftx = parorb.get_double(5) ;
680 double dshifty = parorb.get_double(6) ;
681 double shift2 = parorb.get_double(7) ;
682 double dshift2 = parorb.get_double(8) ;
683 double x_orb = parorb.get_double(9) ;
684 double y_orb = parorb.get_double(10) ;
686 double om2 = om * om ;
688 double bpb = om2 * (x_orb * x_orb + y_orb * y_orb)
689 + 2. * om * (shifty * x_orb - shiftx * y_orb) + shift2 ;
691 double dlngam0 = ( 0.5 * dp6sl2 * bpb
692 + p6sl2 * (0.5*dshift2
694 (shifty - dshiftx*y_orb + dshifty*x_orb)
696 ) / (1 - p6sl2 * bpb) ;
698 return dnulg - dlngam0 ;
double get_mass_bh() const
Returns the gravitational mass of BH [{ m_unit}].
Hole_bhns hole
Black hole.
void orbit_omega(double fact_omeg_min, double fact_omeg_max)
Estimates the relative error on the Hamiltonian constraint.
const Vector & get_d_lapconf_comp() const
Returns the derivative of the lapse function generated by the companion black hole.
Standard units of space, time and mass.
bool is_kerrschild() const
Returns true for a Kerr-Schild background, false for a Conformally flat one.
Tensor field of valence 0 (or component of a tensorial field).
Base class for coordinate mappings.
double zerosec_b(double(*f)(double, const Param &), const Param &par, double a, double b, double precis, int nitermax, int &niter)
Finding the zero a function on a bounded domain.
const Scalar & get_lapconf_auto() const
Returns the part of the lapconf function generated by the star.
const Scalar & dsdx() const
Returns of *this , where .
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
const Map & get_mp() const
Returns the mapping.
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
const Scalar & get_lapconf_tot() const
Returns the total lapconf function.
Tensor field of valence 1.
double separ
Absolute orbital separation between two centers of BH and NS.
const Tensor & get_d_shift_comp() const
Returns the derivative of the shift vector generated by the companion black hole. ...
double val_grid_point(int l, int k, int j, int i) const
Returns the value of the field at a specified grid point.
double omega
Angular velocity with respect to an asymptotically inertial observer.
const Vector & get_shift_auto() const
Returns the part of the shift vector generated by the star.
void zero_list(double(*f)(double, const Param &), const Param &par, double xmin, double xmax, int nsub, Tbl *&az, Tbl *&bz)
Locates approximatively all the zeros of a function in a given interval.
const Scalar & get_confo_tot() const
Returns the total conformal factor.
Star_bhns star
Neutron star.
const Map & get_mp() const
Returns the mapping.
Cmp pow(const Cmp &, int)
Power .
const Scalar & get_confo_auto() const
Returns the part of the conformal factor generated by the star.
int get_taille() const
Gives the total size (ie dim.taille)
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
const Vector & get_d_confo_comp() const
Returns the derivative of the conformal factor generated by the companion black hole.
const double & get_double(int position=0) const
Returns the reference of a double stored in the list.
const Scalar & get_loggam() const
Returns the logarithm of the Lorentz factor between the fluid and the co-orbiting observer...
double x_rot
Absolute X coordinate of the rotation axis.
const Vector & get_shift_tot() const
Returns the part total shift vector.
double y_rot
Absolute Y coordinate of the rotation axis.