bin_bhns_extr_orbit.C

00001 /*
00002  *  Method of class Bin_bhns_extr to compute the orbital angular velocity
00003  *  {\tt omega}
00004  *
00005  *    (see file bin_bhns_extr.h for documentation).
00006  *
00007  */
00008 
00009 /*
00010  *   Copyright (c) 2004-2005 Keisuke Taniguchi
00011  *
00012  *   This file is part of LORENE.
00013  *
00014  *   LORENE is free software; you can redistribute it and/or modify
00015  *   it under the terms of the GNU General Public License version 2
00016  *   as published by the Free Software Foundation.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 char bin_bhns_extr_orbit_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_bhns_extr/bin_bhns_extr_orbit.C,v 1.2 2005/02/28 23:07:47 k_taniguchi Exp $" ;
00030 
00031 /*
00032  * $Id: bin_bhns_extr_orbit.C,v 1.2 2005/02/28 23:07:47 k_taniguchi Exp $
00033  * $Log: bin_bhns_extr_orbit.C,v $
00034  * Revision 1.2  2005/02/28 23:07:47  k_taniguchi
00035  * Addition of the code for the conformally flat case
00036  *
00037  * Revision 1.1  2004/11/30 20:46:57  k_taniguchi
00038  * *** empty log message ***
00039  *
00040  *
00041  * $Header: /cvsroot/Lorene/C++/Source/Bin_bhns_extr/bin_bhns_extr_orbit.C,v 1.2 2005/02/28 23:07:47 k_taniguchi Exp $
00042  *
00043  */
00044 
00045 // C headers
00046 #include <math.h>
00047 
00048 // Lorene headers
00049 #include "bin_bhns_extr.h"
00050 #include "eos.h"
00051 #include "param.h"
00052 #include "utilitaires.h"
00053 #include "unites.h"
00054 
00055 double fonc_bhns_orbit_ks(double, const Param& ) ;
00056 double fonc_bhns_orbit_cf(double, const Param& ) ;
00057 
00058 //************************************************************************
00059 
00060 void Bin_bhns_extr::orbit_omega_ks(double fact_omeg_min,
00061                    double fact_omeg_max) {
00062 
00063   using namespace Unites ;
00064 
00065     //------------------------------------------------------------------
00066     // Evaluation of various quantities at the center of a neutron star
00067     //------------------------------------------------------------------
00068 
00069     double dnulg, asn2, dasn2, nx, dnx, ny, dny, npn, dnpn ;
00070     double msr ;
00071 
00072     const Map& mp = star.get_mp() ;
00073 
00074     const Cmp& logn_auto_regu = star.get_logn_auto_regu()() ;
00075     const Cmp& loggam = star.get_loggam()() ;
00076     const Cmp& nnn = star.get_nnn()() ;
00077     const Cmp& a_car = star.get_a_car()() ;
00078     const Tenseur& shift = star.get_shift() ;
00079     const Tenseur& d_logn_auto_div = star.get_d_logn_auto_div() ;
00080 
00081     Tenseur dln_auto_div = d_logn_auto_div ;
00082 
00083     if ( *(dln_auto_div.get_triad()) != ref_triad ) {
00084 
00085         // Change the basis from spherical coordinate to Cartesian one
00086         dln_auto_div.change_triad( mp.get_bvect_cart() ) ;
00087 
00088     // Change the basis from mapping coordinate to absolute one
00089     dln_auto_div.change_triad( ref_triad ) ;
00090 
00091     }
00092 
00093     const Tenseur& d_logn_comp = star.get_d_logn_comp() ;
00094 
00095     Tenseur dln_comp = d_logn_comp ;
00096 
00097     if ( *(dln_comp.get_triad()) != ref_triad ) {
00098 
00099         // Change the basis from spherical coordinate to Cartesian one
00100         dln_comp.change_triad( mp.get_bvect_cart() ) ;
00101 
00102     // Change the basis from mapping coordinate to absolute one
00103     dln_comp.change_triad( ref_triad ) ;
00104 
00105     }
00106 
00107     //-------------------------------
00108     // Parameters with respect to BH
00109     //-------------------------------
00110 
00111     msr = ggrav * mass_bh / separ ;
00112 
00113     //-----------------------------------------------------------------
00114     // Calculation of d/dX( nu + ln(Gamma) ) at the center of the star
00115     //  ---> dnulg
00116     //-----------------------------------------------------------------
00117 
00118     // Factor for the coordinate transformation x --> X :
00119     double factx ;
00120     if (fabs(mp.get_rot_phi()) < 1.e-14) {
00121     factx = 1. ;
00122     }
00123     else {
00124     if (fabs(mp.get_rot_phi() - M_PI) < 1.e-14) {
00125         factx = - 1. ;
00126     }
00127     else {
00128         cout << "Bin_bhns_extr::orbit_omega : unknown value of rot_phi !"
00129          << endl ;
00130         abort() ;
00131     }
00132     }
00133 
00134     Cmp tmp = logn_auto_regu + loggam ;
00135 
00136     // ... gradient
00137     dnulg = dln_auto_div(0)(0, 0, 0, 0) + dln_comp(0)(0, 0, 0, 0)
00138       + factx * tmp.dsdx()(0, 0, 0, 0) ;
00139 
00140     //------------------------------------------------------------
00141     // Calculation of A^2/N^2 at the center of the star ---> asn2
00142     //------------------------------------------------------------
00143     double nc = nnn(0, 0, 0, 0) ;
00144     double a2c = a_car(0, 0, 0, 0) ;
00145     asn2 = a2c / (nc * nc) ;
00146 
00147     if ( star.is_relativistic() ) {
00148 
00149         //------------------------------------------------------------------
00150     // Calculation of d/dX(A^2/N^2) at the center of the star ---> dasn
00151     //------------------------------------------------------------------
00152 
00153         double da2c = factx * a_car.dsdx()(0, 0, 0, 0) ; 
00154     double dnc =  factx * nnn.dsdx()(0, 0, 0, 0) ;
00155 
00156     dasn2 = ( da2c - 2. * a2c / nc * dnc ) / (nc*nc) ;
00157 
00158     //------------------------------------------------------
00159     // Calculation of N^X at the center of the star ---> nx
00160     //------------------------------------------------------
00161     nx = shift(0)(0, 0, 0, 0) ;
00162 
00163     //-----------------------------------------------------------
00164     // Calculation of dN^X/dX at the center of the star ---> dnx
00165     //-----------------------------------------------------------
00166     dnx = factx * shift(0).dsdx()(0, 0, 0, 0) ;
00167 
00168     //------------------------------------------------------
00169     // Calculation of N^Y at the center of the star ---> ny
00170     //------------------------------------------------------
00171     ny = shift(1)(0, 0, 0, 0) ;
00172 
00173     //-----------------------------------------------------------
00174     // Calculation of dN^Y/dX at the center of the star ---> dny
00175     //-----------------------------------------------------------
00176     dny = factx * shift(1).dsdx()(0, 0, 0, 0) ;
00177 
00178     //--------------------------------------------
00179     // Calculation of (N^X)^2 + (N^Y)^2 + (N^Z)^2
00180     //  at the center of the star ---> npn
00181     //--------------------------------------------
00182     tmp = flat_scalar_prod(shift, shift)() ; // For the flat part
00183     npn = tmp(0, 0, 0, 0) ;
00184 
00185     //----------------------------------------------------
00186     // Calculation of d/dX( (N^X)^2 + (N^Y)^2 + (N^Z)^2 )
00187     //  at the center of the star ---> dnpn
00188     //----------------------------------------------------
00189     dnpn = factx * tmp.dsdx()(0, 0, 0, 0) ;
00190 
00191     }  // Finish of the relativistic case
00192     else {
00193     cout << "Bin_bhns_extr::orbit_omega : "
00194          << "It should be the relativistic calculation !" << endl ;
00195     abort() ;
00196     }
00197 
00198     cout << "Bin_bhns_extr::orbit_omega: coord. ori. d(nu+log(Gam))/dX : "
00199      << dnulg << endl ;
00200     cout << "Bin_bhns_extr::orbit_omega: coord. ori. A^2/N^2 : "
00201      << asn2 << endl ;
00202     cout << "Bin_bhns_extr::orbit_omega: coord. ori. d(A^2/N^2)/dX : "
00203      << dasn2 << endl ; 
00204     cout << "Bin_bhns_extr::orbit_omega: coord. ori. N^X : " << nx << endl ;
00205     cout << "Bin_bhns_extr::orbit_omega: coord. ori. dN^X/dX : "
00206      << dnx << endl ;
00207     cout << "Bin_bhns_extr::orbit_omega: coord. ori. N^Y : " << ny << endl ;
00208     cout << "Bin_bhns_extr::orbit_omega: coord. ori. dN^Y/dX : "
00209      << dny << endl ;
00210     cout << "Bin_bhns_extr::orbit_omega: coord. ori. N.N : " << npn << endl ;
00211     cout << "Bin_bhns_extr::orbit_omega: coord. ori. d(N.N)/dX : "
00212      << dnpn << endl ; 
00213 
00214     //------------------------------------------------------
00215     // Start of calculation of the orbital angular velocity
00216     //------------------------------------------------------
00217     int relat = ( star.is_relativistic() ) ? 1 : 0 ;
00218 
00219     Param parf ;
00220     parf.add_int(relat) ;
00221     parf.add_double( (star.get_mp()).get_ori_x(), 0) ;
00222     parf.add_double( dnulg, 1) ;
00223     parf.add_double( asn2, 2) ;
00224     parf.add_double( dasn2, 3) ;
00225     parf.add_double( nx, 4) ;
00226     parf.add_double( dnx, 5) ;
00227     parf.add_double( ny, 6) ;
00228     parf.add_double( dny, 7) ;
00229     parf.add_double( npn, 8) ;
00230     parf.add_double( dnpn, 9) ;
00231     parf.add_double( msr, 10) ;
00232 
00233     double omega1 = fact_omeg_min * omega ;
00234     double omega2 = fact_omeg_max * omega ;
00235 
00236     cout << "Bin_bhns_extr::orbit_omega: omega1, omega2 [rad/s] : "
00237      << omega1 * f_unit << "  " << omega2 * f_unit << endl ;
00238 
00239     // Search for the various zeros in the interval [omega1,omega2]
00240     // ------------------------------------------------------------
00241     int nsub = 50 ;  // total number of subdivisions of the interval
00242     Tbl* azer = 0x0 ;
00243     Tbl* bzer = 0x0 ;
00244     zero_list(fonc_bhns_orbit_ks, parf, omega1, omega2, nsub,
00245           azer, bzer) ;
00246 
00247     // Search for the zero closest to the previous value of omega
00248     // ----------------------------------------------------------
00249     double omeg_min, omeg_max ;
00250     int nzer = azer->get_taille() ; // number of zeros found by zero_list
00251     cout << "Bin_bhns_extr::orbit_omega : " << nzer <<
00252       "zero(s) found in the interval [omega1,  omega2]." << endl ;
00253     cout << "omega, omega1, omega2 : " << omega << "  " << omega1
00254      << "  " << omega2 << endl ; 
00255     cout << "azer : " << *azer << endl ;
00256     cout << "bzer : " << *bzer << endl ;
00257 
00258     if (nzer == 0) {
00259     cout << "Bin_bhns_extr::orbit_omega: WARNING : "
00260          << "no zero detected in the interval" << endl
00261          << "   [" << omega1 * f_unit << ", " 
00262          << omega2 * f_unit << "]  rad/s  !" << endl ;
00263     omeg_min = omega1 ;
00264     omeg_max = omega2 ;
00265     }
00266     else {
00267     double dist_min = fabs(omega2 - omega1) ;
00268     int i_dist_min = -1 ;
00269     for (int i=0; i<nzer; i++) {
00270         // Distance of previous value of omega from the center of the
00271         //  interval [azer(i), bzer(i)]
00272         double dist = fabs( omega - 0.5 * ( (*azer)(i) + (*bzer)(i) ) ) ;
00273 
00274         if (dist < dist_min) {
00275         dist_min = dist ;
00276         i_dist_min = i ;
00277         }
00278     }
00279     omeg_min = (*azer)(i_dist_min) ;
00280     omeg_max = (*bzer)(i_dist_min) ;
00281     }
00282 
00283     delete azer ; // Tbl allocated by zero_list
00284     delete bzer ; //
00285 
00286     cout << "Bin_bhns_extr:orbit_omega : "
00287      << "interval selected for the search of the zero : "
00288      << endl << "  [" << omeg_min << ", " << omeg_max << "] = ["
00289      << omeg_min * f_unit << ", " << omeg_max * f_unit << "] rad/s "
00290      << endl ;
00291 
00292     // Computation of the zero in the selected interval by the secant method
00293     // ---------------------------------------------------------------------
00294 
00295     int nitermax = 200 ;
00296     int niter ;
00297     double precis = 1.e-13 ;
00298     omega = zerosec_b(fonc_bhns_orbit_ks, parf, omeg_min, omeg_max,
00299               precis, nitermax, niter) ;
00300 
00301     cout << "Bin_bhns_extr::orbit_omega : "
00302      << "Number of iterations in zerosec for omega : "
00303      << niter << endl ;
00304 
00305     cout << "Bin_bhns_extr::orbit_omega : omega [rad/s] : "
00306      << omega * f_unit << endl ;
00307 
00308 }
00309 
00310 
00311 void Bin_bhns_extr::orbit_omega_cf(double fact_omeg_min,
00312                    double fact_omeg_max) {
00313 
00314   using namespace Unites ;
00315 
00316     //------------------------------------------------------------------
00317     // Evaluation of various quantities at the center of a neutron star
00318     //------------------------------------------------------------------
00319 
00320     double dnulg, asn2, dasn2, ny, dny, npn, dnpn ;
00321 
00322     const Map& mp = star.get_mp() ;
00323 
00324     const Cmp& logn_auto_regu = star.get_logn_auto_regu()() ;
00325     const Cmp& logn_comp = star.get_logn_comp()() ;
00326     const Cmp& loggam = star.get_loggam()() ;
00327     const Cmp& nnn = star.get_nnn()() ;
00328     const Cmp& a_car = star.get_a_car()() ;
00329     const Tenseur& shift = star.get_shift() ;
00330     const Tenseur& d_logn_auto_div = star.get_d_logn_auto_div() ;
00331 
00332     Tenseur dln_auto_div = d_logn_auto_div ;
00333 
00334     if ( *(dln_auto_div.get_triad()) != ref_triad ) {
00335 
00336         // Change the basis from spherical coordinate to Cartesian one
00337         dln_auto_div.change_triad( mp.get_bvect_cart() ) ;
00338 
00339     // Change the basis from mapping coordinate to absolute one
00340     dln_auto_div.change_triad( ref_triad ) ;
00341 
00342     }
00343 
00344     //-----------------------------------------------------------------
00345     // Calculation of d/dX( nu + ln(Gamma) ) at the center of the star
00346     //  ---> dnulg
00347     //-----------------------------------------------------------------
00348 
00349     // Factor for the coordinate transformation x --> X :
00350     double factx ;
00351     if (fabs(mp.get_rot_phi()) < 1.e-14) {
00352     factx = 1. ;
00353     }
00354     else {
00355     if (fabs(mp.get_rot_phi() - M_PI) < 1.e-14) {
00356         factx = - 1. ;
00357     }
00358     else {
00359         cout <<
00360           "Bin_bhns_extr::orbit_omega_cfc : unknown value of rot_phi !"
00361          << endl ;
00362         abort() ;
00363     }
00364     }
00365 
00366     Cmp tmp = logn_auto_regu + logn_comp + loggam ;
00367 
00368     // ... gradient
00369     dnulg = dln_auto_div(0)(0, 0, 0, 0)
00370       + factx * tmp.dsdx()(0, 0, 0, 0) ;
00371 
00372     //------------------------------------------------------------
00373     // Calculation of A^2/N^2 at the center of the star ---> asn2
00374     //------------------------------------------------------------
00375     double nc = nnn(0, 0, 0, 0) ;
00376     double a2c = a_car(0, 0, 0, 0) ;
00377     asn2 = a2c / (nc * nc) ;
00378 
00379     if ( star.is_relativistic() ) {
00380 
00381         //------------------------------------------------------------------
00382     // Calculation of d/dX(A^2/N^2) at the center of the star ---> dasn
00383     //------------------------------------------------------------------
00384 
00385         double da2c = factx * a_car.dsdx()(0, 0, 0, 0) ; 
00386     double dnc =  factx * nnn.dsdx()(0, 0, 0, 0) ;
00387 
00388     dasn2 = ( da2c - 2. * a2c / nc * dnc ) / (nc*nc) ;
00389 
00390     //------------------------------------------------------
00391     // Calculation of N^Y at the center of the star ---> ny
00392     //------------------------------------------------------
00393     ny = shift(1)(0, 0, 0, 0) ;
00394 
00395     //-----------------------------------------------------------
00396     // Calculation of dN^Y/dX at the center of the star ---> dny
00397     //-----------------------------------------------------------
00398     dny = factx * shift(1).dsdx()(0, 0, 0, 0) ;
00399 
00400     //--------------------------------------------
00401     // Calculation of (N^X)^2 + (N^Y)^2 + (N^Z)^2
00402     //  at the center of the star ---> npn
00403     //--------------------------------------------
00404     tmp = flat_scalar_prod(shift, shift)() ; // For the flat part
00405     npn = tmp(0, 0, 0, 0) ;
00406 
00407     //----------------------------------------------------
00408     // Calculation of d/dX( (N^X)^2 + (N^Y)^2 + (N^Z)^2 )
00409     //  at the center of the star ---> dnpn
00410     //----------------------------------------------------
00411     dnpn = factx * tmp.dsdx()(0, 0, 0, 0) ;
00412 
00413     }  // Finish of the relativistic case
00414     else {
00415     cout << "Bin_bhns_extr::orbit_omega_cfc : "
00416          << "It should be the relativistic calculation !" << endl ;
00417     abort() ;
00418     }
00419 
00420     cout << "Bin_bhns_extr::orbit_omega_cfc: coord. ori. d(nu+log(Gam))/dX : "
00421      << dnulg << endl ;
00422     cout << "Bin_bhns_extr::orbit_omega_cfc: coord. ori. A^2/N^2 : "
00423      << asn2 << endl ;
00424     cout << "Bin_bhns_extr::orbit_omega_cfc: coord. ori. d(A^2/N^2)/dX : "
00425      << dasn2 << endl ; 
00426     cout << "Bin_bhns_extr::orbit_omega_cfc: coord. ori. N^Y : "
00427      << ny << endl ;
00428     cout << "Bin_bhns_extr::orbit_omega_cfc: coord. ori. dN^Y/dX : "
00429      << dny << endl ;
00430     cout << "Bin_bhns_extr::orbit_omega_cfc: coord. ori. N.N : "
00431      << npn << endl ;
00432     cout << "Bin_bhns_extr::orbit_omega_cfc: coord. ori. d(N.N)/dX : "
00433      << dnpn << endl ; 
00434 
00435     //------------------------------------------------------
00436     // Start of calculation of the orbital angular velocity
00437     //------------------------------------------------------
00438     int relat = ( star.is_relativistic() ) ? 1 : 0 ;
00439 
00440     Param parf ;
00441     parf.add_int(relat) ;
00442     parf.add_double( (star.get_mp()).get_ori_x(), 0) ;
00443     parf.add_double( dnulg, 1) ;
00444     parf.add_double( asn2, 2) ;
00445     parf.add_double( dasn2, 3) ;
00446     parf.add_double( ny, 4) ;
00447     parf.add_double( dny, 5) ;
00448     parf.add_double( npn, 6) ;
00449     parf.add_double( dnpn, 7) ;
00450 
00451     double omega1 = fact_omeg_min * omega ;
00452     double omega2 = fact_omeg_max * omega ;
00453 
00454     cout << "Bin_bhns_extr::orbit_omega_cfc: omega1, omega2 [rad/s] : "
00455      << omega1 * f_unit << "  " << omega2 * f_unit << endl ;
00456 
00457     // Search for the various zeros in the interval [omega1,omega2]
00458     // ------------------------------------------------------------
00459     int nsub = 50 ;  // total number of subdivisions of the interval
00460     Tbl* azer = 0x0 ;
00461     Tbl* bzer = 0x0 ;
00462     zero_list(fonc_bhns_orbit_cf, parf, omega1, omega2, nsub,
00463           azer, bzer) ;
00464 
00465     // Search for the zero closest to the previous value of omega
00466     // ----------------------------------------------------------
00467     double omeg_min, omeg_max ;
00468     int nzer = azer->get_taille() ; // number of zeros found by zero_list
00469     cout << "Bin_bhns_extr::orbit_omega_cfc : " << nzer <<
00470       "zero(s) found in the interval [omega1,  omega2]." << endl ;
00471     cout << "omega, omega1, omega2 : " << omega << "  " << omega1
00472      << "  " << omega2 << endl ; 
00473     cout << "azer : " << *azer << endl ;
00474     cout << "bzer : " << *bzer << endl ;
00475 
00476     if (nzer == 0) {
00477     cout << "Bin_bhns_extr::orbit_omega_cfc: WARNING : "
00478          << "no zero detected in the interval" << endl
00479          << "   [" << omega1 * f_unit << ", " 
00480          << omega2 * f_unit << "]  rad/s  !" << endl ;
00481     omeg_min = omega1 ;
00482     omeg_max = omega2 ;
00483     }
00484     else {
00485     double dist_min = fabs(omega2 - omega1) ;
00486     int i_dist_min = -1 ;
00487     for (int i=0; i<nzer; i++) {
00488         // Distance of previous value of omega from the center of the
00489         //  interval [azer(i), bzer(i)]
00490         double dist = fabs( omega - 0.5 * ( (*azer)(i) + (*bzer)(i) ) ) ;
00491 
00492         if (dist < dist_min) {
00493         dist_min = dist ;
00494         i_dist_min = i ;
00495         }
00496     }
00497     omeg_min = (*azer)(i_dist_min) ;
00498     omeg_max = (*bzer)(i_dist_min) ;
00499     }
00500 
00501     delete azer ; // Tbl allocated by zero_list
00502     delete bzer ; //
00503 
00504     cout << "Bin_bhns_extr:orbit_omega_cfc : "
00505      << "interval selected for the search of the zero : "
00506      << endl << "  [" << omeg_min << ", " << omeg_max << "] = ["
00507      << omeg_min * f_unit << ", " << omeg_max * f_unit << "] rad/s "
00508      << endl ;
00509 
00510     // Computation of the zero in the selected interval by the secant method
00511     // ---------------------------------------------------------------------
00512 
00513     int nitermax = 200 ;
00514     int niter ;
00515     double precis = 1.e-13 ;
00516     omega = zerosec_b(fonc_bhns_orbit_cf, parf, omeg_min, omeg_max,
00517               precis, nitermax, niter) ;
00518 
00519     cout << "Bin_bhns_extr::orbit_omega_cfc : "
00520      << "Number of iterations in zerosec for omega : "
00521      << niter << endl ;
00522 
00523     cout << "Bin_bhns_extr::orbit_omega_cfc : omega [rad/s] : "
00524      << omega * f_unit << endl ;
00525 
00526 }
00527 
00528 
00529 //***********************************************************
00530 //  Function used for search of the orbital angular velocity
00531 //***********************************************************
00532 
00533 double fonc_bhns_orbit_ks(double om, const Param& parf) {
00534 
00535     int relat = parf.get_int() ;
00536 
00537     double xc = parf.get_double(0) ;
00538     double dnulg = parf.get_double(1) ;
00539     double asn2 = parf.get_double(2) ;
00540     double dasn2 = parf.get_double(3) ;
00541     double nx = parf.get_double(4) ;
00542     double dnx = parf.get_double(5) ;
00543     double ny = parf.get_double(6) ;
00544     double dny = parf.get_double(7) ;
00545     double npn = parf.get_double(8) ;
00546     double dnpn = parf.get_double(9) ;
00547     double msr = parf.get_double(10) ;
00548 
00549     double om2 = om*om ;
00550 
00551     double dphi_cent ;
00552 
00553     if (relat == 1) {
00554     double bpb = om2 * xc*xc - 2.*om * ny * xc + npn + 2.*msr * nx*nx;
00555 
00556     dphi_cent = ( asn2* ( om* (ny + xc*dny) - om2*xc - 0.5*dnpn 
00557                   - 2.*msr * nx * dnx + msr * nx*nx / xc )
00558               - 0.5*bpb* dasn2 ) / ( 1 - asn2 * bpb ) ;
00559     }
00560     else {
00561     cout << "Bin_bhns_extr::orbit_omega_ks : "
00562          << "It should be the relativistic calculation !" << endl ;
00563     abort() ;
00564     }
00565 
00566     return dnulg + dphi_cent ;
00567 
00568 }
00569 
00570 double fonc_bhns_orbit_cf(double om, const Param& parf) {
00571 
00572     int relat = parf.get_int() ;
00573 
00574     double xc = parf.get_double(0) ;
00575     double dnulg = parf.get_double(1) ;
00576     double asn2 = parf.get_double(2) ;
00577     double dasn2 = parf.get_double(3) ;
00578     double ny = parf.get_double(4) ;
00579     double dny = parf.get_double(5) ;
00580     double npn = parf.get_double(6) ;
00581     double dnpn = parf.get_double(7) ;
00582 
00583     double om2 = om*om ;
00584 
00585     double dphi_cent ;
00586 
00587     if (relat == 1) {
00588     double bpb = om2 * xc*xc - 2.*om * ny * xc + npn ;
00589 
00590     dphi_cent = ( asn2* ( om* (ny + xc*dny) - om2*xc - 0.5*dnpn )
00591               - 0.5*bpb* dasn2 ) / ( 1 - asn2 * bpb ) ;
00592     }
00593     else {
00594     cout << "Bin_bhns_extr::orbit_omega_cf : "
00595          << "It should be the relativistic calculation !" << endl ;
00596     abort() ;
00597     }
00598 
00599     return dnulg + dphi_cent ;
00600 
00601 }

Generated on Tue Feb 7 01:35:14 2012 for LORENE by  doxygen 1.4.6