31 char et_rot_isco_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_isco.C,v 1.6 2014/10/13 08:52:58 j_novak Exp $" ;
74 #include "utilitaires.h" 77 double fonct_etoile_rot_isco(
double,
const Param&) ;
122 Cmp ucor_plus = (r2 * bsn * dnphi +
123 sqrt ( r2 * r2 * bsn *bsn * dnphi * dnphi +
124 4 * r2 * bdlog * ndlog + 4 * r * ndlog) ) /
125 2 / (1 + r * bdlog ) ;
127 Cmp factor_u2 = r2 * (2 * ddbbb /
bbb() - 2 * bdlog * bdlog +
128 4 * bdlog * ndlog ) +
129 2 * r2 * r2 * bsn * bsn * dnphi * dnphi +
130 4 * r * ( ndlog - bdlog ) - 6 ;
132 Cmp factor_u1 = 2 * r * r2 * bsn * ( 2 * ( ndlog - bdlog ) *
135 Cmp factor_u0 = - r2 * ( 2 * ddnnn /
nnn() - 2 * ndlog * ndlog +
136 4 * bdlog * ndlog ) ;
139 Cmp orbit = factor_u2 * ucor_plus * ucor_plus +
140 factor_u1 * ucor_plus + factor_u0 ;
146 double r_ms, theta_ms, phi_ms, xi_ms,
147 xi_min = -1, xi_max = 1;
149 bool find_status = false ;
151 const Valeur& vorbit = orbit.va ;
153 for(l =
nzet; l <= nzm1; l++) {
157 theta_ms = M_PI / 2. ;
164 double xi_f = xi_min;
166 double resloc = vorbit.
val_point(l, xi_min, theta_ms, phi_ms) ;
168 for (
int iloc=0; iloc<200; iloc++) {
170 resloc_old = resloc ;
171 resloc = vorbit.
val_point(l, xi_f, theta_ms, phi_ms) ;
172 if ( resloc * resloc_old <
double(0) ) {
173 xi_min = xi_f - 0.01 ;
190 double precis_ms = 1.e-13 ;
191 int nitermax_ms = 200 ;
194 xi_ms =
zerosec(fonct_etoile_rot_isco, par_ms, xi_min, xi_max,
195 precis_ms, nitermax_ms, niter,
false) ;
197 if (niter > nitermax_ms) {
198 cerr <<
"Etoile_rot::r_isco : " << endl ;
199 cerr <<
"result may be wrong ... " << endl ;
200 cerr <<
"Continuing." << endl ;
205 " number of iterations used in zerosec to locate the ISCO : " 207 *ost <<
" zero found at xi = " << xi_ms << endl ;
210 r_ms =
mp.
val_r(l_ms, xi_ms, theta_ms, phi_ms) ;
221 p_r_isco =
new double ((
bbb().va).val_point(l_ms, xi_ms, theta_ms, phi_ms)
228 double ucor_msplus = (ucor_plus.
va).val_point(l_ms, xi_ms, theta_ms,
230 double nobrs = (bsn.va).val_point(l_ms, xi_ms, theta_ms, phi_ms) ;
231 double nphirs = (
nphi().va).val_point(l_ms, xi_ms, theta_ms, phi_ms) ;
233 p_f_isco =
new double ( ( ucor_msplus / nobrs / r_ms + nphirs ) /
234 (
double(2) * M_PI) ) ;
239 ((
bbb().va).val_point(l_ms, xi_ms, theta_ms, phi_ms)) * r_ms );
243 p_espec_isco=
new double (( 1./nobrs / r_ms / ucor_msplus + nphirs) *
244 (ucor_msplus/
sqrt(1.-ucor_msplus*ucor_msplus)*
245 ((
bbb().va).val_point(l_ms, xi_ms, theta_ms, phi_ms)) * r_ms ));
250 double ucor_eqplus = (ucor_plus.
va).val_point(l_ms, -1, theta_ms, phi_ms) ;
251 double nobeq = (bsn.va).val_point(l_ms, -1, theta_ms, phi_ms) ;
252 double nphieq = (
nphi().va).val_point(l_ms, -1, theta_ms, phi_ms) ;
254 p_f_eq =
new double ( ( ucor_eqplus / nobeq /
ray_eq() + nphieq ) /
255 (
double(2) * M_PI) ) ;
338 double fonct_etoile_rot_isco(
double xi,
const Param& par){
346 double theta = M_PI / 2. ;
348 return vorbit.
val_point(l_ms, xi, theta, phi) ;
const Cmp & dsdr() const
Returns of *this .
const Cmp & get_cmp(int position=0) const
Returns the reference of a Cmp stored in the list.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
virtual double lspec_isco() const
Angular momentum of a particle on the ISCO.
double * p_r_isco
Circumferential radius of the ISCO.
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.
void annule(int l)
Sets the Cmp to zero in a given domain.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Tenseur nnn
Total lapse function.
Tenseur nphi
Metric coefficient .
double ray_eq() const
Coordinate radius at , [r_unit].
Values and coefficients of a (real-value) function.
virtual double r_isco(ostream *ost=0x0) const
Circumferential radius of the innermost stable circular orbit (ISCO).
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 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.
void add_cmp(const Cmp &ti, int position=0)
Adds the address of a new Cmp to the list.
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 ...
Map & mp
Mapping associated with the star.
int get_nzone() const
Returns the number of domains.
virtual double espec_isco() const
Energy of a particle on the ISCO.
double * p_f_isco
Orbital frequency of the ISCO.
virtual double f_eq() const
Orbital frequency at the equator.
Tenseur bbb
Metric factor B.
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
int nzet
Number of domains of *mp occupied by the star.
double * p_lspec_isco
Specific angular momentum of a particle on the ISCO.
virtual double f_isco() const
Orbital frequency at the innermost stable circular orbit (ISCO).
Valeur va
The numerical value of the Cmp.
double * p_espec_isco
Specific energy of a particle on the ISCO.
Coord r
r coordinate centered on the grid
double * p_f_eq
Orbital frequency at the equator.