Debian Codegraph @

Codes/Isol_hor/isolhor_KS.C

raw
1
2 /*
3 * Main code for Isolated Horizon in arbitrary gauge
4 *
5 */
6
7 /*
8 * Copyright (c) 2004-2005 Jose Luis Jaramillo
9 * Francois limousin
10 *
11 * This file is part of LORENE.
12 *
13 * LORENE is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2
15 * as published by the Free Software Foundation.
16 *
17 * LORENE is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with LORENE; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28 char isolhor_C[] = "$Header: /cvsroot/Lorene/Codes/Isol_hor/isolhor_KS.C,v 1.3 2014/10/13 08:53:56 j_novak Exp $" ;
29
30 /*
31 * $Id: isolhor_KS.C,v 1.3 2014/10/13 08:53:56 j_novak Exp $
32 * $Log: isolhor_KS.C,v $
33 * Revision 1.3 2014/10/13 08:53:56 j_novak
34 * Lorene classes and functions now belong to the namespace Lorene.
35 *
36 * Revision 1.2 2014/10/06 15:09:44 j_novak
37 * Modified #include directives to use c++ syntax.
38 *
39 * Revision 1.1 2005/10/21 16:21:42 jl_jaramillo
40 * First version
41 *
42 * Revision 1.30 2005/09/12 12:34:09 f_limousin
43 * Compilation Warning - Change of convention for the angular velocity
44 * Add Berlin boundary condition in the case of binary horizons.
45 *
46 * Revision 1.29 2005/06/09 08:09:10 f_limousin
47 * Implementation of the Kerr-Shild metric
48 *
49 * Revision 1.28 2005/04/08 12:14:42 f_limousin
50 * Dependance in phi.
51 *
52 * Revision 1.27 2005/04/08 09:30:53 jl_jaramillo
53 * Calculation of the expansion and its radial derivative
54 *
55 * Revision 1.26 2005/04/06 08:17:09 f_limousin
56 * Writing of global quantities in resformat.d
57 *
58 * Revision 1.25 2005/04/03 19:48:52 f_limousin
59 * Implementation of set_psi(psi_in).
60 *
61 * Revision 1.24 2005/04/02 15:52:05 f_limousin
62 * New data member nz. Lichnerowicz choice for aquad. Delete function
63 * compute_ww().
64 *
65 * Revision 1.23 2005/03/31 09:46:33 f_limousin
66 * New functions compute_ww(..) and aa_kerr_ww().
67 *
68 * Revision 1.22 2005/03/30 12:08:33 f_limousin
69 * Implementation of K^{ij} (Eq.(13) Of Sergio (2002)).
70 *
71 * Revision 1.21 2005/03/28 19:42:24 f_limousin
72 * Implement the metric and A^{ij}A_{ij} of Sergio for pertubations
73 * of Kerr black holes.
74 *
75 * Revision 1.20 2005/03/24 16:50:53 f_limousin
76 * Add parameters solve_shift and solve_psi in par_isol.d and in function
77 * init_dat(...). Implement Isolhor::kerr_perturb().
78 *
79 * Revision 1.19 2005/03/22 13:25:49 f_limousin
80 * Small changes. The angular velocity and A^{ij} are computed
81 * with a differnet sign.
82 *
83 * Revision 1.18 2005/03/15 19:28:11 f_limousin
84 * Implement initial data for Kerr black hole in isotropic coordinates.
85 *
86 * Revision 1.17 2005/03/09 10:33:31 f_limousin
87 * Delete functions init_data_b_neumann(...) and init_data_berlin(...)
88 * --> New parameter solve_lapse in the function init_data(...).
89 *
90 * Revision 1.16 2005/03/03 10:18:57 f_limousin
91 * Addition of the boost in x and z-direction.
92 * The grid and the mapping are now saved in the output file.
93 *
94 * Revision 1.15 2004/12/31 12:30:07 f_limousin
95 * Change the construction of an Isol_hor and the function sauve(FILE*, bool).
96 *
97 * Revision 1.14 2004/11/18 10:02:37 jl_jaramillo
98 * gamt and gamt_point well constructed as tensor in spaherical
99 * components
100 *
101 * Revision 1.13 2004/11/09 12:40:08 f_limousin
102 * Add some printing
103 *
104 * Revision 1.12 2004/11/05 17:53:26 f_limousin
105 * Perturbations of the conformal metric and its time derivative.
106 *
107 * Revision 1.8 2004/11/02 17:42:00 f_limousin
108 * New method sauve(...) to save in a binary file.
109 *
110 * Revision 1.6 2004/10/29 15:41:02 jl_jaramillo
111 * ADM angular momentum added
112 *
113 * Revision 1.5 2004/10/01 16:48:47 f_limousin
114 * *** empty log message ***
115 *
116 * Revision 1.4 2004/09/28 15:57:45 f_limousin
117 * Add the 2 lines $Id and $Log to see the comments
118 *
119 *
120 * Revision 1.1 2004/02/18 19:16:28 jl_jaramillo
121 * First version: c'est loin d'etre pret tout ca !!!
122 *
123 *
124 * $Header: /cvsroot/Lorene/Codes/Isol_hor/isolhor_KS.C,v 1.3 2014/10/13 08:53:56 j_novak Exp $
125 *
126 */
127
128 // C++ headers
129 #include "headcpp.h"
130
131 // C headers
132 #include <cstdlib>
133 #include <cmath>
134 #include <cstring>
135
136 // Lorene headers
137 #include "tenseur.h"
138 #include "metric.h"
139 #include "evolution.h"
140 #include "param.h"
141 #include "nbr_spx.h"
142 #include "utilitaires.h"
143 #include "graphique.h"
144 #include "time_slice.h"
145 #include "isol_hor.h"
146
147
148 using namespace Lorene ;
149
150 int main() {
151
152 //======================================================================
153 // Construction and initialization of the various objects
154 //======================================================================
155
156 // Setup of a multi-domain grid (Lorene class Mg3d)
157 // ------------------------------------------------
158
159 int nz, nt, np, nr1, nrp1 ;
160
161 ifstream fpar("par_hor.d") ;
162 fpar.ignore(1000, '\n') ;
163 fpar.ignore(1000, '\n') ;
164 fpar >> nz; fpar.ignore(1000, '\n');
165 fpar >> nt; fpar.ignore(1000, '\n');
166 fpar >> np; fpar.ignore(1000, '\n');
167 fpar >> nr1; fpar.ignore(1000, '\n');
168 fpar >> nrp1; fpar.ignore(1000, '\n');
169
170
171 int type_t = SYM ; // symmetry with respect to the equatorial plane
172 int type_p = NONSYM ; // no symmetry in phi
173
174 // Reading of the parameter file
175 // ------------------------------
176
177 int niter, bound_nn, bound_psi, bound_beta, solve_lapse, solve_psi ;
178 int solve_shift ;
179 double radius, relax, seuil, ang_vel, boost_x, boost_z, lim_nn ;
180 fpar >> radius; fpar.ignore(1000, '\n');
181 fpar >> relax; fpar.ignore(1000, '\n');
182 fpar >> seuil; fpar.ignore(1000, '\n');
183 fpar >> niter; fpar.ignore(1000, '\n');
184 fpar >> ang_vel; fpar.ignore(1000, '\n');
185 fpar >> boost_x ;
186 fpar >> boost_z; fpar.ignore(1000, '\n');
187 fpar >> bound_nn ;
188 fpar >> lim_nn ; fpar.ignore(1000, '\n');
189 fpar >> bound_psi ; fpar.ignore(1000, '\n');
190 fpar >> bound_beta ; fpar.ignore(1000, '\n');
191 fpar >> solve_lapse ; fpar.ignore(1000, '\n');
192 fpar >> solve_psi ; fpar.ignore(1000, '\n');
193 fpar >> solve_shift ; fpar.ignore(1000, '\n');
194
195
196 int* nr_tab = new int[nz];
197 int* nt_tab = new int[nz];
198 int* np_tab = new int[nz];
199 double* bornes = new double[nz+1];
200
201 for (int l=0; l<nz; l++) {
202 if (l==1) nr_tab[1] = nr1 ;
203 else nr_tab[l] = nrp1 ;
204 np_tab[l] = np ;
205 nt_tab[l] = nt ;
206 bornes[l] = pow(2., l-1) * radius ;
207 }
208 bornes[0] = 0. ;
209 bornes[nz] = __infinity ;
210
211 // Type of r sampling :
212 int* type_r = new int[nz];
213 type_r[0] = RARE ;
214 for (int l=1; l<nz-1; l++) {
215 type_r[l] = FIN ;
216 }
217 type_r[nz-1] = UNSURR ;
218
219 // Multi-domain grid construction:
220 Mg3d mgrid(nz, nr_tab, type_r, nt_tab, type_t, np_tab, type_p) ;
221
222 Map_af mp(mgrid, bornes) ; // Mapping construction
223
224 // Denomination of various coordinates associated with the mapping
225 // ---------------------------------------------------------------
226
227 const Coord& r = mp.r ; // r field
228 const Coord& theta = mp.tet ; // r field
229 const Coord& costt = mp.cost ; // cos(theta) field
230 const Coord& sintt = mp.sint ; // sin(theta) field
231 const Coord& cospp = mp.cosp ; // cos(phi) field
232 const Coord& sinpp = mp.sinp ; // sin(phi) field
233
234 Scalar rr(mp) ;
235 rr = r ;
236 rr.std_spectral_base() ;
237
238 Scalar cos2t (mp) ;
239 cos2t = cos(2.*theta) ;
240
241 Scalar cost (mp) ;
242 cost = costt ;
243
244 Scalar cosp (mp) ;
245 cosp = cospp ;
246
247 Scalar sint (mp) ;
248 sint = sintt ;
249
250 Scalar sinp (mp) ;
251 sinp = sinpp ;
252
253 // Flat metric f
254 // -------------
255
256 const Metric_flat& ff = mp.flat_met_spher() ;
257 const Base_vect_spher& otriad = mp.get_bvect_spher() ;
258
259 // Working stuff
260 // -------------
261
262 Scalar tmp_scal(mp) ;
263 Vector tmp_vect(mp, CON, otriad) ;
264 Sym_tensor tmp_sym(mp, CON, otriad) ;
265
266 // Key function
267 Scalar unsr(1./rr) ;
268 unsr.set_domain(0) = 1 ; // scalar set to 1 in the nucleus
269 unsr.std_spectral_base() ;
270
271 Scalar expmr (exp (- 1/((rr-1)*(rr-1)))) ;
272 expmr.std_spectral_base() ;
273
274 Scalar expmrr (exp(-pow(rr-3,2.))) ;
275 expmrr.std_spectral_base() ;
276
277
278 // =================================================================
279 // =================================================================
280
281 // Physical Parameters
282 //--------------------
283
284 // Set up of lapse function N
285 // --------------------------
286
287 Scalar nn_init(mp) ;
288 nn_init = 1. - 0.5*unsr ;
289 nn_init.std_spectral_base() ; // sets standard spectral bases
290
291 // Set up of field Psi
292 // -------------------
293
294 Scalar psi_init(mp) ;
295 psi_init = 1. + unsr ;
296 psi_init.std_spectral_base() ; // sets standard spectral bases
297
298 // Set up of shift vector beta
299 // ---------------------------
300
301 Vector beta_init(mp, CON, mp.get_bvect_spher()) ;
302 beta_init.set(1) = 0.001*unsr*unsr ;
303 beta_init.set(2) = 0. ;
304 beta_init.set(3) = 0. ;
305 beta_init.annule_domain(0) ;
306 beta_init.std_spectral_base() ;
307
308 // TrK, TrK_point
309 // --------------
310
311 Scalar trK (mp) ;
312 trK = 0. ;//0.01*unsr*unsr ;
313 trK.std_spectral_base() ;
314 trK.inc_dzpuis(2) ;
315
316 Scalar trK_point (mp) ;
317 trK_point = 0. ;
318 trK_point.std_spectral_base() ;
319 trK_point.inc_dzpuis(2) ;
320
321 // gamt, gamt_point
322 // ----------------
323
324 Scalar khi (mp) ;
325 khi = 0*0.05*unsr*unsr*sint*sint*sinp*cosp ;
326 khi.std_spectral_base() ;
327 khi.annule_domain(0) ;
328
329 Scalar mu (mp) ;
330 mu = 0*0.05*unsr*unsr ;
331 mu.std_spectral_base() ;
332 mu.annule_domain(0) ;
333
334 Sym_tensor_tt hh_tmp (mp, otriad, ff) ;
335 hh_tmp.set_khi_mu(khi, mu) ;
336
337
338 //Construction of a gamt
339 //----------------------
340
341 Sym_tensor gamt(mp, COV, mp.get_bvect_spher()) ;
342
343 gamt = ff.cov() + hh_tmp.up_down(ff) ;
344 /*
345 gamt.set(1,1) = gamt(1,1) * (1+0.3*sint*sint*cosp*cosp*
346 (1/rr/rr - 1/rr/rr/rr)) ;
347 gamt.set(2,2) = gamt(2,2) * (1+0.01*sint*sint*cosp*cosp*
348 (1/rr/rr - 1/rr/rr/rr)) ;
349 gamt.set(3,3) = gamt(3,3) * (1+0.01*sint*sint*cosp*cosp*
350 (1/rr/rr - 1/rr/rr/rr)) ;
351 gamt.set(1,3) = 0.1*sint*sint*cosp*(1/rr/rr - 1/rr/rr/rr) ;
352 gamt.set(1,3).set_spectral_va().set_base_t(T_COSSIN_SI) ;
353 */
354 gamt.std_spectral_base() ;
355
356 // Determinant of gamma tilde is put to one
357 // ----------------------------------------
358
359 Metric met_gamt_tmp (gamt) ;
360 Scalar det_ust = pow(met_gamt_tmp.determinant(), -1./3.) ;
361 det_ust.std_spectral_base() ;
362
363 gamt = gamt*det_ust ;
364 Metric met_gamt (gamt) ;
365 /*
366 gamt(1,1).spectral_display("gamt(1,1)") ;
367 gamt(2,2).spectral_display("gamt(2,2)") ;
368 gamt(3,3).spectral_display("gamt(3,3)") ;
369 gamt(1,2).spectral_display("gamt(1,2)") ;
370 gamt(1,3).spectral_display("gamt(1,3)") ;
371 gamt(2,3).spectral_display("gamt(2,3)") ;
372 */
373 // Gamma-tilde_point
374 //------------------
375
376 khi = 0. ;
377 khi.std_spectral_base() ;
378
379 mu = 0. ;
380 mu.std_spectral_base() ;
381
382 hh_tmp.set_khi_mu(khi, mu) ;
383
384 Sym_tensor gamt_point(mp, CON, mp.get_bvect_spher()) ;
385 gamt_point = hh_tmp ;
386 gamt_point.inc_dzpuis(2) ;
387
388
389 // =================================================================
390 // =================================================================
391
392
393 double mm, aaa, hh ;
394
395 //--------------------------------------------------
396 // Construction of Kerr-Shild Metric
397 //--------------------------------------------------
398
399 // Parameters
400 // -----------
401 mm = 2.5 ;
402 hh = 2. ; // the radius is 1
403 aaa = pow (mm*mm-hh*hh, 0.5) ;
404
405 mm = 0.55 ;
406 aaa = pow(2.*mm - 1., 0.5) ;
407
408
409 // Angular velocity
410 // ----------------
411
412 ang_vel = 1.*aaa / (2*mm*(mm+pow(mm*mm-aaa*aaa, 0.5))) ;
413 cout << "ang_vel = " << ang_vel << endl ;
414
415
416 Scalar facteur (mp) ;
417 facteur = 2.*mm*rr / (rr*rr + aaa*aaa*cost*cost) ;
418 facteur.set_domain(0) = 1. ;
419 facteur.set_outer_boundary(nz-1, 0.) ;
420 facteur.std_spectral_base() ;
421
422
423 // Lapse
424 // --------
425
426 Scalar lapse (mp) ;
427 lapse = pow(1.+facteur, -0.5) ;
428 lapse.std_spectral_base() ;
429 nn_init = lapse ;
430
431 // des_meridian(nn_init, 1.0000001, 10, "lapse", 0) ;
432
433 // Shift
434 // ------
435
436 Scalar beta_r (mp) ;
437 beta_r = facteur/(1.+facteur) ;
438 Vector beta_kerr (mp, CON, mp.get_bvect_spher()) ;
439 beta_kerr.set(1) = beta_r ;
440 beta_kerr.set(1).set_domain(0) = 0. ;
441 beta_kerr.set(2) = 0. ;
442 beta_kerr.set(3) = 0. ;
443
444 beta_kerr.std_spectral_base() ;
445 beta_init = beta_kerr ;
446
447 // des_meridian(beta_r, 1.0000001, 10, "beta_r", 1) ;
448
449 // Metric gamma
450 // --------------
451
452 Scalar grr = 1. + facteur ;
453 Scalar grp = -(1.+facteur)*aaa*sint/rr ;
454 Scalar gtt = 1. + aaa*aaa*cost*cost/rr/rr ;
455 Scalar gpp = 1. + aaa*aaa/rr/rr + 2.*mm*aaa*aaa*sint*sint/rr/
456 (rr*rr+aaa*aaa*cost*cost) ;
457 if (aaa != 0){
458 grp.set_domain(0) = 0. ;
459 gtt.set_domain(0) = 1. ;
460 gpp.set_domain(0) = 1. ;
461 }
462
463 Sym_tensor gamm (mp, COV, mp.get_bvect_spher()) ;
464 gamm.set(1,1) = grr ;
465 gamm.set(2,1) = 0. ;
466 gamm.set(3,1) = grp ;
467 gamm.set(2,2) = gtt ;
468 gamm.set(3,2) = 0. ;
469 gamm.set(3,3) = gpp ;
470 gamm.std_spectral_base() ;
471
472 Metric gamma (gamm) ;
473
474 Metric tgam (gamm) ;
475 gamt = tgam.cov() ;
476 met_gamt = gamt ;
477
478 // Determinant of gamma tilde is put to one
479 // ----------------------------------------
480
481 met_gamt_tmp = met_gamt ;
482 det_ust = pow(met_gamt_tmp.determinant(), -1./3.) ;
483 det_ust.std_spectral_base() ;
484
485 gamt = gamt*det_ust ;
486 met_gamt = gamt ;
487
488 // Conformal factor Psi
489 // ---------------------
490
491 Scalar psi_kerr (mp) ;
492 psi_kerr = pow(gamma.determinant(), 1./12.) ;
493 psi_kerr.set_domain(0) = 1. ;
494 psi_kerr.std_spectral_base() ;
495 psi_init = psi_kerr ;
496
497 // des_meridian(psi_kerr, 1.0000001, 10, "psi_kerr", 6) ;
498 // arrete() ;
499
500 Sym_tensor kk_init (mp, CON, mp.get_bvect_spher()) ;
501 for (int i=1; i<=3; i++)
502 for (int j=i; j<=3; j++)
503 kk_init.set(i,j) = 1./(2.*nn_init)*(beta_init.derive_con(gamma)(i,j) +
504 beta_init.derive_con(gamma)(j,i)) ;
505
506 trK = kk_init.trace(gamma) ;
507
508 Sym_tensor aa_init (mp, CON, mp.get_bvect_spher()) ;
509 aa_init = psi_init*psi_init*psi_init*psi_init*kk_init
510 - 1./3. * trK * met_gamt.con() ;
511
512 // --------------------------------------
513 // End of the setup of Kerr Shild metric
514 // --------------------------------------
515
516
517 // Set up of extrinsic curvature
518 // -----------------------------
519
520 Metric met_gam(psi_init*psi_init*psi_init*psi_init*gamt) ;
521 Sym_tensor kk_init (mp, CON, mp.get_bvect_spher()) ;
522
523 int check ;
524 check = 0 ;
525 for (int k=0; k<np_tab[1]; k++)
526 for (int j=0; j<nt_tab[1]; j++){
527 if (nn_init.val_grid_point(1, k, j , 0) < 1e-12){
528 check = 1 ;
529 break ;
530 }
531 }
532 if (check == 0)
533 kk_init = - 0.5 * met_gam.con().derive_lie(beta_init) / nn_init ;
534 else {
535 Sym_tensor kk_temp (mp, CON, mp.get_bvect_spher()) ;
536 kk_temp = - 0.5 * met_gam.con().derive_lie(beta_init) ;
537
538 Scalar nn_sxpun (division_xpun (Cmp(nn_init), 0)) ;
539 nn_sxpun.set_domain(0) = 1. ;
540
541 Scalar auxi (mp) ;
542 for (int i=1 ; i<=3 ; i++)
543 for (int j=i ; j<=3 ; j++) {
544 auxi = kk_temp(i, j) ;
545 auxi.annule_domain(0) ;
546 auxi = division_xpun (auxi, 0) ;
547 kk_init.set(i,j) = auxi / nn_sxpun ;
548 }
549 }
550
551 Sym_tensor aa_init (mp, CON, mp.get_bvect_spher()) ;
552 aa_init = psi_init*psi_init*psi_init*psi_init*kk_init
553 - 1./3. * trK * met_gamt.con() ;
554
555
556 //-------------------------------------
557 // Construction of the space-time
558 //-------------------------------------
559
560 Isol_hor isolhor(mp, nn_init, psi_init, beta_init, aa_init, met_gamt,
561 gamt_point, trK, trK_point, ff, 3) ;
562
563 // In order to initialise isolhor.k_uu() and k_dd() at the good value
564 Sym_tensor bidon (mp, CON, mp.get_bvect_spher()) ;
565 bidon = isolhor.k_uu() ;
566 Sym_tensor bidon2 (isolhor.k_dd()) ;
567 Scalar bidon3 (isolhor.aa_quad()) ;
568
569
570 // New initialisation of the metric quantities
571 // --------------------------------------------
572
573 psi_init = 0.9*psi_kerr ;
574 psi_init.std_spectral_base() ;
575 isolhor.set_psi(psi_init) ;
576
577 // nn_init = 1. ;
578 // nn_init.std_spectral_base() ;
579
580
581 // Test of the constraints
582 //------------------------
583
584 cout<< "----------------------------------------" <<endl ;
585
586 isolhor.check_hamiltonian_constraint() ;
587 isolhor.check_momentum_constraint() ;
588
589 cout<< "----------------------------------------" <<endl ;
590
591 //-----------------------------------------
592 // "Call to init_data.C"
593 //-----------------------------------------
594
595 isolhor.set_omega(ang_vel) ;
596 isolhor.set_boost_x(boost_x) ;
597 isolhor.set_boost_z(boost_z) ;
598
599 isolhor.init_data(bound_nn, lim_nn, bound_psi, bound_beta, solve_lapse,
600 solve_psi, solve_shift, seuil, relax, niter) ;
601
602
603 // Expansion
604 //----------
605
606 Scalar expansion = contract(isolhor.gam().radial_vect().derive_cov(isolhor.gam()), 0,1)
607 + contract(contract(isolhor.k_dd(), 0, isolhor.gam().radial_vect(), 0),
608 0, isolhor.gam().radial_vect(), 0)
609 - isolhor.trk() ;
610
611 double der_expansion_0 = expansion.derive_cov(isolhor.gam())(1)
612 .val_point(1.00000001, 0, 0.) ;
613 double der_expansion_1 = expansion.derive_cov(isolhor.gam())(1)
614 .val_point(1.00000001, M_PI/4, 0.) ;
615 double der_expansion_2 = expansion.derive_cov(isolhor.gam())(1)
616 .val_point(1.00000001, M_PI/2, 0.) ;
617
618 cout << "Radial derivative of the expansion at (1,0,0) = "
619 << der_expansion_0<<endl ;
620 cout << "Radial derivative of the expansion at (1,Pi/4,0) = "
621 << der_expansion_1<<endl ;
622 cout << "Radial derivative of the expansion at (1,Pi/2,0) = "
623 << der_expansion_2<<endl ;
624 cout << "------------------------------------------------------"<<endl;
625
626 /*
627 des_meridian(expansion, 1, 1.2, "Expansion theta", 2) ;
628 des_meridian(expansion, 1, 4., "Expansion theta", 1) ;
629 des_meridian(expansion, 1, 10., "Expansion theta", 3) ;
630 arrete() ;
631 */
632
633 // Save in a file
634 // --------------
635
636 FILE* fresu = fopen("resu.d", "w") ;
637 mgrid.sauve(fresu) ;
638 mp.sauve(fresu) ;
639 isolhor.sauve(fresu, true) ;
640 fclose(fresu) ;
641
642 // Test of the constraints
643 //------------------------
644
645 isolhor.update_aa() ;
646
647 cout<< "----------------------------------------" <<endl ;
648
649 Tbl check_ham = isolhor.check_hamiltonian_constraint() ;
650 Tbl check_mom = isolhor.check_momentum_constraint() ;
651
652 cout<< "----------------------------------------" <<endl ;
653
654
655 // Physical parameters of the Black Hole
656 //--------------------------------------
657
658 cout<< "------------------------------------------------" <<endl;
659 cout<< " Physical parameters of the Black Hole " <<endl;
660 cout<< "------------------------------------------------" <<endl;
661
662 double rr_hor = isolhor.radius_hor() ;
663 cout<< "Radius of the horizon = " << rr_hor <<endl ;
664
665 double jj_hor = isolhor.ang_mom_hor() ;
666 cout<< "Angular momentum of the horizon = " << jj_hor <<endl ;
667
668 double mm_hor = isolhor.mass_hor() ;
669 cout<< "Mass of the horizon = " << mm_hor <<endl ;
670
671 double kappa_hor = isolhor.kappa_hor() ;
672 cout<< "Surface gravity of the horizon = " << kappa_hor <<endl ;
673
674 double omega_hor = isolhor.omega_hor() ;
675 cout<< "Orbital velocity of the horizon = " << omega_hor <<endl ;
676
677
678 // Physical parameters of the Bulk
679 //--------------------------------
680
681 cout.precision(8) ;
682 cout<< endl;
683 cout<< "------------------------------------------------" <<endl;
684 cout<< " Physical parameters of the Bulk " <<endl;
685 cout<< "------------------------------------------------" <<endl;
686
687 double mm_adm = isolhor.adm_mass() ;
688 cout << "ADM mass= " << mm_adm <<endl ;
689
690 double jj_adm = isolhor.ang_mom_adm() ;
691 cout << "ADM angular momentum= " << jj_adm <<endl ;
692
693 double aa = jj_adm / mm_adm ;
694 cout << "J / M (ADM) : " << aa << endl ;
695
696 double aasmm = aa / mm_adm ;
697 cout << "J / M^2 : " << aasmm << endl ;
698
699 double epsa = isolhor.area_hor() /
700 (8*M_PI*(mm_adm*mm_adm + pow(pow(mm_adm, 4.) - jj_adm*jj_adm, 0.5))) ;
701 cout << "epsilon A : " << epsa << endl ;
702
703 double diff_mm = (mm_adm - mm_hor) / mm_adm ;
704 cout << "diff mass : " << diff_mm << endl ;
705
706 double diff_jj = (jj_adm - jj_hor) / jj_adm ;
707 cout << "diffangular momentum : " << diff_jj << endl ;
708
709 // Writing of all global quantities in a file
710 ofstream resformat("resformat.d") ;
711 resformat.precision(6) ;
712 resformat << "# Ham. constr. Mom. constr. " << endl ;
713 resformat << max(check_ham) << " " << max(check_mom) << endl ;
714 resformat.precision(10) ;
715 resformat << "# r_hor J_hor M_hor kappa_hor omega_hor" << endl ;
716 resformat << rr_hor << " " << jj_hor << " " << mm_hor << " "
717 << kappa_hor << " " << omega_hor << endl ;
718 resformat << "# M_adm J_adm J/M J/M2 Eps_a" << endl ;
719 resformat << mm_adm << " " << jj_adm << " " << aa << " "
720 << aasmm << " " << epsa << endl ;
721 resformat << "# diff_mm diff_jj" << endl ;
722 resformat << diff_mm << " " << diff_jj << endl ;
723
724 resformat.close() ;
725
726 //--------------------------------------
727 // Comparison
728 //--------------------------------------
729
730 cout<<"Tout va bien boudiou / Todo bien!!! (Viva Cai!)"<<endl ;
731
732 return EXIT_SUCCESS ;
733 }
734
735
736
737