hole_bhns_equilibrium.C

00001 /*
00002  *  Method of class Hole_bhns to compute black-hole metric quantities
00003  *   in a black hole-neutron star binary
00004  *
00005  *    (see file hole_bhns.h for documentation).
00006  *
00007  */
00008 
00009 /*
00010  *   Copyright (c) 2005-2007 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 hole_bhns_equilibrium_C[] = "$Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_equilibrium.C,v 1.2 2008/05/15 19:05:12 k_taniguchi Exp $" ;
00030 
00031 /*
00032  * $Id: hole_bhns_equilibrium.C,v 1.2 2008/05/15 19:05:12 k_taniguchi Exp $
00033  * $Log: hole_bhns_equilibrium.C,v $
00034  * Revision 1.2  2008/05/15 19:05:12  k_taniguchi
00035  * Change of some parameters.
00036  *
00037  * Revision 1.1  2007/06/22 01:24:36  k_taniguchi
00038  * *** empty log message ***
00039  *
00040  *
00041  * $Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_equilibrium.C,v 1.2 2008/05/15 19:05:12 k_taniguchi Exp $
00042  *
00043  */
00044 
00045 // C++ headers
00046 //#include <>
00047 
00048 // C headers
00049 #include <math.h>
00050 
00051 // Lorene headers
00052 #include "hole_bhns.h"
00053 #include "cmp.h"
00054 #include "tenseur.h"
00055 #include "param.h"
00056 #include "eos.h"
00057 #include "unites.h"
00058 #include "proto.h"
00059 #include "utilitaires.h"
00060 //#include "graphique.h"
00061 
00062 void Hole_bhns::equilibrium_bhns(int mer, int mermax_bh,
00063                  int filter_r, int filter_r_s, int filter_p_s,
00064                  double x_rot, double y_rot, double precis,
00065                  double omega_orb, double resize_bh,
00066                  const Tbl& fact_resize, Tbl& diff) {
00067 
00068     // Fundamental constants and units
00069     // -------------------------------
00070     using namespace Unites ;
00071 
00072     // Initializations
00073     // ---------------
00074 
00075     const Mg3d* mg = mp.get_mg() ;
00076     int nz = mg->get_nzone() ;          // total number of domains
00077 
00078     // Re-adjustment of the boundary of domains
00079     // ----------------------------------------
00080 
00081     double rr_in_1 = mp.val_r(1, -1., M_PI/2, 0.) ;
00082 
00083     /*
00084     // Three shells outside the shell including NS
00085     // -------------------------------------------
00086 
00087     // Resize of the outer boundary of the shell including the NS
00088     double rr_out_nm5 = mp.val_r(nz-5, 1., M_PI/2., 0.) ;
00089     mp.resize(nz-5, rr_in_1/rr_out_nm5 * fact_resize(1)) ;
00090 
00091     // Resize of the innner boundary of the shell including the NS
00092     double rr_out_nm6 = mp.val_r(nz-6, 1., M_PI/2., 0.) ;
00093     mp.resize(nz-6, rr_in_1/rr_out_nm6 * fact_resize(0)) ;
00094 
00095     if (mer % 2 == 0) {
00096 
00097       // Resize of the domain N-2
00098       double rr_out_nm2 = mp.val_r(nz-2, 1., M_PI/2., 0.) ;
00099       mp.resize(nz-2, 8. * rr_in_1 * fact_resize(1) / rr_out_nm2) ;
00100 
00101       // Resize of the domain N-3
00102       double rr_out_nm3 = mp.val_r(nz-3, 1., M_PI/2., 0.) ;
00103       mp.resize(nz-3, 4. * rr_in_1 * fact_resize(1) / rr_out_nm3) ;
00104 
00105       // Resize of the domain N-4
00106       double rr_out_nm4 = mp.val_r(nz-4, 1., M_PI/2., 0.) ;
00107       mp.resize(nz-4, 2. * rr_in_1 * fact_resize(1) / rr_out_nm4) ;
00108 
00109       if (nz > 7) {
00110 
00111     // Resize of the domain 1
00112     double rr_out_1 = mp.val_r(1, 1., M_PI/2., 0.) ;
00113     mp.resize(1, rr_in_1/rr_out_1 * resize_bh) ;
00114 
00115     if (nz > 8) {
00116 
00117       // Resize of the domain from 2 to N-7
00118       double rr_out_1_new = mp.val_r(1, 1., M_PI/2., 0.) ;
00119       double rr_out_nm6_new = mp.val_r(nz-6, 1., M_PI/2., 0.) ;
00120       double dr = (rr_out_nm6_new - rr_out_1_new) / double(nz - 7) ;
00121 
00122       for (int i=1; i<nz-7; i++) {
00123 
00124         double rr = rr_out_1_new + i * dr ;
00125         double rr_out_ip1 = mp.val_r(i+1, 1., M_PI/2., 0.) ;
00126         mp.resize(i+1, rr/rr_out_ip1) ;
00127 
00128       }
00129 
00130     }
00131 
00132       }
00133 
00134     }
00135     */
00136 
00137     /*
00138     // Two shells outside the shell including NS
00139     // -----------------------------------------
00140 
00141     // Resize of the outer boundary of the shell including the NS
00142     double rr_out_nm4 = mp.val_r(nz-4, 1., M_PI/2., 0.) ;
00143     mp.resize(nz-4, rr_in_1/rr_out_nm4 * fact_resize(1)) ;
00144 
00145     // Resize of the innner boundary of the shell including the NS
00146     double rr_out_nm5 = mp.val_r(nz-5, 1., M_PI/2., 0.) ;
00147     mp.resize(nz-5, rr_in_1/rr_out_nm5 * fact_resize(0)) ;
00148 
00149     //    if (mer % 2 == 0) {
00150 
00151     // Resize of the domain N-2
00152     double rr_out_nm2 = mp.val_r(nz-2, 1., M_PI/2., 0.) ;
00153     mp.resize(nz-2, 3. * rr_in_1 * fact_resize(1) / rr_out_nm2) ;
00154 
00155     // Resize of the domain N-3
00156     double rr_out_nm3 = mp.val_r(nz-3, 1., M_PI/2., 0.) ;
00157     mp.resize(nz-3, 1.5 * rr_in_1 * fact_resize(1) / rr_out_nm3) ;
00158 
00159     if (nz > 6) {
00160 
00161       // Resize of the domain 1
00162       double rr_out_1 = mp.val_r(1, 1., M_PI/2., 0.) ;
00163       mp.resize(1, rr_in_1/rr_out_1 * resize_bh) ;
00164 
00165       if (nz > 7) {
00166 
00167     // Resize of the domain from 2 to N-6
00168     double rr_out_nm5_new = mp.val_r(nz-5, 1., M_PI/2., 0.) ;
00169 
00170     for (int i=1; i<nz-6; i++) {
00171 
00172       double rr_out_i = mp.val_r(i, 1., M_PI/2., 0.) ;
00173 
00174       double rr_mid = rr_out_i
00175         + (rr_out_nm5_new - rr_out_i) / double(nz - 5 - i) ;
00176 
00177       double rr_2timesi = 2. * rr_out_i ;
00178 
00179       if (rr_2timesi < rr_mid) {
00180 
00181         double rr_out_ip1 = mp.val_r(i+1, 1., M_PI/2., 0.) ;
00182         mp.resize(i+1, rr_2timesi / rr_out_ip1) ;
00183 
00184       }
00185       else {
00186 
00187         double rr_out_ip1 = mp.val_r(i+1, 1., M_PI/2., 0.) ;
00188         mp.resize(i+1, rr_mid / rr_out_ip1) ;
00189 
00190       }  // End of else
00191 
00192     }  // End of i loop
00193 
00194       }  // End of (nz > 7) loop
00195 
00196     }  // End of (nz > 6) loop
00197 
00198     //    }  // End of (mer % 2) loop
00199     */
00200 
00201     // One shell outside the shell including NS
00202     // ----------------------------------------
00203 
00204     // Resize of the outer boundary of the shell including the NS
00205     double rr_out_nm3 = mp.val_r(nz-3, 1., M_PI/2., 0.) ;
00206     mp.resize(nz-3, rr_in_1/rr_out_nm3 * fact_resize(1)) ;
00207 
00208     // Resize of the innner boundary of the shell including the NS
00209     double rr_out_nm4 = mp.val_r(nz-4, 1., M_PI/2., 0.) ;
00210     mp.resize(nz-4, rr_in_1/rr_out_nm4 * fact_resize(0)) ;
00211 
00212     //    if (mer % 2 == 0) {
00213 
00214     // Resize of the domain N-2
00215     double rr_out_nm2 = mp.val_r(nz-2, 1., M_PI/2., 0.) ;
00216     mp.resize(nz-2, 2. * rr_in_1 * fact_resize(1) / rr_out_nm2) ;
00217 
00218     if (nz > 5) {
00219 
00220       // Resize of the domain 1
00221       double rr_out_1 = mp.val_r(1, 1., M_PI/2., 0.) ;
00222       mp.resize(1, rr_in_1/rr_out_1 * resize_bh) ;
00223 
00224       if (nz > 6) {
00225 
00226     // Resize of the domain from 2 to N-5
00227     double rr_out_nm4_new = mp.val_r(nz-4, 1., M_PI/2., 0.) ;
00228 
00229     for (int i=1; i<nz-5; i++) {
00230 
00231       double rr_out_i = mp.val_r(i, 1., M_PI/2., 0.) ;
00232 
00233       double rr_mid = rr_out_i
00234         + (rr_out_nm4_new - rr_out_i) / double(nz - 4 - i) ;
00235 
00236       double rr_2timesi = 2. * rr_out_i ;
00237 
00238       if (rr_2timesi < rr_mid) {
00239 
00240         double rr_out_ip1 = mp.val_r(i+1, 1., M_PI/2., 0.) ;
00241         mp.resize(i+1, rr_2timesi / rr_out_ip1) ;
00242 
00243       }
00244       else {
00245 
00246         double rr_out_ip1 = mp.val_r(i+1, 1., M_PI/2., 0.) ;
00247         mp.resize(i+1, rr_mid / rr_out_ip1) ;
00248 
00249       } // End of else
00250 
00251     }  // End of i loop
00252 
00253       }  // End of (nz > 6) loop
00254 
00255     }  // End of (nz > 5) loop
00256 
00257       //    } // End of (mer % 2) loop
00258 
00259 
00260     // Inner boundary condition
00261     // ------------------------
00262 
00263     Valeur bc_lapc(mg->get_angu()) ;
00264     Valeur bc_conf(mg->get_angu()) ;
00265 
00266     Valeur bc_shif_x(mg->get_angu()) ;
00267     Valeur bc_shif_y(mg->get_angu()) ;
00268     Valeur bc_shif_z(mg->get_angu()) ;
00269 
00270     // Error indicators
00271     // ----------------
00272 
00273     double& diff_lapconf = diff.set(0) ;
00274     double& diff_confo = diff.set(1) ;
00275     double& diff_shift_x = diff.set(2) ;
00276     double& diff_shift_y = diff.set(3) ;
00277     double& diff_shift_z = diff.set(4) ;
00278 
00279     Scalar lapconf_jm1 = lapconf_auto_rs ; // Lapconf function at previous step
00280     Scalar confo_jm1 = confo_auto_rs ;  // Conformal factor at preious step
00281     Vector shift_jm1 = shift_auto_rs ;  // Shift vector at previous step
00282 
00283     // Auxiliary quantities
00284     // --------------------
00285 
00286     Scalar source_lapconf(mp) ;
00287     Scalar source_confo(mp) ;
00288     Vector source_shift(mp, CON, mp.get_bvect_cart()) ;
00289 
00290     Scalar lapconf_m1(mp) ;  // = lapconf_auto_rs + 0.5
00291     Scalar confo_m1(mp) ;  // = confo_auto_rs + 0.5
00292 
00293     double mass = ggrav * mass_bh ;
00294 
00295     Scalar rr(mp) ;
00296     rr = mp.r ;
00297     rr.std_spectral_base() ;
00298     Scalar st(mp) ;
00299     st = mp.sint ;
00300     st.std_spectral_base() ;
00301     Scalar ct(mp) ;
00302     ct = mp.cost ;
00303     ct.std_spectral_base() ;
00304     Scalar sp(mp) ;
00305     sp = mp.sinp ;
00306     sp.std_spectral_base() ;
00307     Scalar cp(mp) ;
00308     cp = mp.cosp ;
00309     cp.std_spectral_base() ;
00310 
00311     Vector ll(mp, CON, mp.get_bvect_cart()) ;
00312     ll.set_etat_qcq() ;
00313     ll.set(1) = st % cp ;
00314     ll.set(2) = st % sp ;
00315     ll.set(3) = ct ;
00316     ll.std_spectral_base() ;
00317 
00318     Vector dlappsi(mp, COV, mp.get_bvect_cart()) ;
00319     for (int i=1; i<=3; i++) {
00320         dlappsi.set(i) = lapconf_auto_rs.deriv(i) + d_lapconf_comp(i)
00321       - 7. * lapconf_tot % (confo_auto_rs.deriv(i) + d_confo_comp(i))
00322       / confo_tot ;
00323     }
00324 
00325     dlappsi.std_spectral_base() ;
00326 
00327     //======================================//
00328     //          Start of iteration          //
00329     //======================================//
00330 
00331     for (int mer_bh=0; mer_bh<mermax_bh; mer_bh++) {
00332 
00333         cout << "--------------------------------------------------" << endl ;
00334     cout << "step: " << mer_bh << endl ;
00335     cout << "diff_lapconf = " << diff_lapconf << endl ;
00336     cout << "diff_confo = " << diff_confo << endl ;
00337     cout << "diff_shift : x = " << diff_shift_x
00338          << "  y = " << diff_shift_y << "  z = " << diff_shift_z << endl ;
00339 
00340     if (kerrschild) {
00341 
00342         cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00343         abort() ;
00344 
00345     }  // End of Kerr-Schild
00346     else { // Isotropic coordinates with the maximal slicing
00347 
00348         // Sets C/M^2 for each case of the lapse boundary condition
00349         // --------------------------------------------------------
00350         double cc ;
00351 
00352         if (bc_lapconf_nd) {  // Neumann boundary condition
00353           if (bc_lapconf_fs) {  // First condition
00354         // d(\alpha \psi)/dr = 0
00355         // ---------------------
00356         cc = 2. * (sqrt(13.) - 1.) / 3. ;
00357           }
00358           else {  // Second condition
00359         // d(\alpha \psi)/dr = (\alpha \psi)/(2 rah)
00360         // -----------------------------------------
00361         cc = 4. / 3. ;
00362           }
00363         }
00364         else {  // Dirichlet boundary condition
00365           if (bc_lapconf_fs) {  // First condition
00366         // (\alpha \psi) = 1/2
00367         // -------------------
00368         cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00369         abort() ;
00370           }
00371           else {  // Second condition
00372         // (\alpha \psi) = 1/sqrt(2.) \psi_KS
00373         // ----------------------------------
00374         cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00375         abort() ;
00376         //      cc = 2. * sqrt(2.) ;
00377           }
00378         }
00379 
00380         Scalar r_are(mp) ;
00381         r_are = r_coord(bc_lapconf_nd, bc_lapconf_fs) ;
00382         r_are.std_spectral_base() ;
00383 
00384         Scalar lapbh_iso(mp) ;
00385         lapbh_iso = sqrt(1. - 2.*mass/r_are/rr
00386                  + cc*cc*pow(mass/r_are/rr,4.)) ;
00387         lapbh_iso.std_spectral_base() ;
00388         lapbh_iso.annule_domain(0) ;
00389         lapbh_iso.raccord(1) ;
00390 
00391         Scalar psibh_iso(mp) ;
00392         psibh_iso = sqrt(r_are) ;
00393         psibh_iso.std_spectral_base() ;
00394         psibh_iso.annule_domain(0) ;
00395         psibh_iso.raccord(1) ;
00396 
00397         Scalar dlapbh_iso(mp) ;
00398         dlapbh_iso = mass/r_are/rr - 2.*cc*cc*pow(mass/r_are/rr,4.) ;
00399         dlapbh_iso.std_spectral_base() ;
00400         dlapbh_iso.annule_domain(0) ;
00401         dlapbh_iso.raccord(1) ;
00402 
00403         //---------------------------------------------------------------//
00404         //  Resolution of the Poisson equation for the lapconf function  //
00405         //---------------------------------------------------------------//
00406 
00407         // Source term
00408         // -----------
00409 
00410         Scalar tmpl1(mp) ;
00411         tmpl1 = 0.875 * lapconf_tot % taij_quad_auto
00412           / pow(confo_tot, 8.) ;
00413         tmpl1.std_spectral_base() ;  // dzpuis = 4
00414         tmpl1.annule_domain(0) ;
00415         tmpl1.raccord(1) ;
00416 
00417         Scalar tmpl2(mp) ;
00418         tmpl2 = 0.875 * (lapconf_comp+0.5) * taij_quad_comp
00419           * (pow(confo_tot/(confo_comp+0.5),6.)*(lapconf_comp+0.5)
00420          /lapconf_tot - 1.)
00421           / pow(confo_comp+0.5,8.) ;
00422         tmpl2.std_spectral_base() ;
00423         tmpl2.annule_domain(0) ;  // dzpuis = 4
00424         tmpl2.raccord(1) ;
00425 
00426         Scalar tmpl3(mp) ;
00427         tmpl3 = 5.25 * cc * cc * pow(mass,4.) * lapbh_iso
00428           * (pow(confo_tot,6.)*lapbh_iso/lapconf_tot - pow(psibh_iso,5.))
00429           / pow(r_are*rr,6.) ;
00430         tmpl3.std_spectral_base() ;
00431         tmpl3.annule_domain(0) ;
00432         tmpl3.raccord(1) ;
00433 
00434         tmpl3.inc_dzpuis(4) ;  // dzpuis : 0 -> 4
00435 
00436         source_lapconf = tmpl1 + tmpl2 + tmpl3 ;
00437         source_lapconf.std_spectral_base() ;
00438 
00439         source_lapconf.annule_domain(0) ;
00440         source_lapconf.raccord(1) ;
00441         /*
00442         if (source_lapconf.get_dzpuis() != 4) {
00443           source_lapconf.set_dzpuis(4) ;
00444         }
00445         source_lapconf.std_spectral_base() ;
00446         */
00447         if (filter_r != 0) {
00448           if (source_lapconf.get_etat() != ETATZERO) {
00449             source_lapconf.filtre(filter_r) ;
00450           }
00451         }
00452 
00453         bc_lapc = bc_lapconf() ;
00454 
00455         lapconf_m1.set_etat_qcq() ;
00456 
00457         if (bc_lapconf_nd) {
00458           lapconf_m1 = source_lapconf.poisson_neumann(bc_lapc, 0) ;
00459         }
00460         else {
00461           lapconf_m1 = source_lapconf.poisson_dirichlet(bc_lapc, 0) ;
00462         }
00463 
00464         // Re-construction of the lapconf function
00465         // ---------------------------------------
00466 
00467         lapconf_auto_rs = lapconf_m1 - 0.5 ;
00468         lapconf_auto_rs.annule_domain(0) ;
00469         lapconf_auto_rs.raccord(1) ;
00470 
00471         lapconf_auto = lapconf_auto_rs + lapconf_auto_bh ;
00472         lapconf_auto.annule_domain(0) ; // lapconf_auto,_comp->0.5 (r->inf)
00473         lapconf_auto.raccord(1) ;       // lapconf_tot -> 1 (r->inf)
00474 
00475 
00476         //---------------------------------------------------------------//
00477         //  Resolution of the Poisson equation for the conformal factor  //
00478         //---------------------------------------------------------------//
00479 
00480         // Source term
00481         // -----------
00482 
00483         Scalar tmpc1 = - 0.125 * taij_quad_auto / pow(confo_tot, 7.) ;
00484         tmpc1.std_spectral_base() ; // dzpuis = 4
00485         tmpc1.annule_domain(0) ;
00486         tmpc1.raccord(1) ;
00487 
00488         Scalar tmpc2 = 0.75 * cc * cc * pow(mass,4.)
00489           * (pow(psibh_iso,5.)
00490          - pow(confo_tot,7.)*lapbh_iso*lapbh_iso
00491          /lapconf_tot/lapconf_tot)
00492           / pow(r_are*rr,6.) ;
00493         tmpc2.std_spectral_base() ;
00494         tmpc2.annule_domain(0) ;
00495         tmpc2.raccord(1) ;
00496 
00497         tmpc2.inc_dzpuis(4) ;  // dzpuis : 0 -> 4
00498 
00499         Scalar tmpc3 = 0.125 * taij_quad_comp
00500           * (1. - pow(confo_tot/(confo_comp+0.5),7.)
00501          *pow((lapconf_comp+0.5)/lapconf_tot,2.))
00502           / pow(confo_comp+0.5, 7.) ;
00503         tmpc3.std_spectral_base() ; // dzpuis = 4
00504         tmpc3.annule_domain(0) ;
00505         tmpc3.raccord(1) ;
00506 
00507         source_confo = tmpc1 + tmpc2 + tmpc3 ;
00508         source_confo.std_spectral_base() ;
00509 
00510         source_confo.annule_domain(0) ;
00511         source_confo.raccord(1) ;
00512         /*
00513         if (source_confo.get_dzpuis() != 4) {
00514           source_confo.set_dzpuis(4) ;
00515         }
00516         source_confo.std_spectral_base() ;
00517         */
00518         if (filter_r != 0) {
00519           if (source_confo.get_etat() != ETATZERO) {
00520             source_confo.filtre(filter_r) ;
00521           }
00522         }
00523 
00524         bc_conf = bc_confo(omega_orb, x_rot, y_rot) ;
00525 
00526         confo_m1.set_etat_qcq() ;
00527 
00528         confo_m1 = source_confo.poisson_neumann(bc_conf, 0) ;
00529 
00530         // Re-construction of the conformal factor
00531         // ---------------------------------------
00532         confo_auto_rs = confo_m1 - 0.5 ;
00533         confo_auto_rs.annule_domain(0) ;
00534         confo_auto_rs.raccord(1) ;
00535 
00536         confo_auto = confo_auto_rs + confo_auto_bh ;
00537         confo_auto.annule_domain(0) ;  // confo_auto,_comp->0.5 (r->inf)
00538         confo_auto.raccord(1) ;        // confo_tot -> 1 (r->inf)
00539 
00540 
00541         //-----------------------------------------------------------//
00542         //  Resolution of the Poisson equation for the shift vector  //
00543         //-----------------------------------------------------------//
00544 
00545         // Source term
00546         // -----------
00547 
00548         Vector dlapconf(mp, COV, mp.get_bvect_cart()) ;
00549         for (int i=1; i<=3; i++) {
00550           dlapconf.set(i) = lapconf_auto_rs.deriv(i)
00551         - 7. * lapconf_tot % confo_auto_rs.deriv(i)
00552         / confo_tot ;
00553         }
00554 
00555         dlapconf.std_spectral_base() ;
00556 
00557         Vector tmps1 = 2. * contract(taij_auto_rs, 1, dlappsi, 0)
00558           / pow(confo_tot, 7.)
00559           + 2. * contract(taij_comp, 1, dlapconf, 0)
00560           * (lapconf_comp+0.5) / lapconf_tot / pow(confo_comp+0.5, 7.) ;
00561         tmps1.std_spectral_base() ; // dzpuis = 4
00562         tmps1.annule_domain(0) ;
00563         for (int i=1; i<=3; i++) {
00564             tmps1.set(i).raccord(1) ;
00565         }
00566 
00567         Vector tmps2(mp, CON, mp.get_bvect_cart()) ;
00568         tmps2.set_etat_qcq() ;
00569         for (int i=1; i<=3; i++) {
00570           tmps2.set(i) = 2. * psibh_iso
00571         * (dlapbh_iso + 0.5*(lapbh_iso - 1.)
00572            *(lapbh_iso - 7.*lapconf_tot/confo_tot))
00573         * (taij_tot_rs(i,1)%ll(1) + taij_tot_rs(i,2)%ll(2)
00574            + taij_tot_rs(i,3)%ll(3)) / pow(confo_tot,7.) / rr ;
00575         }
00576         tmps2.std_spectral_base() ;
00577         tmps2.annule_domain(0) ;
00578         for (int i=1; i<=3; i++) {
00579             tmps2.set(i).raccord(1) ;
00580         }
00581         for (int i=1; i<=3; i++) {
00582             (tmps2.set(i)).inc_dzpuis(2) ;  // dzpuis : 2 -> 4
00583         }
00584 
00585         Vector tmps3(mp, CON, mp.get_bvect_cart()) ;
00586         tmps3.set_etat_qcq() ;
00587         for (int i=1; i<=3; i++) {
00588             tmps3.set(i) = 2. * cc * mass * mass * lapbh_iso
00589           * (dlappsi(i) - 3.*ll(i)*(ll(1)%dlappsi(1)
00590                         + ll(2)%dlappsi(2)
00591                         + ll(3)%dlappsi(3)))
00592           / lapconf_tot / pow(r_are*rr,3.) ;
00593         }
00594         tmps3.std_spectral_base() ;
00595         tmps3.annule_domain(0) ;
00596         for (int i=1; i<=3; i++) {
00597             tmps3.set(i).raccord(1) ;
00598         }
00599         for (int i=1; i<=3; i++) {
00600             (tmps3.set(i)).inc_dzpuis(2) ;  // dzpuis : 2 -> 4
00601         }
00602 
00603         Vector tmps4 = 4. * cc * mass * mass
00604           * (dlapbh_iso * (1. - psibh_iso*lapbh_iso/lapconf_tot)
00605          + 0.5 * lapbh_iso * (lapbh_iso - 1.)
00606          * (6.*(psibh_iso/confo_tot - 1.)
00607             + psibh_iso*(1./confo_tot - lapbh_iso/lapconf_tot)))
00608           * ll / rr / pow(r_are*rr,3.) ;
00609         tmps4.std_spectral_base() ;
00610         tmps4.annule_domain(0) ;
00611         for (int i=1; i<=3; i++) {
00612             tmps4.set(i).raccord(1) ;
00613         }
00614         for (int i=1; i<=3; i++) {
00615             (tmps4.set(i)).inc_dzpuis(4) ;  // dzpuis : 0 -> 4
00616         }
00617 
00618         Vector dlappsi_comp(mp, COV, mp.get_bvect_cart()) ;
00619         for (int i=1; i<=3; i++) {
00620           dlappsi_comp.set(i) = ((lapconf_comp+0.5)/lapconf_tot - 1.)
00621         * d_lapconf_comp(i)
00622         - 7. * (lapconf_comp+0.5) * ((confo_comp+0.5)/confo_tot - 1.)
00623         * d_confo_comp(i) / (confo_comp+0.5) ;
00624         }
00625 
00626         dlappsi_comp.std_spectral_base() ;
00627 
00628         Vector tmps5 = 2. * contract(taij_comp, 1, dlappsi_comp, 0)
00629           / pow(confo_comp+0.5, 7.) ;
00630         tmps5.std_spectral_base() ;
00631         tmps5.annule_domain(0) ;
00632         for (int i=1; i<=3; i++) {
00633             tmps5.set(i).raccord(1) ;
00634         }
00635 
00636         source_shift = tmps1 + tmps2 + tmps3 + tmps4 + tmps5 ;
00637         source_shift.std_spectral_base() ;
00638         source_shift.annule_domain(0) ;
00639 
00640         for (int i=1; i<=3; i++) {
00641             source_shift.set(i).raccord(1) ;
00642         }
00643 
00644         if (filter_r_s != 0) {
00645           for (int i=1; i<=3; i++) {
00646             if (source_shift(i).get_etat() != ETATZERO)
00647           source_shift.set(i).filtre(filter_r_s) ;
00648           }
00649         }
00650 
00651         if (filter_p_s != 0) {
00652           for (int i=1; i<=3; i++) {
00653             if (source_shift(i).get_etat() != ETATZERO) {
00654           source_shift.set(i).filtre_phi(filter_p_s, nz-1) ;
00655           /*
00656           for (int l=1; l<nz; l++) {
00657             source_shift.set(i).filtre_phi(filter_p_s, l) ;
00658           }
00659           */
00660         }
00661           }
00662         }
00663 
00664         /*
00665         for (int i=1; i<=3; i++) {
00666           if (source_shift(i).dz_nonzero()) {
00667             assert( source_shift(i).get_dzpuis() == 4 ) ;
00668           }
00669           else {
00670             (source_shift.set(i)).set_dzpuis(4) ;
00671           }
00672         }
00673         */
00674 
00675         Tenseur source_p(mp, 1, CON, mp.get_bvect_cart()) ;
00676         source_p.set_etat_qcq() ;
00677         for (int i=0; i<3; i++) {
00678           source_p.set(i) = Cmp(source_shift(i+1)) ;
00679         }
00680 
00681         Tenseur resu_p(mp, 1, CON, mp.get_bvect_cart()) ;
00682         resu_p.set_etat_qcq() ;
00683 
00684         for (int i=0; i<3; i++) {
00685           resu_p.set(i) = Cmp(shift_auto_rs(i+1)) ;
00686         }
00687 
00688         // Boundary condition
00689         bc_shif_x = bc_shift_x(omega_orb, y_rot) ;
00690         bc_shif_y = bc_shift_y(omega_orb, x_rot) ;
00691         bc_shif_z = bc_shift_z() ;
00692 
00693         poisson_vect_frontiere(1./3., source_p, resu_p,
00694                    bc_shif_x, bc_shif_y, bc_shif_z,
00695                    0, precis, 7) ;
00696 
00697         for (int i=1; i<=3; i++) {
00698           shift_auto_rs.set(i) = resu_p(i-1) ;
00699         }
00700 
00701         shift_auto_rs.std_spectral_base() ;
00702         shift_auto_rs.annule_domain(0) ;
00703         for (int i=1; i<=3; i++) {
00704             shift_auto_rs.set(i).raccord(1) ;
00705         }
00706 
00707         shift_auto = shift_auto_rs + shift_auto_bh ;
00708         shift_auto.std_spectral_base() ;
00709         shift_auto.annule_domain(0) ;
00710         for (int i=1; i<=3; i++) {
00711             shift_auto.set(i).raccord(1) ;
00712         }
00713 
00714     }  // End of isotropic
00715 
00716     //------------------------------------------------//
00717     //  Relative difference in the metric quantities  //
00718     //------------------------------------------------//
00719 
00720     // Difference is calculated only outside the inner boundary.
00721 
00722     Tbl tdiff_lapconf = diffrel(lapconf_auto_rs, lapconf_jm1) ;
00723     tdiff_lapconf.set(0) = 0. ;
00724     cout << "Relative difference in the lapconf function : " << endl ;
00725     for (int l=0; l<nz; l++) {
00726         cout << tdiff_lapconf(l) << "  " ;
00727     }
00728     cout << endl ;
00729 
00730     diff_lapconf = tdiff_lapconf(1) ;
00731     for (int l=2; l<nz; l++) {
00732         diff_lapconf += tdiff_lapconf(l) ;
00733     }
00734     diff_lapconf /= nz ;
00735 
00736     Tbl tdiff_confo = diffrel(confo_auto_rs, confo_jm1) ;
00737     tdiff_confo.set(0) = 0. ;
00738     cout << "Relative difference in the conformal factor : " << endl ;
00739     for (int l=0; l<nz; l++) {
00740         cout << tdiff_confo(l) << "  " ;
00741     }
00742     cout << endl ;
00743 
00744     diff_confo = tdiff_confo(1) ;
00745     for (int l=2; l<nz; l++) {
00746         diff_confo += tdiff_confo(l) ;
00747     }
00748     diff_confo /= nz ;
00749 
00750     Tbl tdiff_shift_x = diffrel(shift_auto_rs(1), shift_jm1(1)) ;
00751     tdiff_shift_x.set(0) = 0. ;
00752     cout << "Relative difference in the shift vector (x) : " << endl ;
00753     for (int l=0; l<nz; l++) {
00754         cout << tdiff_shift_x(l) << "  " ;
00755     }
00756     cout << endl ;
00757 
00758     diff_shift_x = tdiff_shift_x(1) ;
00759     for (int l=2; l<nz; l++) {
00760         diff_shift_x += tdiff_shift_x(l) ;
00761     }
00762     diff_shift_x /= nz ;
00763 
00764     Tbl tdiff_shift_y = diffrel(shift_auto_rs(2), shift_jm1(2)) ;
00765     tdiff_shift_y.set(0) = 0. ;
00766     cout << "Relative difference in the shift vector (y) : " << endl ;
00767     for (int l=0; l<nz; l++) {
00768         cout << tdiff_shift_y(l) << "  " ;
00769     }
00770     cout << endl ;
00771 
00772     diff_shift_y = tdiff_shift_y(1) ;
00773     for (int l=2; l<nz; l++) {
00774         diff_shift_y += tdiff_shift_y(l) ;
00775     }
00776     diff_shift_y /= nz ;
00777 
00778     Tbl tdiff_shift_z = diffrel(shift_auto_rs(3), shift_jm1(3)) ;
00779     tdiff_shift_z.set(0) = 0. ;
00780     cout << "Relative difference in the shift vector (z) : " << endl ;
00781     for (int l=0; l<nz; l++) {
00782         cout << tdiff_shift_z(l) << "  " ;
00783     }
00784     cout << endl ;
00785 
00786     diff_shift_z = tdiff_shift_z(1) ;
00787     for (int l=2; l<nz; l++) {
00788         diff_shift_z += tdiff_shift_z(l) ;
00789     }
00790     diff_shift_z /= nz ;
00791 
00792     /*
00793     des_profile( lapconf_auto_rs, 0., 10.,
00794              M_PI/2., 0., "Residual lapconf function of BH",
00795              "Lapconf (theta=pi/2, phi=0)" ) ;
00796 
00797     des_profile( lapconf_auto_bh, 0., 10.,
00798              M_PI/2., 0., "Analytic lapconf function of BH",
00799              "Lapconf (theta=pi/2, phi=0)" ) ;
00800 
00801     des_profile( lapconf_auto, 0., 10.,
00802              M_PI/2., 0., "Self lapconf function of BH",
00803              "Lapconf (theta=pi/2, phi=0)" ) ;
00804 
00805     des_profile( lapconf_tot, 0., 10.,
00806              M_PI/2., 0., "Total lapconf function of BH",
00807              "Lapconf (theta=pi/2, phi=0)" ) ;
00808 
00809     des_profile( confo_auto_rs, 0., 10.,
00810              M_PI/2., 0., "Residual conformal factor of BH",
00811              "Confo (theta=pi/2, phi=0)" ) ;
00812 
00813     des_profile( confo_auto_bh, 0., 10.,
00814              M_PI/2., 0., "Analytic conformal factor of BH",
00815              "Confo (theta=pi/2, phi=0)" ) ;
00816 
00817     des_profile( confo_auto, 0., 10.,
00818              M_PI/2., 0., "Self conformal factor of BH",
00819              "Confo (theta=pi/2, phi=0)" ) ;
00820 
00821     des_profile( confo_tot, 0., 10.,
00822              M_PI/2., 0., "Total conformal factor of BH",
00823              "Confo (theta=pi/2, phi=0)" ) ;
00824 
00825     des_coupe_vect_z( shift_auto_rs, 0., -3., 0.5, 3,
00826               "Residual shift vector of NS") ;
00827 
00828     des_coupe_vect_z( shift_auto_bh, 0., -3., 0.5, 3,
00829               "Analytic shift vector of NS") ;
00830 
00831     des_coupe_vect_z( shift_auto, 0., -3., 0.5, 3,
00832               "Self shift vector of NS") ;
00833 
00834     des_coupe_vect_z( shift_tot, 0., -3., 0.5, 3,
00835               "Total Shift vector seen by NS") ;
00836     */
00837     } // End of main loop
00838 
00839     //====================================//
00840     //          End of iteration          //
00841     //====================================//
00842 
00843 }

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