82 #include "utilitaires.h" 85 double funct_compobj_QI_isco(
double,
const Param&) ;
86 double funct_compobj_QI_rmb(
double,
const Param&) ;
97 cerr <<
"Compobj_QI::angu_mom() : not implemented yet !" << endl ;
149 Scalar ucor_plus = (r2 * bsn * dnphi +
150 sqrt ( r2 * r2 * bsn *bsn * dnphi * dnphi +
151 4 * r2 * bdlog * ndlog + 4 * r * ndlog) ) /
152 2 / (1 + r * bdlog ) ;
154 Scalar factor_u2 = r2 * (2 * ddbbb /
bbb - 2 * bdlog * bdlog +
155 4 * bdlog * ndlog ) +
156 2 * r2 * r2 * bsn * bsn * dnphi * dnphi +
157 4 * r * ( ndlog - bdlog ) - 6 ;
159 Scalar factor_u1 = 2 * r * r2 * bsn * ( 2 * ( ndlog - bdlog ) *
162 Scalar factor_u0 = - r2 * ( 2 * ddnnn /
nn - 2 * ndlog * ndlog +
163 4 * bdlog * ndlog ) ;
166 Scalar orbit = factor_u2 * ucor_plus * ucor_plus +
167 factor_u1 * ucor_plus + factor_u0 ;
173 double r_ms, theta_ms, phi_ms, xi_ms,
174 xi_min = -1, xi_max = 1;
177 bool find_status = false ;
179 const Valeur& vorbit = orbit.get_spectral_va() ;
183 theta_ms = M_PI / 2. ;
186 for(l = nzm1-1; l >= lmin; l--) {
192 double xi_f = xi_min;
194 double resloc = vorbit.
val_point(l, xi_min, theta_ms, phi_ms) ;
196 for (
int iloc=0; iloc<200; iloc++) {
198 resloc_old = resloc ;
199 resloc = vorbit.
val_point(l, xi_f, theta_ms, phi_ms) ;
200 if ( resloc * resloc_old <
double(0) ) {
201 xi_min = xi_f - 0.01 ;
209 if (find_status) break ;
221 double precis_ms = 1.e-12 ;
223 int nitermax_ms = 100 ;
226 xi_ms =
zerosec(funct_compobj_QI_isco, par_ms, xi_min, xi_max,
227 precis_ms, nitermax_ms, niter) ;
229 *ost <<
"ISCO search: " << endl ;
230 *ost <<
" Domain number: " << l_ms << endl ;
231 *ost <<
" xi_min, xi_max : " << xi_min <<
" , " << xi_max << endl ;
232 *ost <<
" number of iterations used in zerosec: " << niter << endl ;
233 *ost <<
" zero found at xi = " << xi_ms << endl ;
236 r_ms =
mp.
val_r(l_ms, xi_ms, theta_ms, phi_ms) ;
257 double ucor_msplus = (ucor_plus.
get_spectral_va()).val_point(l_ms, xi_ms, theta_ms,
259 double nobrs = (bsn.get_spectral_va()).val_point(l_ms, xi_ms, theta_ms, phi_ms) ;
262 p_f_isco =
new double ( ( ucor_msplus / nobrs / r_ms + nphirs ) /
263 (
double(2) * M_PI) ) ;
272 p_espec_isco=
new double (( 1./nobrs / r_ms / ucor_msplus + nphirs) *
273 (ucor_msplus/
sqrt(1.-ucor_msplus*ucor_msplus)*
375 Scalar C1 = (A1 * B3 - A3 * B1) ;
376 Scalar C2 = (A2 * B3 - A3 * B2) ;
377 Scalar C3 = (A4 * B3 - A3 * B4) ;
380 Scalar D1 = B4 * C1 - B1 * C3 ;
381 Scalar D2 = B4 * C2 - B2 * C3 ;
382 Scalar D3 = B3 * B3 * C1 * C3 ;
383 Scalar D4 = B3 * B3 * C2 * C3 ;
402 Scalar bound_orbit = -(2.*D1*D2 + D3) -
sqrt((2.*D1*D2 + D3) * (2.*D1*D2 + D3) - 4.*D1*D1 *
403 (D2*D2 + D4)) - 2.*(D2*D2 + D4) ;
416 double zeros[2][noz] ;
420 double rmb, theta_mb, phi_mb, xi_mb;
421 double xi_min = -1, xi_max = 1 ;
431 theta_mb = M_PI / 2. ;
435 for(l = lmin; l <= nzm1; l++) {
440 double xi_f = xi_min;
442 double resloc = vorbit.
val_point(l, xi_f, theta_mb, phi_mb) ;
444 while(xi_f <= xi_max) {
448 resloc_old = resloc ;
449 resloc = vorbit.
val_point(l, xi_f, theta_mb, phi_mb) ;
451 if ( resloc * resloc_old <
double(0) ) {
465 int number_of_zeros = i ;
467 cout <<
"number of zeros: " << number_of_zeros << endl ;
470 double precis_mb = 1.e-9 ;
473 int nitermax_mb = 100 ;
476 for(
int i = 0; i < number_of_zeros; i++) {
480 int l_mb = int(zeros[1][i]) ;
481 xi_max = zeros[0][i] ;
482 xi_min = xi_max - dx ;
489 xi_mb =
zerosec(funct_compobj_QI_rmb, par_mb, xi_min, xi_max, precis_mb, nitermax_mb, niter) ;
491 *ost <<
"RMB search: " << endl ;
492 *ost <<
" Domain number: " << l_mb << endl ;
493 *ost <<
" xi_min, xi_max : " << xi_min <<
" , " << xi_max << endl ;
494 *ost <<
" number of iterations used in zerosec: " << niter << endl ;
495 *ost <<
" zero found at xi = " << xi_mb << endl ;
498 if (niter < nitermax_mb) {
499 double zero_mb =
mp.
val_r(l_mb, xi_mb, theta_mb, phi_mb) ;
502 if (zero_mb < (1 + r_ms)/2){
509 p_r_mb =
new double (rmb) ;
531 double funct_compobj_QI_isco(
double xi,
const Param& par){
539 double theta = M_PI / 2. ;
541 return vorbit.
val_point(l_ms, xi, theta, phi) ;
551 double funct_compobj_QI_rmb(
double zeros,
const Param& par){
554 int l_mb = par.get_int() ;
555 const Scalar& orbit = par.get_scalar() ;
556 const Valeur& vorbit = orbit.get_spectral_va() ;
559 double theta = M_PI / 2. ;
561 return vorbit.
val_point(l_mb, zeros, theta, phi) ;
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
Cmp sqrt(const Cmp &)
Square root.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Tensor field of valence 0 (or component of a tensorial field).
virtual double lspec_isco(int lmin) const
Angular momentum of a particle at the ISCO.
double * p_lspec_isco
Specific angular momentum of a particle at the ISCO.
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Values and coefficients of a (real-value) function.
virtual double espec_isco(int lmin) const
Energy of a particle at the ISCO.
virtual double angu_mom() const
Angular momentum.
double zerosec(double(*f)(double, const Param &), const Param &par, double a, double b, double precis, int nitermax, int &niter, bool abort=true)
Finding the zero a function.
virtual double f_isco(int lmin) const
Orbital frequency at the innermost stable circular orbit (ISCO).
Scalar nphi
Metric coefficient .
double * p_angu_mom
Angular momentum.
const Scalar & get_scalar(int position=0) const
Returns the reference of a Scalar stored in the list.
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 int & get_int(int position=0) const
Returns the reference of a int stored in the list.
virtual double r_isco(int lmin, ostream *ost=0x0) const
Coordinate r of the innermost stable circular orbit (ISCO).
double val_point(int l, double x, double theta, double phi) const
Computes the value of the field represented by *this at an arbitrary point, by means of the spectral ...
Scalar bbb
Metric factor B.
double * p_espec_isco
Specific energy of a particle at the ISCO.
int get_nzone() const
Returns the number of domains.
double * p_r_isco
Coordinate r of the ISCO.
double * p_r_mb
Coordinate r of the marginally bound orbit.
void add_scalar(const Scalar &ti, int position=0)
Adds the address of a new Scalar to the list.
double * p_f_isco
Orbital frequency of the ISCO.
Scalar nn
Lapse function N .
const Scalar & dsdr() const
Returns of *this .
virtual double r_mb(int lmin, ostream *ost=0x0) const
Coordinate r of the marginally bound circular orbit (R_mb).
const Valeur & get_spectral_va() const
Returns va (read only version)
Map & mp
Mapping describing the coordinate system (r,theta,phi)
Coord r
r coordinate centered on the grid