LORENE
blackhole_rah_iso.C
1 /*
2  * Methods of class Black_hole to compute the radius of the apparent
3  * horizon in isotropic coordinates
4  *
5  * (see file blackhole.h for documentation).
6  *
7  */
8 
9 /*
10  * Copyright (c) 2006-2007 Keisuke Taniguchi
11  *
12  * This file is part of LORENE.
13  *
14  * LORENE is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License version 2
16  * as published by the Free Software Foundation.
17  *
18  * LORENE is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with LORENE; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  *
27  */
28 
29 
30 
31 /*
32  * $Id: blackhole_rah_iso.C,v 1.5 2016/12/05 16:17:48 j_novak Exp $
33  * $Log: blackhole_rah_iso.C,v $
34  * Revision 1.5 2016/12/05 16:17:48 j_novak
35  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
36  *
37  * Revision 1.4 2014/10/13 08:52:46 j_novak
38  * Lorene classes and functions now belong to the namespace Lorene.
39  *
40  * Revision 1.3 2014/10/06 15:13:02 j_novak
41  * Modified #include directives to use c++ syntax.
42  *
43  * Revision 1.2 2008/05/15 19:30:35 k_taniguchi
44  * Change of some parameters.
45  *
46  * Revision 1.1 2007/06/22 01:20:13 k_taniguchi
47  * *** empty log message ***
48  *
49  *
50  * $Header: /cvsroot/Lorene/C++/Source/Black_hole/blackhole_rah_iso.C,v 1.5 2016/12/05 16:17:48 j_novak Exp $
51  *
52  */
53 
54 // C++ headers
55 //#include <>
56 
57 // C headers
58 #include <cmath>
59 
60 // Lorene headers
61 #include "blackhole.h"
62 #include "utilitaires.h"
63 
64 // Local function
65 namespace Lorene {
66 double ff(double, const double) ;
67 
68  //----------------------------------------------------------//
69  // Radius of the apparent horizon (excised surface) //
70  //----------------------------------------------------------//
71 
72 double Black_hole::rah_iso(bool neumann, bool first) const {
73 
74  // Sets C/M^2 for each case of the lapse boundary condition
75  // --------------------------------------------------------
76  double cc ;
77 
78  if (neumann) { // Neumann boundary condition
79  if (first) { // First condition
80  // d(\alpha \psi)/dr = 0
81  // ---------------------
82  cc = 2. * (sqrt(13.) - 1.) / 3. ;
83  }
84  else { // Second condition
85  // d(\alpha \psi)/dr = (\alpha \psi)/(2 rah)
86  // -----------------------------------------
87  cc = 4. / 3. ;
88  }
89  }
90  else { // Dirichlet boundary condition
91  if (first) { // First condition
92  // (\alpha \psi) = 1/2
93  // -------------------
94  cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
95  abort() ;
96  }
97  else { // Second condition
98  // (\alpha \psi) = 1/sqrt(2.) \psi_KS
99  // ----------------------------------
100  cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
101  abort() ;
102  }
103  }
104 
105  int nn = 1000 ;
106  double hh = 1./double(nn) ;
107  double integ = 0. ;
108  double rah ; // rah [M]
109 
110  int mm ;
111  double x1, x2, x3, x4, x5 ;
112 
113  // Boole's Rule (Newton-Cotes Integral) for integration
114  // ----------------------------------------------------
115 
116  assert(nn%4 == 0) ;
117  mm = nn/4 ;
118 
119  for (int i=0; i<mm; i++) {
120 
121  x1 = hh * double(4*i) ;
122  x2 = hh * double(4*i+1) ;
123  x3 = hh * double(4*i+2) ;
124  x4 = hh * double(4*i+3) ;
125  x5 = hh * double(4*i+4) ;
126 
127  integ += (hh/45.) * (14.*ff(x1,cc) + 64.*ff(x2,cc)
128  + 24.*ff(x3,cc) + 64.*ff(x4,cc)
129  + 14.*ff(x5,cc)) ;
130 
131  }
132 
133  rah = 2. * exp(integ) ; // rah : normalized by M
134 
135  return rah ;
136 
137 }
138 
139 //*****************************************************************
140 
141 double ff(double xx, const double cc) {
142 
143  double tcc2 = cc*cc/16. ;
144  double tmp = sqrt(1. - xx + tcc2*pow(xx, 4.)) ;
145 
146  double resu = (-1. + tcc2 * pow(xx, 3.)) / tmp / (1. + tmp) ;
147 
148  return resu ;
149 
150 }
151 }
Cmp exp(const Cmp &)
Exponential.
Definition: cmp_math.C:273
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
Lorene prototypes.
Definition: app_hor.h:67
double rah_iso(bool neumann, bool first) const
Computes a radius of apparent horizon (excised surface) in isotropic coordinates. ...
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351