blackhole_rah_iso.C

00001 /*
00002  *  Methods of class Black_hole to compute the radius of the apparent
00003  *  horizon in isotropic coordinates
00004  *
00005  *    (see file blackhole.h for documentation).
00006  *
00007  */
00008 
00009 /*
00010  *   Copyright (c) 2006-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 blackhole_rah_iso_C[] = "$Header: /cvsroot/Lorene/C++/Source/Black_hole/blackhole_rah_iso.C,v 1.2 2008/05/15 19:30:35 k_taniguchi Exp $" ;
00030 
00031 /*
00032  * $Id: blackhole_rah_iso.C,v 1.2 2008/05/15 19:30:35 k_taniguchi Exp $
00033  * $Log: blackhole_rah_iso.C,v $
00034  * Revision 1.2  2008/05/15 19:30:35  k_taniguchi
00035  * Change of some parameters.
00036  *
00037  * Revision 1.1  2007/06/22 01:20:13  k_taniguchi
00038  * *** empty log message ***
00039  *
00040  *
00041  * $Header: /cvsroot/Lorene/C++/Source/Black_hole/blackhole_rah_iso.C,v 1.2 2008/05/15 19:30:35 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 "blackhole.h"
00053 #include "utilitaires.h"
00054 
00055 // Local function
00056 double ff(double, const double) ;
00057 
00058           //----------------------------------------------------------//
00059           //     Radius of the apparent horizon (excised surface)     //
00060           //----------------------------------------------------------//
00061 
00062 double Black_hole::rah_iso(bool neumann, bool first) const {
00063 
00064     // Sets C/M^2 for each case of the lapse boundary condition
00065     // --------------------------------------------------------
00066     double cc ;
00067 
00068     if (neumann) {  // Neumann boundary condition
00069         if (first) {  // First condition
00070       // d(\alpha \psi)/dr = 0
00071       // ---------------------
00072       cc = 2. * (sqrt(13.) - 1.) / 3. ;
00073     }
00074     else {  // Second condition
00075       // d(\alpha \psi)/dr = (\alpha \psi)/(2 rah)
00076       // -----------------------------------------
00077       cc = 4. / 3. ;
00078     }
00079     }
00080     else {  // Dirichlet boundary condition
00081        if (first) {  // First condition
00082      // (\alpha \psi) = 1/2
00083      // -------------------
00084      cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00085      abort() ;
00086        }
00087        else {  // Second condition
00088      // (\alpha \psi) = 1/sqrt(2.) \psi_KS
00089      // ----------------------------------
00090      cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00091      abort() ;
00092        }
00093     }
00094 
00095     int nn = 1000 ;
00096     double hh = 1./double(nn) ;
00097     double integ = 0. ;
00098     double rah ;  // rah [M]
00099 
00100     int mm ;
00101     double x1, x2, x3, x4, x5 ;
00102 
00103     // Boole's Rule (Newton-Cotes Integral) for integration
00104     // ----------------------------------------------------
00105 
00106     assert(nn%4 == 0) ;
00107     mm = nn/4 ;
00108 
00109     for (int i=0; i<mm; i++) {
00110 
00111         x1 = hh * double(4*i) ;
00112     x2 = hh * double(4*i+1) ;
00113     x3 = hh * double(4*i+2) ;
00114     x4 = hh * double(4*i+3) ;
00115     x5 = hh * double(4*i+4) ;
00116 
00117     integ += (hh/45.) * (14.*ff(x1,cc) + 64.*ff(x2,cc)
00118                  + 24.*ff(x3,cc) + 64.*ff(x4,cc)
00119                  + 14.*ff(x5,cc)) ;
00120 
00121     }
00122 
00123     rah = 2. * exp(integ) ;  // rah : normalized by M
00124 
00125     return rah ;
00126 
00127 }
00128 
00129 //*****************************************************************
00130 
00131 double ff(double xx, const double cc) {
00132 
00133     double tcc2 = cc*cc/16. ;
00134     double tmp = sqrt(1. - xx + tcc2*pow(xx, 4.)) ;
00135 
00136     double resu = (-1. + tcc2 * pow(xx, 3.)) / tmp / (1. + tmp) ;
00137 
00138     return resu ;
00139 
00140 }

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