75 if (
hole.is_kerrschild()) {
81 double dnulg, p6sl2, dp6sl2 ;
82 double shiftx, shifty, dshiftx, dshifty, shift2, dshift2 ;
83 double x_orb, y_orb, y_separ, xbh_orb, mhsr ;
87 const Scalar& lapconf =
star.get_lapconf_tot() ;
88 const Scalar& lapconf_auto =
star.get_lapconf_auto() ;
90 const Scalar& confo_auto =
star.get_confo_auto() ;
93 const Vector& shift_auto =
star.get_shift_auto() ;
95 const Vector& dlapconf_comp =
star.get_d_lapconf_comp() ;
96 const Vector& dconfo_comp =
star.get_d_confo_comp() ;
97 const Tensor& dshift_comp =
star.get_d_shift_comp() ;
99 const double& massbh =
hole.get_mass_bh() ;
100 double mass = ggrav * massbh ;
109 if (fabs(mp.get_rot_phi()) < 1.e-14) {
113 if (fabs(mp.get_rot_phi() - M_PI) < 1.e-14) {
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) ;
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)) ) ;
214 x_orb = (
star.get_mp()).get_ori_x() -
x_rot ;
215 y_orb = (
star.get_mp()).get_ori_y() -
y_rot ;
216 y_separ = (
star.get_mp()).get_ori_y() - (
hole.get_mp()).get_ori_y() ;
218 xbh_orb = (
hole.get_mp()).get_ori_x() -
x_rot ;
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 ;
358 const Map& mp =
star.get_mp() ;
360 const Scalar& lapconf =
star.get_lapconf_tot() ;
361 const Scalar& lapconf_auto =
star.get_lapconf_auto() ;
363 const Scalar& confo_auto =
star.get_confo_auto() ;
366 const Vector& shift_auto =
star.get_shift_auto() ;
368 const Vector& dlapconf_comp =
star.get_d_lapconf_comp() ;
369 const Vector& dconfo_comp =
star.get_d_confo_comp() ;
370 const Tensor& dshift_comp =
star.get_d_shift_comp() ;
379 if (fabs(mp.get_rot_phi()) < 1.e-14) {
383 if (fabs(mp.get_rot_phi() - M_PI) < 1.e-14) {
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) ;
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)) ) ;
484 x_orb = (
star.get_mp()).get_ori_x() -
x_rot ;
485 y_orb = (
star.get_mp()).get_ori_y() -
y_rot ;
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 ;