blackhole_static.C

00001 /*
00002  *  Method of class Black_hole to set metric quantities to a spherical,
00003  *   static, analytic  solution
00004  *
00005  *    (see file blackhole.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 blackhole_static_C[] = "$Header: /cvsroot/Lorene/C++/Source/Black_hole/blackhole_static.C,v 1.2 2008/05/15 19:31:17 k_taniguchi Exp $" ;
00030 
00031 /*
00032  * $Id: blackhole_static.C,v 1.2 2008/05/15 19:31:17 k_taniguchi Exp $
00033  * $Log: blackhole_static.C,v $
00034  * Revision 1.2  2008/05/15 19:31:17  k_taniguchi
00035  * Change of some parameters.
00036  *
00037  * Revision 1.1  2007/06/22 01:20:50  k_taniguchi
00038  * *** empty log message ***
00039  *
00040  *
00041  * $Header: /cvsroot/Lorene/C++/Source/Black_hole/blackhole_static.C,v 1.2 2008/05/15 19:31:17 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 "unites.h"
00054 #include "utilitaires.h"
00055 
00056 void Black_hole::static_bh(bool neumann, bool first) {
00057 
00058     // Fundamental constants and units
00059     // -------------------------------
00060     using namespace Unites ;
00061 
00062     double mass = ggrav * mass_bh ;
00063 
00064     Scalar rr(mp) ;
00065     rr = mp.r ;
00066     rr.std_spectral_base() ;
00067 
00068     //-------------------------------------//
00069     //          Metric quantities          //
00070     //-------------------------------------//
00071 
00072     Scalar st(mp) ;
00073     st = mp.sint ;
00074     st.std_spectral_base() ;
00075     Scalar ct(mp) ;
00076     ct = mp.cost ;
00077     ct.std_spectral_base() ;
00078     Scalar sp(mp) ;
00079     sp = mp.sinp ;
00080     sp.std_spectral_base() ;
00081     Scalar cp(mp) ;
00082     cp = mp.cosp ;
00083     cp.std_spectral_base() ;
00084 
00085     Vector ll(mp, CON, mp.get_bvect_cart()) ;
00086     ll.set_etat_qcq() ;
00087     ll.set(1) = st * cp ;
00088     ll.set(2) = st * sp ;
00089     ll.set(3) = ct ;
00090     ll.std_spectral_base() ;
00091 
00092     if (kerrschild) {
00093 
00094         // Lapconf function
00095         // ----------------
00096         lapconf = 1./sqrt(1.+2.*mass/rr) ;
00097     lapconf.annule_domain(0) ;
00098     lapconf.std_spectral_base() ;
00099     lapconf.raccord(1) ;
00100 
00101     // Conformal factor
00102     // ----------------
00103     confo = 1. ;
00104     confo.std_spectral_base() ;
00105 
00106     // Shift vector
00107     // ------------
00108     for (int i=1; i<=3; i++)
00109             shift.set(i) = 2. * mass * lapconf % lapconf % ll(i) / rr ;
00110 
00111     shift.annule_domain(0) ;
00112     shift.std_spectral_base() ;
00113 
00114     }
00115     else {  // Isotropic coordinates with the maximal slicing
00116 
00117         // Sets C/M^2 for each case of the lapse boundary condition
00118         // --------------------------------------------------------
00119         double cc ;
00120 
00121     if (neumann) {  // Neumann boundary condition
00122         if (first) {  // First condition
00123           // d(\alpha \psi)/dr = 0
00124           // ---------------------
00125           cc = 2. * (sqrt(13.) - 1.) / 3. ;
00126         }
00127         else {  // Second condition
00128           // d(\alpha \psi)/dr = (\alpha \psi)/(2 rah)
00129           // -----------------------------------------
00130           cc = 4. / 3. ;
00131     }
00132     }
00133     else {  // Dirichlet boundary condition
00134         if (first) {  // First condition
00135           // (\alpha \psi) = 1/2
00136           // -------------------
00137           cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00138           abort() ;
00139         }
00140         else {  // Second condition
00141           // (\alpha \psi) = 1/sqrt(2.) \psi_KS
00142           // ----------------------------------
00143           cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
00144           abort() ;
00145         }
00146     }
00147 
00148         Scalar r_are(mp) ;
00149     r_are = r_coord(neumann, first) ;
00150     r_are.std_spectral_base() ;
00151 
00152         // Lapconf function
00153         // ----------------
00154     lapconf = sqrt(1. - 2.*mass/r_are/rr
00155                + cc*cc*pow(mass/r_are/rr,4.)) * sqrt(r_are) ;
00156 
00157     lapconf.std_spectral_base() ;
00158     lapconf.annule_domain(0) ;
00159     lapconf.raccord(1) ;
00160 
00161         // Conformal factor
00162     // ----------------
00163     confo = sqrt(r_are) ;
00164     confo.std_spectral_base() ;
00165     confo.annule_domain(0) ;
00166     confo.raccord(1) ;
00167 
00168     // Lapse function
00169     // --------------
00170     lapse = lapconf / confo ;
00171     lapse.std_spectral_base() ;
00172     lapse.annule_domain(0) ;
00173     lapse.raccord(1) ;
00174 
00175         // Shift vector
00176     // ------------
00177     for (int i=1; i<=3; i++) {
00178         shift.set(i) = mass * mass * cc * ll(i) / rr / rr
00179           / pow(r_are,3.) ;
00180     }
00181 
00182     shift.std_spectral_base() ;
00183 
00184     for (int i=1; i<=3; i++) {
00185         shift.set(i).annule_domain(0) ;
00186         shift.set(i).raccord(1) ;
00187     }
00188 
00189     }
00190 
00191 }

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