Debian Codegraph @

C++/Include/blackhole.h

raw symbols SCIP
1 /*
2 * Definition of Lorene class Black_hole
3 *
4 */
5
6 /*
7 * Copyright (c) 2005-2007 Keisuke Taniguchi
8 *
9 * This file is part of LORENE.
10 *
11 * LORENE is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2
13 * as published by the Free Software Foundation.
14 *
15 * LORENE is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with LORENE; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26 #ifndef __BLACKHOLE_H_
27 #define __BLACKHOLE_H_
28
29 /*
30 * $Id: blackhole.h,v 1.4 2014/10/13 08:52:32 j_novak Exp $
31 * $Log: blackhole.h,v $
32 * Revision 1.4 2014/10/13 08:52:32 j_novak
33 * Lorene classes and functions now belong to the namespace Lorene.
34 *
35 * Revision 1.3 2008/07/02 20:41:40 k_taniguchi
36 * Addition of the routines to compute angular momentum
37 * and modification of the argument of equilibrium_spher.
38 *
39 * Revision 1.2 2008/05/15 18:53:37 k_taniguchi
40 * Change of some parameters and introduction of some
41 * computational routines.
42 *
43 * Revision 1.1 2007/06/22 01:02:57 k_taniguchi
44 * *** empty log message ***
45 *
46 *
47 * $Header: /cvsroot/Lorene/C++/Include/blackhole.h,v 1.4 2014/10/13 08:52:32 j_novak Exp $
48 *
49 */
50
51 // External classes which appear in the declaration of class Black_hole:
52 //class YYY ;
53
54 // Headers Lorene
55 #include "metric.h"
56
57 //-------------------------------//
58 // Base class Black_hole //
59 //-------------------------------//
60
61 namespace Lorene {
62 /**
63 * Base class for black holes.
64 * \ingroup(star)
65 *
66 * According to the 3+1 formalism, the spacetime metric is written
67 * \f[
68 * ds^2 = - \alpha^2 dt^2 + \gamma_{ij} ( dx^i + \beta^i dt )
69 * ( dx^j + \beta^j dt )
70 * \f]
71 * where \f$\gamma_{ij}\f$ is the spatial metric.
72 *
73 */
74 class Black_hole {
75
76 // Data :
77 // -----
78 protected:
79 /// Mapping associated with the black hole
80 Map& mp ;
81
82 /** \c true for a Kerr-Schild background, \c false for
83 * a conformally flat background
84 */
85 bool kerrschild ;
86
87 /// Gravitational mass of BH
88 double mass_bh ;
89
90 // Metric quantities
91 // -----------------
92
93 /**
94 * A function (lapse function * conformal factor) lapconf
95 * generated by the black hole
96 */
97 Scalar lapconf ; // lapconf = lapconf_rs + lapconf_bh
98
99 /// Part of lapconf from the numerical computation
100 Scalar lapconf_rs ;
101
102 /// Part of lapconf from the analytic background
103 Scalar lapconf_bh ;
104
105 /// Lapse function generated by the black hole
106 Scalar lapse ;
107
108 /// Shift vector generated by the black hole
109 Vector shift ; // shift = shift_rs + shift_bh
110
111 /// Part of the shift vector from the numerical computation
112 Vector shift_rs ;
113
114 /// Part of the shift vector from the analytic background
115 Vector shift_bh ;
116
117 /// Conformal factor generated by the black hole
118 Scalar confo ;
119
120 /// Trace of the extrinsic curvature
121 // Scalar trace_k ;
122
123 /** Extrinsic curvature tensor \f$\ A^{ij}\f$
124 * generated by \c shift , \c lapse , and
125 * \c confo .
126 */
127 Sym_tensor taij ;
128
129 /// Part of the extrinsic curvature tensor
130 Sym_tensor taij_rs ;
131
132 /** Part of the scalar \f$\eta_{ik} \eta_{jl} A^{ij} A^{kl}\f$
133 * generated by \f$A_{ij}\f$
134 */
135 Scalar taij_quad ;
136
137 /// Part of the scalar
138 Scalar taij_quad_rs ;
139
140 /** Flat metric defined on the mapping (Spherical components
141 * with respect to the mapping of the black hole ).
142 */
143 Metric_flat flat ;
144
145 /// Conformal metric \f$\tilde \gamma_{ij}\f$
146 // Metric tgij ;
147
148 // Derived data :
149 // ------------
150 protected:
151 mutable double* p_mass_irr ; /// Irreducible mass of the black hole
152
153 mutable double* p_mass_adm ; /// ADM mass
154
155 mutable double* p_mass_kom ; /// Komar mass
156
157 mutable double* p_rad_ah ; /// Radius of the apparent horizon
158
159 mutable double* p_spin_am_bh ; /// Spin angular momentum
160
161 /// Total angular momentum of the black hole
162 mutable Tbl* p_angu_mom_bh ;
163
164 // Constructors - Destructor
165 // -------------------------
166 public:
167
168 /** Standard constructor.
169 *
170 * @param mp_i Mapping on which the black hole will be defined
171 */
172 Black_hole(Map& mp_i, bool Kerr_schild, double massbh) ;
173
174 Black_hole(const Black_hole& ) ; ///< Copy constructor
175
176 /** Constructor from a file (see \c sauve(FILE*) )
177 *
178 * @param mp_i Mapping on which the black hole will be defined
179 * @param fich input file (must have been created by the function
180 * \c sauve )
181 */
182 Black_hole(Map& mp_i, FILE* fich) ;
183
184 virtual ~Black_hole() ; ///< Destructor
185
186
187 // Memory management
188 // -----------------
189 protected:
190 /// Deletes all the derived quantities
191 virtual void del_deriv() const ;
192
193 /// Sets to \c 0x0 all the pointers on derived quantities
194 void set_der_0x0() const ;
195
196
197 // Mutators / assignment
198 // ---------------------
199 public:
200 /// Assignment to another \c Black_hole
201 void operator=(const Black_hole&) ;
202
203 /// Read/write of the mapping
204 Map& set_mp() {return mp; } ;
205
206 /// Read/write of the gravitational mass of BH [{\tt m\_unit}]
207 double& set_mass_bh() {return mass_bh; } ;
208
209 // Accessors
210 // ---------
211 public:
212 /// Returns the mapping
213 const Map& get_mp() const {return mp; } ;
214
215 /** Returns \c true for a Kerr-Schild background, \c false for
216 * a Conformally flat one
217 */
218 bool is_kerrschild() const {return kerrschild; } ;
219
220 /// Returns the gravitational mass of BH [{\tt m\_unit}]
221 double get_mass_bh() const {return mass_bh; } ;
222
223 /// Returns lapconf generated by the black hole
224 const Scalar& get_lapconf() const {return lapconf; } ;
225
226 /// Returns the part of lapconf from the numerical computation
227 const Scalar& get_lapconf_rs() const {return lapconf_rs; } ;
228
229 /// Returns the lapse function generated by the black hole
230 const Scalar& get_lapse() const {return lapse; } ;
231
232 /// Returns the shift vector generated by the black hole
233 const Vector& get_shift() const {return shift; } ;
234
235 /** Returns the part of the shift vector from
236 * the numerical computation
237 */
238 const Vector& get_shift_rs() const {return shift_rs; } ;
239
240 /// Returns the conformal factor generated by the black hole
241 const Scalar& get_confo() const {return confo; } ;
242
243 // Outputs
244 // -------
245 public:
246 virtual void sauve(FILE *) const ; ///< Save in a file
247
248 /// Display
249 friend ostream& operator<<(ostream& , const Black_hole& ) ;
250
251 protected:
252 /// Operator >> (virtual function called by the operator <<)
253 virtual ostream& operator>>(ostream& ) const ;
254
255 // Global quantities
256 // -----------------
257 public:
258 /// Irreducible mass of the black hole
259 virtual double mass_irr() const ;
260
261 /// ADM mass
262 virtual double mass_adm() const ;
263
264 /// Komar mass
265 virtual double mass_kom() const ;
266
267 /// Radius of the apparent horizon
268 virtual double rad_ah() const ;
269
270 /// Spin angular momentum
271 double spin_am_bh(bool bclapconf_nd, bool bclapconf_fs,
272 const Tbl& xi_i, const double& phi_i,
273 const double& theta_i, const int& nrk_phi,
274 const int& nrk_theta) const ;
275
276 /** Total angular momentum.
277 *
278 * @return 1-D {\tt Tbl} of size 3, according to \\
279 * {\tt angu\_mom()(0)} = $J^x$, \\
280 * {\tt angu\_mom()(1)} = $J^y$, \\
281 * {\tt angu\_mom()(2)} = $J^z$.
282 */
283 const Tbl& angu_mom_bh() const ;
284
285 // Computational routines
286 // ----------------------
287 public:
288 /** Boundary condition on the apparent horizon of the black hole
289 * for the lapse function: 2-D \c Valeur
290 */
291 const Valeur bc_lapconf(bool neumann, bool first) const ;
292
293 /** Boundary condition on the apparent horizon of the black hole
294 * for the shift vector of the \fx\f direction: 2-D \c Valeur
295 */
296 const Valeur bc_shift_x(double omega_r) const ;
297
298 /** Boundary condition on the apparent horizon of the black hole
299 * for the shift vector of the \fy\f direction: 2-D \c Valeur
300 */
301 const Valeur bc_shift_y(double omega_r) const ;
302
303 /** Boundary condition on the apparent horizon of the black hole
304 * for the shift vector of the \fz\f direction: 2-D \c Valeur
305 */
306 const Valeur bc_shift_z() const ;
307
308 /** Boundary condition on the apparent horizon of the black hole
309 * for the conformal factor: 2-D \c Valeur
310 */
311 const Valeur bc_confo() const ;
312
313 /** Computes \c taij , \c taij_quad from \c shift , \c lapse ,
314 * \c confo .
315 */
316 void extr_curv_bh() ;
317
318 /** Computes a spherical, static black-hole by giving boundary
319 * conditions on the apparent horizon.
320 *
321 * @param neumann [input] \c true for the neumann bc, \c false for
322 * the dirichlet one for the lapse
323 * @param first [input] \c true for the first type of bc,
324 * \c false for the second type
325 * @param spin_omega [input] spin parameter of the black hole
326 * @param precis [input] threshold in the relative difference of
327 * a metric quantity between two succesive steps
328 * to stop the iterative procedure
329 * (default value: 1.e-14)
330 * @param precis_shift [input] threshold in the relative difference
331 * of the shift vector between two succesive steps
332 * to stop the iterative procedure
333 * (default value: 1.e-8)
334 */
335 void equilibrium_spher(bool neumann, bool first, double spin_omega,
336 double precis = 1.e-14,
337 double precis_shift = 1.e-8) ;
338
339 /** Sets the metric quantities to a spherical, static blach-hole
340 * analytic solution
341 *
342 * @param neumann [input] \c true for the neumann bc, \c false for
343 * the dirichlet one for the lapse
344 * @param first [input] \c true for the first type of bc,
345 * \c false for the second type
346 */
347 void static_bh(bool neumann, bool first) ;
348
349 /** Computes a radius of apparent horizon (excised surface)
350 * in isotropic coordinates
351 *
352 * @param neumann [input] \c true for the neumann bc, \c false for
353 * the dirichlet one for the lapse
354 * @param first [input] \c true for the first type of bc,
355 * \c false for the second type
356 */
357 double rah_iso(bool neumann, bool first) const ;
358
359 /** Expresses the areal radial coordinate
360 * by that in spatially isotropic coordinates
361 *
362 * @param neumann [input] \c true for the neumann bc, \c false for
363 * the dirichlet one for the lapse
364 * @param first [input] \c true for the first type of bc,
365 * \c false for the second type
366 */
367 const Scalar r_coord(bool neumann, bool first) const ;
368
369 /** Compute a forth-order Runge-Kutta integration to the phi
370 * direction for the solution of the Killing vectors on the
371 * equator
372 *
373 * @param xi_i [input] initial set of the Killing vectors
374 * at the starting point on the equator
375 * @param phi_i [input] initial phi coordinate at which the
376 * integration starts
377 * @param nrk [input] number of the Runge-Kutta integration
378 * between two successive collocation points
379 */
380 Tbl runge_kutta_phi_bh(const Tbl& xi_i, const double& phi_i,
381 const int& nrk) const ;
382
383 /** Compute a forth-order Runge-Kutta integration to the theta
384 * direction for the solution of the Killing vectors
385 *
386 * @param xi_i [input] initial set of the Killing vectors
387 * at the starting point on the equator
388 * @param theta_i [input] initial theta coordinate at which the
389 * integration starts
390 * @param phi [input] fixed phi coordinate during integration to
391 * the theta direction
392 * @param nrk [input] number of the Runge-Kutta integration
393 * between two successive collocation points
394 */
395
396 Tbl runge_kutta_theta_bh(const Tbl& xi_i, const double& theta_i,
397 const double& phi, const int& nrk) const ;
398
399 /** Compute the Killing vector of a black hole normalized so that
400 * its affine length is 2 M_PI
401 *
402 * @param xi_i [input] initial set of the Killing vectors
403 * at the starting point on the equator
404 * @param phi_i [input] initial phi coordinate at which the
405 * integration starts
406 * @param theta_i [input] initial theta coordinate at which the
407 * integration starts
408 * @param nrk_phi [input] number of the Runge-Kutta integration
409 * between two successive collocation points
410 * for the phi direction
411 * @param nrk_theta [input] number of the Runge-Kutta integration
412 * between two successive collocation points
413 * for the theta direction
414 */
415 Vector killing_vect_bh(const Tbl& xi_i, const double& phi_i,
416 const double& theta_i, const int& nrk_phi,
417 const int& nrk_theta) const ;
418
419 };
420 ostream& operator<<(ostream& , const Black_hole& ) ;
421
422 }
423 #endif