bin_bhns_shift_ana.C

00001 /*
00002  *  Method of class Bin_bhns to compute the analytic shift vector
00003  *
00004  *    (see file bin_bhns.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005 Keisuke Taniguchi
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License version 2
00015  *   as published by the Free Software Foundation.
00016  *
00017  *   LORENE is distributed in the hope that it will be useful,
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *   GNU General Public License for more details.
00021  *
00022  *   You should have received a copy of the GNU General Public License
00023  *   along with LORENE; if not, write to the Free Software
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 char bin_bhns_shift_ana_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_bhns/bin_bhns_shift_ana.C,v 1.1 2007/06/22 01:11:08 k_taniguchi Exp $" ;
00029 
00030 /*
00031  * $Id: bin_bhns_shift_ana.C,v 1.1 2007/06/22 01:11:08 k_taniguchi Exp $
00032  * $Log: bin_bhns_shift_ana.C,v $
00033  * Revision 1.1  2007/06/22 01:11:08  k_taniguchi
00034  * *** empty log message ***
00035  *
00036  *
00037  * $Header: /cvsroot/Lorene/C++/Source/Bin_bhns/bin_bhns_shift_ana.C,v 1.1 2007/06/22 01:11:08 k_taniguchi Exp $
00038  *
00039  */
00040 
00041 // C++ headers
00042 //#include <>
00043 
00044 // C headers
00045 #include <math.h>
00046 
00047 // Lorene headers
00048 #include "bin_bhns.h"
00049 #include "utilitaires.h"
00050 #include "unites.h"
00051 
00052 void Bin_bhns::shift_analytic(double reduce_shift_bh, double reduce_shift_ns)
00053 {
00054 
00055     using namespace Unites ;
00056 
00057     double massbh = hole.get_mass_bh() ;
00058     double massns = star.mass_g_bhns() ;
00059     double mass_bh = ggrav * massbh ;
00060     double mass_ns = ggrav * massns ;
00061 
00062     double mass_tot = mass_bh + mass_ns ;
00063 
00064     double comb = mass_bh * mass_ns * omega * separ / mass_tot ;
00065 
00066     //-----------------------------------------//
00067     //     Shift vector for the black hole     //
00068     //-----------------------------------------//
00069 
00070     const Vector& shift_bh_old = hole.get_shift_auto_rs() ;
00071 
00072     const Map& mp_bh = hole.get_mp() ;
00073     Scalar xx_bh(mp_bh) ;
00074     xx_bh = mp_bh.x ;
00075     xx_bh.std_spectral_base() ;
00076     Scalar yy_bh(mp_bh) ;
00077     yy_bh = mp_bh.y ;
00078     yy_bh.std_spectral_base() ;
00079     Scalar zz_bh(mp_bh) ;
00080     zz_bh = mp_bh.z ;
00081     zz_bh.std_spectral_base() ;
00082     Scalar rr_bh(mp_bh) ;
00083     rr_bh = mp_bh.r ;
00084     rr_bh.std_spectral_base() ;
00085     Scalar st_bh(mp_bh) ;
00086     st_bh = mp_bh.sint ;
00087     st_bh.std_spectral_base() ;
00088     Scalar ct_bh(mp_bh) ;
00089     ct_bh = mp_bh.cost ;
00090     ct_bh.std_spectral_base() ;
00091     Scalar sp_bh(mp_bh) ;
00092     sp_bh = mp_bh.sinp ;
00093     sp_bh.std_spectral_base() ;
00094     Scalar cp_bh(mp_bh) ;
00095     cp_bh = mp_bh.cosp ;
00096     cp_bh.std_spectral_base() ;
00097 
00098     double rad_bh = rr_bh.val_grid_point(1, 0, 0, 0) ;
00099 
00100     Scalar x_bh_ex(mp_bh) ;
00101     Scalar y_bh_ex(mp_bh) ;
00102     Scalar z_bh_ex(mp_bh) ;
00103 
00104     if (hole.is_irrotational()) {
00105 
00106         // x component
00107         // -----------
00108     x_bh_ex = 0.2 * comb * rad_bh * rad_bh
00109       * st_bh * st_bh * cp_bh * sp_bh / pow(rr_bh, 3.) ;
00110     x_bh_ex.annule_domain(0) ;
00111     x_bh_ex.std_spectral_base() ;
00112 
00113     (hole.set_shift_auto_rs()).set(1) = shift_bh_old(1)
00114       + reduce_shift_bh * x_bh_ex ;
00115 
00116     // y component
00117     // -----------
00118     y_bh_ex = 0.5 * comb * (7. + 0.2*rad_bh*rad_bh/rr_bh/rr_bh) / rr_bh
00119       + 0.5 * comb * pow(st_bh*sp_bh,2.)
00120       * (1. - 0.6*rad_bh*rad_bh/rr_bh/rr_bh) / rr_bh ;
00121     y_bh_ex.annule_domain(0) ;
00122     y_bh_ex.std_spectral_base() ;
00123 
00124     (hole.set_shift_auto_rs()).set(2) = shift_bh_old(2)
00125       + reduce_shift_bh * y_bh_ex ;
00126 
00127     // z component
00128     // -----------
00129     z_bh_ex = 0.5 * comb * st_bh * sp_bh * ct_bh
00130       * (1.-0.6*rad_bh*rad_bh/rr_bh/rr_bh) / rr_bh ;
00131     z_bh_ex.annule_domain(0) ;
00132     z_bh_ex.std_spectral_base() ;
00133 
00134     (hole.set_shift_auto_rs()).set(3) = shift_bh_old(3)
00135       + reduce_shift_bh * z_bh_ex ;
00136 
00137     (hole.set_shift_auto_rs()).std_spectral_base() ;
00138 
00139     }
00140     else { // Corotational
00141 
00142         // x component
00143         // -----------
00144     x_bh_ex = - 0.6 * mass_ns * omega * rad_bh * rad_bh
00145       * st_bh * sp_bh / pow(rr_bh, 2.)
00146       + 0.5 * comb * st_bh * st_bh * cp_bh * sp_bh
00147       * (1. - 0.6*rad_bh*rad_bh/rr_bh/rr_bh) / rr_bh
00148       - 0.6*mass_bh*omega*rad_bh*rad_bh*pow(st_bh,3.)*pow(cp_bh,2.)*sp_bh
00149       /pow(rr_bh, 2.) ;
00150     x_bh_ex.annule_domain(0) ;
00151     x_bh_ex.std_spectral_base() ;
00152 
00153     (hole.set_shift_auto_rs()).set(1) = shift_bh_old(1)
00154       + reduce_shift_bh * x_bh_ex ;
00155 
00156     // y component
00157     // -----------
00158     y_bh_ex = 0.5 * comb * (7. + 0.2*rad_bh*rad_bh/rr_bh/rr_bh) / rr_bh
00159       - 0.6 * mass_bh * omega * rad_bh * rad_bh * st_bh * cp_bh
00160       / pow(rr_bh, 2.)
00161       + 0.5 * comb * pow(st_bh*sp_bh,2.)
00162       * (1. - 0.6*rad_bh*rad_bh/rr_bh/rr_bh) / rr_bh
00163       - 0.6*mass_bh*omega*rad_bh*rad_bh*pow(st_bh,3.)*cp_bh*pow(sp_bh,2.)
00164       /pow(rr_bh, 2.) ;
00165     y_bh_ex.annule_domain(0) ;
00166     y_bh_ex.std_spectral_base() ;
00167 
00168     (hole.set_shift_auto_rs()).set(2) = shift_bh_old(2)
00169       + reduce_shift_bh * y_bh_ex ;
00170 
00171     // z component
00172     // -----------
00173     z_bh_ex = 0.5 * comb * st_bh * cp_bh * ct_bh
00174       * (1. - 0.6*rad_bh*rad_bh/rr_bh/rr_bh) / rr_bh
00175       - 0.6*mass_bh*omega*rad_bh*rad_bh*st_bh*st_bh*cp_bh*sp_bh*ct_bh
00176       / pow(rr_bh, 2.) ;
00177     z_bh_ex.annule_domain(0) ;
00178     z_bh_ex.std_spectral_base() ;
00179 
00180     (hole.set_shift_auto_rs()).set(3) = shift_bh_old(3)
00181       + reduce_shift_bh * z_bh_ex ;
00182 
00183     (hole.set_shift_auto_rs()).std_spectral_base() ;
00184 
00185     }
00186 
00187 
00188     //-------------------------------------------//
00189     //     Shift vector for the neutron star     //
00190     //-------------------------------------------//
00191     int nzet = star.get_nzet() ;
00192     int nz_ns = (star.get_mp()).get_mg()->get_nzone() ;
00193 
00194     const Map& mp_ns = star.get_mp() ;
00195     Scalar xx_ns(mp_ns) ;
00196     xx_ns = mp_ns.x ;
00197     xx_ns.std_spectral_base() ;
00198     Scalar yy_ns(mp_ns) ;
00199     yy_ns = mp_ns.y ;
00200     yy_ns.std_spectral_base() ;
00201     Scalar zz_ns(mp_ns) ;
00202     zz_ns = mp_ns.z ;
00203     zz_ns.std_spectral_base() ;
00204     Scalar rr_ns(mp_ns) ;
00205     rr_ns = mp_ns.r ;
00206     rr_ns.std_spectral_base() ;
00207     Scalar st_ns(mp_ns) ;
00208     st_ns = mp_ns.sint ;
00209     st_ns.std_spectral_base() ;
00210     Scalar ct_ns(mp_ns) ;
00211     ct_ns = mp_ns.cost ;
00212     ct_ns.std_spectral_base() ;
00213     Scalar sp_ns(mp_ns) ;
00214     sp_ns = mp_ns.sinp ;
00215     sp_ns.std_spectral_base() ;
00216     Scalar cp_ns(mp_ns) ;
00217     cp_ns = mp_ns.cosp ;
00218     cp_ns.std_spectral_base() ;
00219 
00220     double rad_ns = rr_ns.val_grid_point(1, 0, 0, 0) ;
00221 
00222     Scalar x_ns_in(mp_ns) ;
00223     Scalar x_ns_ex(mp_ns) ;
00224     Scalar y_ns_in(mp_ns) ;
00225     Scalar y_ns_ex(mp_ns) ;
00226     Scalar z_ns_in(mp_ns) ;
00227     Scalar z_ns_ex(mp_ns) ;
00228 
00229     if (star.is_irrotational()) {
00230 
00231         // x component
00232         // -----------
00233         x_ns_in = - 0.2 * comb * xx_ns * yy_ns / pow(rad_ns, 3.) ;
00234     x_ns_in.annule(nzet, nz_ns-1) ;
00235     x_ns_in.std_spectral_base() ;
00236 
00237     x_ns_ex = - 0.2 * comb * rad_ns * rad_ns
00238       * st_ns * st_ns * cp_ns * sp_ns / pow(rr_ns, 3.) ;
00239     x_ns_ex.annule(0, nzet-1) ;
00240     x_ns_ex.std_spectral_base() ;
00241 
00242     (star.set_shift_auto()).set(1) = reduce_shift_ns
00243       * (x_ns_in + x_ns_ex) ;
00244 
00245     // y component
00246     // -----------
00247     y_ns_in = - 0.5 * comb * (11. - 3.8*rr_ns*rr_ns/rad_ns/rad_ns) / rad_ns
00248       - 0.2 * comb * yy_ns * yy_ns / pow(rad_ns, 3.) ;
00249     y_ns_in.annule(nzet, nz_ns-1) ;
00250     y_ns_in.std_spectral_base() ;
00251 
00252     y_ns_ex = - 0.5 * comb * (7. + 0.2*rad_ns*rad_ns/rr_ns/rr_ns) / rr_ns
00253       - 0.5 * comb * pow(st_ns*sp_ns,2.)
00254       * (1. - 0.6*rad_ns*rad_ns/rr_ns/rr_ns) / rr_ns ;
00255     y_ns_ex.annule(0, nzet-1) ;
00256     y_ns_ex.std_spectral_base() ;
00257 
00258     (star.set_shift_auto()).set(2) = reduce_shift_ns
00259       * (y_ns_in + y_ns_ex) ;
00260 
00261     // z component
00262     // -----------
00263     z_ns_in = - 0.2 * comb * yy_ns * zz_ns / pow(rad_ns, 3.) ;
00264     z_ns_in.annule(nzet, nz_ns-1) ;
00265     z_ns_in.std_spectral_base() ;
00266 
00267     z_ns_ex = - 0.5 * comb * st_ns * sp_ns * ct_ns
00268       * (1.-0.6*rad_ns*rad_ns/rr_ns/rr_ns) / rr_ns ;
00269     z_ns_ex.annule(0, nzet-1) ;
00270     z_ns_ex.std_spectral_base() ;
00271 
00272     (star.set_shift_auto()).set(3) = reduce_shift_ns
00273       * (z_ns_in + z_ns_ex) ;
00274 
00275     }
00276     else { // Corotational
00277 
00278         // x component
00279         // -----------
00280         x_ns_in = 1.5 * mass_ns * omega * yy_ns
00281       * (1. - 0.6*rr_ns*rr_ns/rad_ns/rad_ns) / rad_ns
00282       - 0.2 * comb * xx_ns * yy_ns / pow(rad_ns, 3.)
00283       + 0.6 * mass_ns * omega * xx_ns * xx_ns * yy_ns / pow(rad_ns, 3.) ;
00284         x_ns_in.annule(nzet, nz_ns-1) ;
00285     x_ns_in.std_spectral_base() ;
00286 
00287     x_ns_ex = 0.6 * mass_ns * omega * rad_ns * rad_ns
00288       * st_ns * sp_ns / pow(rr_ns, 2.)
00289       - 0.5 * comb * st_ns * st_ns * cp_ns * sp_ns
00290       * (1. - 0.6*rad_ns*rad_ns/rr_ns/rr_ns) / rr_ns
00291       + 0.6*mass_ns*omega*rad_ns*rad_ns*pow(st_ns,3.)*pow(cp_ns,2.)*sp_ns
00292       /pow(rr_ns, 2.) ;
00293     x_ns_ex.annule(0, nzet-1) ;
00294     x_ns_ex.std_spectral_base() ;
00295 
00296     (star.set_shift_auto()).set(1) = reduce_shift_ns
00297       * (x_ns_in + x_ns_ex) ;
00298 
00299     // y component
00300     // -----------
00301     y_ns_in = - 0.5 * comb * (11. - 3.8*rr_ns*rr_ns/rad_ns/rad_ns) / rad_ns
00302       + 1.5 * mass_ns * omega * xx_ns
00303       * (1. - 0.6*rr_ns*rr_ns/rad_ns/rad_ns) / rad_ns
00304       - 0.2 * comb * yy_ns * yy_ns / pow(rad_ns, 3.)
00305       + 0.6 * mass_ns * omega * xx_ns * yy_ns * yy_ns / pow(rad_ns, 3.) ;
00306     y_ns_in.annule(nzet, nz_ns-1) ;
00307     y_ns_in.std_spectral_base() ;
00308 
00309     y_ns_ex = - 0.5 * comb * (7. + 0.2*rad_ns*rad_ns/rr_ns/rr_ns) / rr_ns
00310       + 0.6 * mass_ns * omega * rad_ns * rad_ns * st_ns * cp_ns
00311       / pow(rr_ns, 2.)
00312       - 0.5 * comb * pow(st_ns*sp_ns,2.)
00313       * (1. - 0.6*rad_ns*rad_ns/rr_ns/rr_ns) / rr_ns
00314       + 0.6*mass_ns*omega*rad_ns*rad_ns*pow(st_ns,3.)*cp_ns*pow(sp_ns,2.)
00315       /pow(rr_ns, 2.) ;
00316     y_ns_ex.annule(0, nzet-1) ;
00317     y_ns_ex.std_spectral_base() ;
00318 
00319     (star.set_shift_auto()).set(2) = reduce_shift_ns
00320       * (y_ns_in + y_ns_ex) ;
00321 
00322     // z component
00323     // -----------
00324     z_ns_in = - 0.2 * comb * yy_ns * zz_ns / pow(rad_ns, 3.)
00325       + 0.6 * mass_ns * omega * xx_ns * yy_ns * zz_ns / pow(rad_ns, 3.) ;
00326     z_ns_in.annule(nzet, nz_ns-1) ;
00327     z_ns_in.std_spectral_base() ;
00328 
00329     z_ns_ex = - 0.5 * comb * st_ns * cp_ns * ct_ns
00330       * (1. - 0.6*rad_ns*rad_ns/rr_ns/rr_ns) / rr_ns
00331       + 0.6*mass_ns*omega*rad_ns*rad_ns*st_ns*st_ns*cp_ns*sp_ns*ct_ns
00332       / pow(rr_ns, 2.) ;
00333     z_ns_ex.annule(0, nzet-1) ;
00334     z_ns_ex.std_spectral_base() ;
00335 
00336     (star.set_shift_auto()).set(3) = reduce_shift_ns
00337       * (z_ns_in + z_ns_ex) ;
00338 
00339     }
00340 
00341     (star.set_shift_auto()).std_spectral_base() ;
00342 
00343 }

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