blackhole_eq_spher.C

00001 /*
00002  *  Method of class Black_hole to compute a single black hole
00003  *
00004  *    (see file blackhole.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005-2007 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 blackhole_eq_spher_C[] = "$Header: /cvsroot/Lorene/C++/Source/Black_hole/blackhole_eq_spher.C,v 1.3 2008/07/02 20:42:53 k_taniguchi Exp $" ;
00029 
00030 /*
00031  * $Id: blackhole_eq_spher.C,v 1.3 2008/07/02 20:42:53 k_taniguchi Exp $
00032  * $Log: blackhole_eq_spher.C,v $
00033  * Revision 1.3  2008/07/02 20:42:53  k_taniguchi
00034  * Modification of the argument and so on.
00035  *
00036  * Revision 1.2  2008/05/15 19:26:30  k_taniguchi
00037  * Change of some parameters.
00038  *
00039  * Revision 1.1  2007/06/22 01:19:11  k_taniguchi
00040  * *** empty log message ***
00041  *
00042  *
00043  * $Header: /cvsroot/Lorene/C++/Source/Black_hole/blackhole_eq_spher.C,v 1.3 2008/07/02 20:42:53 k_taniguchi Exp $
00044  *
00045  */
00046 
00047 // C++ headers
00048 //#include <>
00049 
00050 // C headers
00051 #include <math.h>
00052 
00053 // Lorene headers
00054 #include "blackhole.h"
00055 #include "cmp.h"
00056 #include "tenseur.h"
00057 #include "param.h"
00058 #include "unites.h"
00059 #include "proto.h"
00060 #include "utilitaires.h"
00061 #include "graphique.h"
00062 
00063 void Black_hole::equilibrium_spher(bool neumann, bool first,
00064                    double spin_omega, double precis,
00065                    double precis_shift) {
00066 
00067     // Fundamental constants and units
00068     // -------------------------------
00069     using namespace Unites ;
00070 
00071     // Initializations
00072     // ---------------
00073 
00074     const Mg3d* mg = mp.get_mg() ;
00075     int nz = mg->get_nzone() ;          // total number of domains
00076 
00077     double mass = ggrav * mass_bh ;
00078 
00079     // Inner boundary condition
00080     // ------------------------
00081 
00082     Valeur bc_lpcnf(mg->get_angu()) ;
00083     Valeur bc_conf(mg->get_angu()) ;
00084 
00085     Valeur bc_shif_x(mg->get_angu()) ;
00086     Valeur bc_shif_y(mg->get_angu()) ;
00087     Valeur bc_shif_z(mg->get_angu()) ;
00088 
00089     Scalar rr(mp) ;
00090     rr = mp.r ;
00091     rr.std_spectral_base() ;
00092     Scalar st(mp) ;
00093     st = mp.sint ;
00094     st.std_spectral_base() ;
00095     Scalar ct(mp) ;
00096     ct = mp.cost ;
00097     ct.std_spectral_base() ;
00098     Scalar sp(mp) ;
00099     sp = mp.sinp ;
00100     sp.std_spectral_base() ;
00101     Scalar cp(mp) ;
00102     cp = mp.cosp ;
00103     cp.std_spectral_base() ;
00104 
00105     Vector ll(mp, CON, mp.get_bvect_cart()) ;
00106     ll.set_etat_qcq() ;
00107     ll.set(1) = st * cp ;
00108     ll.set(2) = st * sp ;
00109     ll.set(3) = ct ;
00110     ll.std_spectral_base() ;
00111 
00112     // Sets C/M^2 for each case of the lapse boundary condition
00113     // --------------------------------------------------------
00114     double cc ;
00115 
00116     if (neumann) {  // Neumann boundary condition
00117         if (first) {  // First condition
00118       // d(\alpha \psi)/dr = 0
00119       // ---------------------
00120       cc = 2. * (sqrt(13.) - 1.) / 3. ;
00121     }
00122     else {  // Second condition
00123       // d(\alpha \psi)/dr = (\alpha \psi)/(2 rah)
00124       // -----------------------------------------
00125       cc = 4. / 3. ;
00126     }
00127     }
00128     else {  // Dirichlet boundary condition
00129        if (first) {  // First condition
00130      // (\alpha \psi) = 1/2
00131      // -------------------
00132      cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00133      abort() ;
00134        }
00135        else {  // Second condition
00136      // (\alpha \psi) = 1/sqrt(2.) \psi_KS
00137      // ----------------------------------
00138      cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00139      abort() ;
00140      //  cc = 2. * sqrt(2.) ;
00141        }
00142     }
00143 
00144 
00145     // Ininital metric
00146     if (kerrschild) {
00147 
00148         lapconf_bh = 1. / sqrt(1. + 2. * mass / rr) ;
00149     lapconf_bh.std_spectral_base() ;
00150     lapconf_bh.annule_domain(0) ;
00151     lapconf_bh.raccord(1) ;
00152 
00153     lapconf = lapconf_bh ;
00154     lapconf.std_spectral_base() ;
00155     lapconf_rs = 0. ;
00156     lapconf_rs.std_spectral_base() ;
00157 
00158         lapse = lapconf ;
00159     lapse.std_spectral_base() ;
00160 
00161     confo = 1. ;
00162     confo.std_spectral_base() ;
00163 
00164     Scalar lapse_bh(mp) ;
00165     lapse_bh = 1. / sqrt(1. + 2. * mass / rr) ;
00166     lapse_bh.std_spectral_base() ;
00167     lapse_bh.annule_domain(0) ;
00168     lapse_bh.raccord(1) ;
00169 
00170     for (int i=1; i<=3; i++) {
00171         shift_bh.set(i) = 2. * lapse_bh * lapse_bh * mass * ll(i) / rr ;
00172     }
00173     shift_bh.std_spectral_base() ;
00174 
00175     shift = shift_bh ;
00176     shift.std_spectral_base() ;
00177     shift_rs.set_etat_zero() ;
00178 
00179     }
00180     else {  // Isotropic coordinates
00181 
00182         Scalar r_are(mp) ;
00183     r_are = r_coord(neumann, first) ;
00184     r_are.std_spectral_base() ;
00185     r_are.annule_domain(0) ;
00186     r_are.raccord(1) ;
00187     /*
00188     cout << "r_are:" << endl ;
00189     for (int l=0; l<nz; l++) {
00190       cout << r_are.val_grid_point(l,0,0,0) << endl ;
00191     }
00192     */
00193 
00194     // Exact, non-spinning case
00195     /*
00196     lapconf = sqrt(1. - 2.*mass/r_are/rr
00197                + cc*cc*pow(mass/r_are/rr,4.))
00198       * sqrt(r_are) ;
00199     */
00200     lapconf = sqrt(1. - 1.9*mass/r_are/rr
00201                + cc*cc*pow(mass/r_are/rr,4.))
00202       * sqrt(r_are) ;
00203     lapconf.std_spectral_base() ;
00204     lapconf.annule_domain(0) ;
00205     lapconf.raccord(1) ;
00206 
00207     /*
00208     lapse = sqrt(1. - 2.*mass/r_are/rr
00209              + cc*cc*pow(mass/r_are/rr,4.)) ;
00210     */
00211     lapse = sqrt(1. - 1.9*mass/r_are/rr
00212              + cc*cc*pow(mass/r_are/rr,4.)) ;
00213     lapse.std_spectral_base() ;
00214     lapse.annule_domain(0) ;
00215     lapse.raccord(1) ;
00216 
00217     //  confo = sqrt(r_are) ;
00218     confo = sqrt(0.9*r_are) ;
00219     confo.std_spectral_base() ;
00220     confo.annule_domain(0) ;
00221     confo.raccord(1) ;
00222 
00223     for (int i=1; i<=3; i++) {
00224         shift.set(i) = mass * mass * cc * ll(i) / rr / rr
00225           / pow(r_are,3.) ;
00226     }
00227 
00228     shift.std_spectral_base() ;
00229 
00230     for (int i=1; i<=3; i++) {
00231         shift.set(i).annule_domain(0) ;
00232         shift.set(i).raccord(1) ;
00233     }
00234 
00235     /*
00236     des_profile( r_are, 0., 20, M_PI/2., 0.,
00237              "Areal coordinate",
00238              "Areal (theta=pi/2, phi=0)" ) ;
00239 
00240     des_profile( lapse, 0., 20, M_PI/2., 0.,
00241              "Initial lapse function of BH",
00242              "Lapse (theta=pi/2, phi=0)" ) ;
00243 
00244     des_profile( confo, 0., 20, M_PI/2., 0.,
00245              "Initial conformal factor of BH",
00246              "Confo (theta=pi/2, phi=0)" ) ;
00247 
00248     des_profile( shift(1), 0., 20, M_PI/2., 0.,
00249              "Initial shift vector (X) of BH",
00250              "Shift (theta=pi/2, phi=0)" ) ;
00251 
00252     des_coupe_vect_z( shift, 0., -3., 0.5, 4,
00253                "Shift vector of BH") ;
00254     */
00255     }
00256 
00257     // Auxiliary quantities
00258     // --------------------
00259 
00260     Scalar source_lapconf(mp) ;
00261     Scalar source_confo(mp) ;
00262     Vector source_shift(mp, CON, mp.get_bvect_cart()) ;
00263 
00264     Scalar lapconf_m1(mp) ;  // = lapconf - 1 (only for the isotropic case)
00265     Scalar confo_m1(mp) ;  // = confo - 1
00266 
00267     Scalar lapconf_jm1(mp) ;
00268     Scalar confo_jm1(mp) ;
00269     Vector shift_jm1(mp, CON, mp.get_bvect_cart()) ;
00270 
00271     double diff_lp = 1. ;
00272     double diff_cf = 1. ;
00273     double diff_sx = 1. ;
00274     double diff_sy = 1. ;
00275     double diff_sz = 1. ;
00276 
00277     int mermax = 200 ;          // max number of iterations
00278 
00279     //======================================//
00280     //          Start of iteration          //
00281     //======================================//
00282     /*
00283     for (int mer=0;
00284      (diff_lp > precis) || (diff_cf > precis) && (mer < mermax); mer++) {
00285 
00286     for (int mer=0;
00287      (diff_sx > precis) || (diff_sy > precis) || (diff_sz > precis)
00288        && (mer < mermax); mer++) {
00289     */
00290     for (int mer=0; (diff_lp > precis) && (diff_cf > precis) && (diff_sx > precis) && (diff_sy > precis) && (diff_sz > precis) && (mer < mermax); mer++) {
00291 
00292         cout << "--------------------------------------------------" << endl ;
00293     cout << "step: " << mer << endl ;
00294     cout << "diff_lapconf = " << diff_lp << endl ;
00295     cout << "diff_confo =   " << diff_cf << endl ;
00296     cout << "diff_shift : x = " << diff_sx
00297          << "  y = " << diff_sy << "  z = " << diff_sz << endl ;
00298 
00299     if (kerrschild) {
00300         lapconf_jm1 = lapconf_rs ;
00301         confo_jm1 = confo ;
00302         shift_jm1 = shift_rs ;
00303     }
00304     else {
00305         lapconf_jm1 = lapconf ;
00306         confo_jm1 = confo ;
00307         shift_jm1 = shift ;
00308     }
00309 
00310     //------------------------------------------//
00311     //  Computation of the extrinsic curvature  //
00312     //------------------------------------------//
00313 
00314     extr_curv_bh() ;
00315 
00316     //---------------------------------------------------------------//
00317     //  Resolution of the Poisson equation for the lapconf function  //
00318     //---------------------------------------------------------------//
00319 
00320     // Source term
00321     // -----------
00322 
00323     if (kerrschild) {
00324 
00325       cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00326       abort() ;
00327 
00328     }
00329     else {  // Isotropic coordinates with the maximal slicing
00330 
00331         source_lapconf = 7. * lapconf_jm1 % taij_quad
00332           / pow(confo_jm1, 8.) / 8. ;
00333 
00334     }
00335 
00336     source_lapconf.annule_domain(0) ;
00337     source_lapconf.set_dzpuis(4) ;
00338     source_lapconf.std_spectral_base() ;
00339 
00340     /*
00341     Scalar tmp_source = source_lapse ;
00342     tmp_source.dec_dzpuis(4) ;
00343     tmp_source.std_spectral_base() ;
00344 
00345     des_profile( tmp_source, 0., 20, M_PI/2., 0.,
00346              "Source term of lapse",
00347              "source_lapse (theta=pi/2, phi=0)" ) ;
00348     */
00349 
00350     bc_lpcnf = bc_lapconf(neumann, first) ;
00351 
00352 
00353     if (kerrschild) {
00354 
00355         cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00356         abort() ;
00357         /*
00358         lapconf_rs.set_etat_qcq() ;
00359 
00360         if (neumann) {
00361             lapconf_rs = source_lapconf.poisson_neumann(bc_lpcnf, 0) ;
00362         }
00363         else {
00364             lapconf_rs = source_lapconf.poisson_dirichlet(bc_lpcnf, 0) ;
00365         }
00366 
00367         // Re-construction of the lapse function
00368         // -------------------------------------
00369         lapconf_rs.annule_domain(0) ;
00370         lapconf_rs.raccord(1) ;
00371 
00372         lapconf = lapconf_rs + lapconf_bh ;
00373         lapconf.annule_domain(0) ;
00374         lapconf.raccord(1) ;
00375         */
00376     }
00377     else {  // Isotropic coordinates with the maximal slicing
00378 
00379         lapconf_m1.set_etat_qcq() ;
00380 
00381         if (neumann) {
00382             lapconf_m1 = source_lapconf.poisson_neumann(bc_lpcnf, 0) ;
00383         }
00384         else {
00385             lapconf_m1 = source_lapconf.poisson_dirichlet(bc_lpcnf, 0) ;
00386         }
00387 
00388         // Re-construction of the lapse function
00389         // -------------------------------------
00390         lapconf = lapconf_m1 + 1. ;
00391         lapconf.annule_domain(0) ;
00392         lapconf.raccord(1) ;
00393         /*
00394         des_profile( lapse, 0., 20, M_PI/2., 0.,
00395              "Lapse function of BH",
00396              "Lapse (theta=pi/2, phi=0)" ) ;
00397         */
00398     }
00399 
00400     //---------------------------------------------------------------//
00401     //  Resolution of the Poisson equation for the conformal factor  //
00402     //---------------------------------------------------------------//
00403 
00404     // Source term
00405     // -----------
00406 
00407     if (kerrschild) {
00408 
00409         cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00410         abort() ;
00411 
00412     }
00413     else {  // Isotropic coordinates with the maximal slicing
00414 
00415         Scalar tmp1 = - 0.125 * taij_quad / pow(confo_jm1, 7.) ;
00416         tmp1.std_spectral_base() ;
00417         tmp1.inc_dzpuis(4-tmp1.get_dzpuis()) ;
00418 
00419         source_confo = tmp1 ;
00420 
00421     }
00422 
00423     source_confo.annule_domain(0) ;
00424     source_confo.set_dzpuis(4) ;
00425     source_confo.std_spectral_base() ;
00426 
00427     bc_conf = bc_confo() ;
00428 
00429     confo_m1.set_etat_qcq() ;
00430 
00431     confo_m1 = source_confo.poisson_neumann(bc_conf, 0) ;
00432 
00433     // Re-construction of the conformal factor
00434     // ---------------------------------------
00435 
00436     confo = confo_m1 + 1. ;
00437     confo.annule_domain(0) ;
00438     confo.raccord(1) ;
00439 
00440     //-----------------------------------------------------------//
00441     //  Resolution of the Poisson equation for the shift vector  //
00442     //-----------------------------------------------------------//
00443 
00444     // Source term
00445     // -----------
00446 
00447     Scalar confo7(mp) ;
00448     confo7 = pow(confo_jm1, 7.) ;
00449     confo7.std_spectral_base() ;
00450 
00451     Vector dlappsi(mp, COV, mp.get_bvect_cart()) ;
00452     for (int i=1; i<=3; i++)
00453         dlappsi.set(i) = (lapconf_jm1.deriv(i)
00454                   - 7.*lapconf*confo_jm1.deriv(i)/confo_jm1)
00455           / confo7 ;
00456 
00457     dlappsi.std_spectral_base() ;
00458     dlappsi.annule_domain(0) ;
00459 
00460 
00461     if (kerrschild) {
00462 
00463         cout << "!!!!! WARNING: Not yet available !!!!!" << endl ;
00464         abort() ;
00465 
00466     }
00467     else {  // Isotropic coordinates with the maximal slicing
00468 
00469         source_shift = 2. * contract(taij, 1, dlappsi, 0) ;
00470 
00471     }
00472 
00473     source_shift.annule_domain(0) ;
00474     /*
00475     for (int i=1; i<=3; i++)
00476         (source_shift.set(i)).raccord(1) ;
00477     */
00478     /*
00479     for (int i=1; i<=3; i++) {
00480         (source_shift.set(i)).set_dzpuis(4) ;
00481     }
00482     */
00483     source_shift.std_spectral_base() ;
00484 
00485     for (int i=1; i<=3; i++) {
00486         if (source_shift(i).get_etat() != ETATZERO)
00487             source_shift.set(i).filtre(4) ;
00488     }
00489 
00490     /*
00491     for (int i=1; i<=3; i++) {
00492         if (source_shift(i).dz_nonzero()) {
00493             assert( source_shift(i).get_dzpuis() == 4 ) ;
00494         }
00495         else {
00496             (source_shift.set(i)).set_dzpuis(4) ;
00497         }
00498     }
00499     */
00500 
00501     Tenseur source_p(mp, 1, CON, mp.get_bvect_cart()) ;
00502     source_p.set_etat_qcq() ;
00503     for (int i=0; i<3; i++) {
00504         source_p.set(i) = Cmp(source_shift(i+1)) ;
00505     }
00506 
00507     Tenseur resu_p(mp, 1, CON, mp.get_bvect_cart()) ;
00508     resu_p.set_etat_qcq() ;
00509 
00510     for (int i=0; i<3; i++) {
00511         resu_p.set(i) = Cmp(shift_jm1(i+1)) ;
00512     }
00513 
00514     bc_shif_x = bc_shift_x(spin_omega) ;  // Rotating BH
00515     bc_shif_y = bc_shift_y(spin_omega) ;  // Rotating BH
00516     bc_shif_z = bc_shift_z() ;
00517     /*
00518     cout << bc_shif_x << endl ;
00519     arrete() ;
00520     cout << bc_shif_y << endl ;
00521     arrete() ;
00522     cout << bc_shif_z << endl ;
00523     arrete() ;
00524     */
00525     poisson_vect_frontiere(1./3., source_p, resu_p,
00526                    bc_shif_x, bc_shif_y, bc_shif_z,
00527                    0, precis_shift, 14) ;
00528 
00529 
00530     if (kerrschild) {
00531         for (int i=1; i<=3; i++)
00532             shift_rs.set(i) = resu_p(i-1) ;
00533 
00534         for (int i=1; i<=3; i++)
00535             shift.set(i) = shift_rs(i) + shift_bh(i) ;
00536 
00537         shift_rs.annule_domain(0) ;
00538     }
00539     else {  // Isotropic coordinates with the maximal slicing
00540         for (int i=1; i<=3; i++)
00541             shift.set(i) = resu_p(i-1) ;
00542     }
00543 
00544     shift.annule_domain(0) ;
00545 
00546     for (int i=1; i<=3; i++)
00547         shift.set(i).raccord(1) ;
00548 
00549 
00550     /*
00551     Tbl diff_shftx = diffrel(shift(1), shift_ex(1)) ;
00552     double diff_shfx = diff_shftx(1) ;
00553     for (int l=2; l<nz; l++) {
00554         diff_shfx += diff_shftx(l) ;
00555     }
00556     diff_shfx /= nz ;
00557 
00558     cout << "diff_shfx : " << diff_shfx << endl ;
00559     */
00560 
00561     //------------------------------------------------//
00562     //  Relative difference in the metric quantities  //
00563     //------------------------------------------------//
00564 
00565     /*
00566     des_profile( lapse, 0., 20, M_PI/2., 0.,
00567              "Lapse function of BH",
00568              "Lapse (theta=pi/2, phi=0)" ) ;
00569 
00570     des_profile( confo, 0., 20, M_PI/2., 0.,
00571              "Conformal factor of BH",
00572              "Confo (theta=pi/2, phi=0)" ) ;
00573 
00574     des_coupe_vect_z( shift, 0., -3., 0.5, 4,
00575                "Shift vector of BH") ;
00576     */
00577     // Difference is calculated only outside the inner boundary.
00578 
00579     // Lapconf function
00580     // ----------------
00581     Tbl diff_lapconf(nz) ;
00582 
00583     if (kerrschild) {
00584 
00585         diff_lapconf = diffrel(lapconf_rs, lapconf_jm1) ;
00586 
00587     }
00588     else {  // Isotropic coordinates with the maximal slicing
00589 
00590         diff_lapconf = diffrel(lapconf, lapconf_jm1) ;
00591 
00592     }
00593     /*
00594     cout << "lapse: " << endl ;
00595     for (int l=0; l<nz; l++) {
00596       cout << lapse.val_grid_point(l,0,0,0) << endl ;
00597     }
00598 
00599     cout << "lapse_jm1: " << endl ;
00600     for (int l=0; l<nz; l++) {
00601       cout << lapse_jm1.val_grid_point(l,0,0,0) << endl ;
00602     }
00603     */
00604 
00605     cout << "Relative difference in the lapconf function   : " << endl ;
00606     for (int l=0; l<nz; l++) {
00607         cout << diff_lapconf(l) << "  " ;
00608     }
00609     cout << endl ;
00610 
00611     diff_lp = diff_lapconf(1) ;
00612     for (int l=2; l<nz; l++) {
00613         diff_lp += diff_lapconf(l) ;
00614     }
00615     diff_lp /= nz ;
00616 
00617     // Conformal factor
00618     // ----------------
00619     Tbl diff_confo = diffrel(confo, confo_jm1) ;
00620 
00621     cout << "Relative difference in the conformal factor : " << endl ;
00622     for (int l=0; l<nz; l++) {
00623         cout << diff_confo(l) << "  " ;
00624     }
00625     cout << endl ;
00626 
00627     diff_cf = diff_confo(1) ;
00628     for (int l=2; l<nz; l++) {
00629         diff_cf += diff_confo(l) ;
00630     }
00631     diff_cf /= nz ;
00632 
00633     // Shift vector
00634     // ------------
00635     Tbl diff_shift_x(nz) ;
00636     Tbl diff_shift_y(nz) ;
00637     Tbl diff_shift_z(nz) ;
00638 
00639     if (kerrschild) {
00640 
00641         diff_shift_x = diffrel(shift_rs(1), shift_jm1(1)) ;
00642 
00643     }
00644     else { // Isotropic coordinates with the maximal slicing
00645 
00646         diff_shift_x = diffrel(shift(1), shift_jm1(1)) ;
00647 
00648     }
00649 
00650     cout << "Relative difference in the shift vector (x) : " << endl ;
00651     for (int l=0; l<nz; l++) {
00652         cout << diff_shift_x(l) << "  " ;
00653     }
00654     cout << endl ;
00655 
00656     diff_sx = diff_shift_x(1) ;
00657     for (int l=2; l<nz; l++) {
00658         diff_sx += diff_shift_x(l) ;
00659     }
00660     diff_sx /= nz ;
00661 
00662     if (kerrschild) {
00663 
00664         diff_shift_y = diffrel(shift_rs(2), shift_jm1(2)) ;
00665 
00666     }
00667     else { // Isotropic coordinates with the maximal slicing
00668 
00669         diff_shift_y = diffrel(shift(2), shift_jm1(2)) ;
00670 
00671     }
00672 
00673     cout << "Relative difference in the shift vector (y) : " << endl ;
00674     for (int l=0; l<nz; l++) {
00675         cout << diff_shift_y(l) << "  " ;
00676     }
00677     cout << endl ;
00678 
00679     diff_sy = diff_shift_y(1) ;
00680     for (int l=2; l<nz; l++) {
00681         diff_sy += diff_shift_y(l) ;
00682     }
00683     diff_sy /= nz ;
00684 
00685     if (kerrschild) {
00686 
00687         diff_shift_z = diffrel(shift_rs(3), shift_jm1(3)) ;
00688 
00689     }
00690     else { // Isotropic coordinates with the maximal slicing
00691 
00692         diff_shift_z = diffrel(shift(3), shift_jm1(3)) ;
00693 
00694     }
00695 
00696     cout << "Relative difference in the shift vector (z) : " << endl ;
00697     for (int l=0; l<nz; l++) {
00698         cout << diff_shift_z(l) << "  " ;
00699     }
00700     cout << endl ;
00701 
00702     diff_sz = diff_shift_z(1) ;
00703     for (int l=2; l<nz; l++) {
00704         diff_sz += diff_shift_z(l) ;
00705     }
00706     diff_sz /= nz ;
00707 
00708     // Mass
00709     if (kerrschild) {
00710 
00711         cout << "Mass_bh : " << mass_bh / msol << " [M_sol]" << endl ;
00712         double rad_apphor = rad_ah() ;
00713         cout << "        : " <<  0.5 * rad_apphor / ggrav / msol
00714          << " [M_sol]" << endl ;
00715 
00716     }
00717     else {  // Isotropic coordinates with the maximal slicing
00718 
00719         cout << "Mass_bh :                " << mass_bh / msol
00720          << " [M_sol]" << endl ;
00721 
00722     }
00723 
00724     // ADM mass, Komar mass
00725     // --------------------
00726 
00727     double irr_gm, adm_gm, kom_gm ;
00728     irr_gm = mass_irr() / mass_bh - 1. ;
00729     adm_gm = mass_adm() / mass_bh - 1. ;
00730     kom_gm = mass_kom() / mass_bh - 1. ;
00731     cout << "Irreducible mass :       " << mass_irr() / msol << endl ;
00732     cout << "Gravitaitonal mass :     " << mass_bh / msol << endl ;
00733     cout << "ADM mass :               " << mass_adm() / msol << endl ;
00734     cout << "Komar mass :             " << mass_kom() / msol << endl ;
00735     cout << "Diff. (Madm-Mirr)/Mirr : " << mass_adm()/mass_irr() - 1.
00736          << endl ;
00737     cout << "Diff. (Mkom-Mirr)/Mirr : " << mass_kom()/mass_irr() - 1.
00738          << endl ;
00739     cout << "Diff. (Madm-Mkom)/Madm : " << 1. - mass_kom()/mass_adm()
00740          << endl ;
00741     cout << "Diff. (Mirr-Mg)/Mg :     " << irr_gm << endl ;
00742     cout << "Diff. (Madm-Mg)/Mg :     " << adm_gm << endl ;
00743     cout << "Diff. (Mkom-Mg)/Mg :     " << kom_gm << endl ;
00744 
00745     cout << endl ;
00746 
00747     del_deriv() ;
00748 
00749     // Relaxation
00750     /*
00751     lapse = 0.75 * lapse + 0.25 * lapse_jm1 ;
00752     confo = 0.75 * confo + 0.25 * confo_jm1 ;
00753     shift = 0.75 * shift + 0.25 * shift_jm1 ;
00754     */
00755     /*
00756     des_profile( lapse, 0., 20, M_PI/2., 0.,
00757              "Lapse function of BH",
00758              "Lapse (theta=pi/2, phi=0)" ) ;
00759 
00760     des_profile( confo, 0., 20, M_PI/2., 0.,
00761              "Conformal factor of BH",
00762              "Confo (theta=pi/2, phi=0)" ) ;
00763 
00764     des_profile( shift(1), 0., 20, M_PI/2., 0.,
00765              "Shift vector (X) of BH",
00766              "Shift (theta=pi/2, phi=0)" ) ;
00767     */
00768 
00769     }  // End of iteration loop
00770 
00771     //====================================//
00772     //          End of iteration          //
00773     //====================================//
00774 
00775     // Exact solution
00776     // --------------
00777     Scalar lapconf_exact(mp) ;
00778     Scalar confo_exact(mp) ;
00779     Vector shift_exact(mp, CON, mp.get_bvect_cart()) ;
00780 
00781     if (kerrschild) {
00782 
00783         lapconf_exact = 1./sqrt(1.+2.*mass/rr) ;
00784 
00785         confo_exact = 1. ;
00786 
00787         for (int i=1; i<=3; i++)
00788         shift_exact.set(i) =
00789           2.*mass*lapconf_exact%lapconf_exact%ll(i)/rr ;
00790 
00791     }
00792     else {
00793 
00794         Scalar rare(mp) ;
00795     rare = r_coord(neumann, first) ;
00796     rare.std_spectral_base() ;
00797 
00798         lapconf_exact = sqrt(1. - 2.*mass/rare/rr
00799                + cc*cc*pow(mass/rare/rr,4.)) * sqrt(rare) ;
00800 
00801     confo_exact = sqrt(rare) ;
00802 
00803     for (int i=1; i<=3; i++) {
00804         shift_exact.set(i) = mass * mass * cc * ll(i) / rr / rr
00805           / pow(rare,3.) ;
00806     }
00807 
00808     }
00809 
00810     lapconf_exact.annule_domain(0) ;
00811     lapconf_exact.std_spectral_base() ;
00812     lapconf_exact.raccord(1) ;
00813 
00814     confo_exact.annule_domain(0) ;
00815     confo_exact.std_spectral_base() ;
00816     confo_exact.raccord(1) ;
00817 
00818     shift_exact.annule_domain(0) ;
00819     shift_exact.std_spectral_base() ;
00820     for (int i=1; i<=3; i++)
00821       shift_exact.set(i).raccord(1) ;
00822 
00823     Scalar lapconf_resi = lapconf - lapconf_exact ;
00824     Scalar confo_resi = confo - confo_exact ;
00825     Vector shift_resi = shift - shift_exact ;
00826     /*
00827     des_profile( lapse, 0., 20, M_PI/2., 0.,
00828          "Lapse function",
00829          "Lapse (theta=pi/2, phi=0)" ) ;
00830 
00831     des_profile( lapse_exact, 0., 20, M_PI/2., 0.,
00832          "Exact lapse function",
00833          "Exact lapse (theta=pi/2, phi=0)" ) ;
00834 
00835     des_profile( lapse_resi, 0., 20, M_PI/2., 0.,
00836          "Residual of the lapse function",
00837          "Delta Lapse (theta=pi/2, phi=0)" ) ;
00838 
00839     des_profile( confo, 0., 20, M_PI/2., 0.,
00840          "Conformal factor",
00841          "Confo (theta=pi/2, phi=0)" ) ;
00842 
00843     des_profile( confo_exact, 0., 20, M_PI/2., 0.,
00844          "Exact conformal factor",
00845          "Exact confo (theta=pi/2, phi=0)" ) ;
00846 
00847     des_profile( confo_resi, 0., 20, M_PI/2., 0.,
00848          "Residual of the conformal factor",
00849          "Delta Confo (theta=pi/2, phi=0)" ) ;
00850 
00851     des_profile( shift(1), 0., 20, M_PI/2., 0.,
00852          "Shift vector (X)",
00853          "Shift (X) (theta=pi/2, phi=0)" ) ;
00854 
00855     des_profile( shift_exact(1), 0., 20, M_PI/2., 0.,
00856          "Exact shift vector (X)",
00857          "Exact shift (X) (theta=pi/2, phi=0)" ) ;
00858 
00859     des_profile( shift_resi(1), 0., 20, M_PI/2., 0.,
00860          "Residual of the shift vector X",
00861          "Delta shift (X) (theta=pi/2, phi=0)" ) ;
00862     */
00863     /*
00864     des_coupe_vect_z( shift_resi, 0., -3., 0.5, 4,
00865               "Delta Shift vector of BH") ;
00866     */
00867 
00868     // Relative difference in the lapconf function
00869     Tbl diff_lapconf_exact = diffrel(lapconf, lapconf_exact) ;
00870     diff_lapconf_exact.set(0) = 0. ;
00871     cout << "Relative difference in the lapconf function   : " << endl ;
00872     for (int l=0; l<nz; l++) {
00873         cout << diff_lapconf_exact(l) << "  " ;
00874     }
00875     cout << endl ;
00876 
00877     // Relative difference in the conformal factor
00878     Tbl diff_confo_exact = diffrel(confo, confo_exact) ;
00879     diff_confo_exact.set(0) = 0. ;
00880     cout << "Relative difference in the conformal factor : " << endl ;
00881     for (int l=0; l<nz; l++) {
00882         cout << diff_confo_exact(l) << "  " ;
00883     }
00884     cout << endl ;
00885 
00886     // Relative difference in the shift vector
00887     Tbl diff_shift_exact_x = diffrel(shift(1), shift_exact(1)) ;
00888     Tbl diff_shift_exact_y = diffrel(shift(2), shift_exact(2)) ;
00889     Tbl diff_shift_exact_z = diffrel(shift(3), shift_exact(3)) ;
00890 
00891     cout << "Relative difference in the shift vector (x) : " << endl ;
00892     for (int l=0; l<nz; l++) {
00893         cout << diff_shift_exact_x(l) << "  " ;
00894     }
00895     cout << endl ;
00896     cout << "Relative difference in the shift vector (y) : " << endl ;
00897     for (int l=0; l<nz; l++) {
00898         cout << diff_shift_exact_y(l) << "  " ;
00899     }
00900     cout << endl ;
00901     cout << "Relative difference in the shift vector (z) : " << endl ;
00902     for (int l=0; l<nz; l++) {
00903         cout << diff_shift_exact_z(l) << "  " ;
00904     }
00905     cout << endl ;
00906 
00907     //---------------------------------//
00908     //          Info printing          //
00909     //---------------------------------//
00910 
00911 
00912 }

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