Debian Codegraph @

C++/Source/Hole_bhns/hole_bhns.C

raw
1 /*
2 * Methods of class Hole_bhns
3 *
4 * (see file hole_bhns.h for documentation).
5 *
6 */
7
8 /*
9 * Copyright (c) 2005-2007 Keisuke Taniguchi
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 hole_bhns_C[] = "$Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns.C,v 1.4 2014/10/13 08:52:59 j_novak Exp $" ;
29
30 /*
31 * $Id: hole_bhns.C,v 1.4 2014/10/13 08:52:59 j_novak Exp $
32 * $Log: hole_bhns.C,v $
33 * Revision 1.4 2014/10/13 08:52:59 j_novak
34 * Lorene classes and functions now belong to the namespace Lorene.
35 *
36 * Revision 1.3 2014/10/06 15:13:10 j_novak
37 * Modified #include directives to use c++ syntax.
38 *
39 * Revision 1.2 2008/05/15 19:03:00 k_taniguchi
40 * Change of some parameters.
41 *
42 * Revision 1.1 2007/06/22 01:24:16 k_taniguchi
43 * *** empty log message ***
44 *
45 *
46 * $Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns.C,v 1.4 2014/10/13 08:52:59 j_novak Exp $
47 *
48 */
49
50 // C++ headers
51 //#include <>
52
53 // C headers
54 #include <cmath>
55
56 // Lorene headers
57 #include "hole_bhns.h"
58 #include "unites.h"
59
60
61 //----------------------//
62 // Constructors //
63 //----------------------//
64
65 // Standard constructor
66 // --------------------
67 namespace Lorene {
68 Hole_bhns::Hole_bhns(Map& mp_i, bool kerrschild_i, bool bc_nd_i,
69 bool bc_fs_i, bool irrot_i, double massbh)
70 : Black_hole(mp_i, kerrschild_i, massbh),
71 bc_lapconf_nd(bc_nd_i),
72 bc_lapconf_fs(bc_fs_i),
73 irrotational(irrot_i),
74 lapconf_auto_rs(mp_i),
75 lapconf_auto_bh(mp_i),
76 lapconf_auto(mp_i),
77 lapconf_comp(mp_i),
78 lapconf_tot(mp_i),
79 lapse_auto(mp_i),
80 lapse_tot(mp_i),
81 d_lapconf_auto_rs(mp_i, COV, mp_i.get_bvect_cart()),
82 d_lapconf_auto_bh(mp_i, COV, mp_i.get_bvect_cart()),
83 d_lapconf_auto(mp_i, COV, mp_i.get_bvect_cart()),
84 d_lapconf_comp(mp_i, COV, mp_i.get_bvect_cart()),
85 shift_auto_rs(mp_i, CON, mp_i.get_bvect_cart()),
86 shift_auto_bh(mp_i, CON, mp_i.get_bvect_cart()),
87 shift_auto(mp_i, CON, mp_i.get_bvect_cart()),
88 shift_comp(mp_i, CON, mp_i.get_bvect_cart()),
89 shift_tot(mp_i, CON, mp_i.get_bvect_cart()),
90 d_shift_auto_rs(mp_i, 2, CON, mp_i.get_bvect_cart()),
91 d_shift_auto_bh(mp_i, 2, CON, mp_i.get_bvect_cart()),
92 d_shift_auto(mp_i, 2, CON, mp_i.get_bvect_cart()),
93 d_shift_comp(mp_i, 2, CON, mp_i.get_bvect_cart()),
94 confo_auto_rs(mp_i),
95 confo_auto_bh(mp_i),
96 confo_auto(mp_i),
97 confo_comp(mp_i),
98 confo_tot(mp_i),
99 d_confo_auto_rs(mp_i, COV, mp_i.get_bvect_cart()),
100 d_confo_auto_bh(mp_i, COV, mp_i.get_bvect_cart()),
101 d_confo_auto(mp_i, COV, mp_i.get_bvect_cart()),
102 d_confo_comp(mp_i, COV, mp_i.get_bvect_cart()),
103 taij_tot_rs(mp_i, CON, mp_i.get_bvect_cart()),
104 taij_tot_rot(mp_i, CON, mp_i.get_bvect_cart()),
105 taij_tot_bh(mp_i, CON, mp_i.get_bvect_cart()),
106 taij_tot(mp_i, CON, mp_i.get_bvect_cart()),
107 taij_auto_rs(mp_i, CON, mp_i.get_bvect_cart()),
108 taij_auto(mp_i, CON, mp_i.get_bvect_cart()),
109 taij_comp(mp_i, CON, mp_i.get_bvect_cart()),
110 taij_quad_tot_rs(mp_i),
111 taij_quad_tot_rot(mp_i),
112 taij_quad_tot_bh(mp_i),
113 taij_quad_tot(mp_i),
114 taij_quad_auto(mp_i),
115 taij_quad_comp(mp_i)
116 {
117
118 omega_spin = 0. ;
119
120 // The metric quantities are initialized to the flat one or zero
121 lapconf_auto_rs = 0. ;
122 lapconf_auto_rs.std_spectral_base() ;
123 lapconf_auto_bh = 1. ;
124 lapconf_auto_bh.std_spectral_base() ;
125 lapconf_auto = 1. ;
126 lapconf_auto.std_spectral_base() ;
127 lapconf_comp = 0. ;
128 lapconf_comp.std_spectral_base() ;
129 lapconf_tot = 1. ;
130 lapconf_tot.std_spectral_base() ;
131
132 lapse_auto = 1. ;
133 lapse_auto.std_spectral_base() ;
134 lapse_tot = 1. ;
135 lapse_tot.std_spectral_base() ;
136
137 d_lapconf_auto_rs.set_etat_zero() ;
138 d_lapconf_auto_bh.set_etat_zero() ;
139 d_lapconf_auto.set_etat_zero() ;
140 d_lapconf_comp.set_etat_zero() ;
141
142 shift_auto_rs.set_etat_zero() ;
143 shift_auto_bh.set_etat_zero() ;
144 shift_auto.set_etat_zero() ;
145 shift_comp.set_etat_zero() ;
146 shift_tot.set_etat_zero() ;
147
148 d_shift_auto_rs.set_etat_zero() ;
149 d_shift_auto_bh.set_etat_zero() ;
150 d_shift_auto.set_etat_zero() ;
151 d_shift_comp.set_etat_zero() ;
152
153 confo_auto_rs = 0. ;
154 confo_auto_rs.std_spectral_base() ;
155 confo_auto_bh = 1. ;
156 confo_auto_bh.std_spectral_base() ;
157 confo_auto = 1. ;
158 confo_auto.std_spectral_base() ;
159 confo_comp = 0. ;
160 confo_comp.std_spectral_base() ;
161 confo_tot = 1. ;
162 confo_tot.std_spectral_base() ;
163
164 d_confo_auto_rs.set_etat_zero() ;
165 d_confo_auto_bh.set_etat_zero() ;
166 d_confo_auto.set_etat_zero() ;
167 d_confo_comp.set_etat_zero() ;
168
169 taij_tot_rs.set_etat_zero() ;
170 taij_tot_rot.set_etat_zero() ;
171 taij_tot_bh.set_etat_zero() ;
172 taij_tot.set_etat_zero() ;
173 taij_auto_rs.set_etat_zero() ;
174 taij_auto.set_etat_zero() ;
175 taij_comp.set_etat_zero() ;
176
177 taij_quad_tot_rs = 0. ;
178 taij_quad_tot_rs.std_spectral_base() ;
179 taij_quad_tot_rot = 0. ;
180 taij_quad_tot_rot.std_spectral_base() ;
181 taij_quad_tot_bh = 0. ;
182 taij_quad_tot_bh.std_spectral_base() ;
183 taij_quad_tot = 0. ;
184 taij_quad_tot.std_spectral_base() ;
185 taij_quad_auto = 0. ;
186 taij_quad_auto.std_spectral_base() ;
187 taij_quad_comp = 0. ;
188 taij_quad_comp.std_spectral_base() ;
189
190 // Pointers of derived quantities initialized to zero :
191 set_der_0x0() ;
192
193 }
194
195 // Copy constructor
196 // ----------------
197 Hole_bhns::Hole_bhns(const Hole_bhns& hole)
198 : Black_hole(hole),
199 bc_lapconf_nd(hole.bc_lapconf_nd),
200 bc_lapconf_fs(hole.bc_lapconf_fs),
201 irrotational(hole.irrotational),
202 omega_spin(hole.omega_spin),
203 lapconf_auto_rs(hole.lapconf_auto_rs),
204 lapconf_auto_bh(hole.lapconf_auto_bh),
205 lapconf_auto(hole.lapconf_auto),
206 lapconf_comp(hole.lapconf_comp),
207 lapconf_tot(hole.lapconf_tot),
208 lapse_auto(hole.lapse_auto),
209 lapse_tot(hole.lapse_tot),
210 d_lapconf_auto_rs(hole.d_lapconf_auto_rs),
211 d_lapconf_auto_bh(hole.d_lapconf_auto_bh),
212 d_lapconf_auto(hole.d_lapconf_auto),
213 d_lapconf_comp(hole.d_lapconf_comp),
214 shift_auto_rs(hole.shift_auto_rs),
215 shift_auto_bh(hole.shift_auto_bh),
216 shift_auto(hole.shift_auto),
217 shift_comp(hole.shift_comp),
218 shift_tot(hole.shift_tot),
219 d_shift_auto_rs(hole.d_shift_auto_rs),
220 d_shift_auto_bh(hole.d_shift_auto_bh),
221 d_shift_auto(hole.d_shift_auto),
222 d_shift_comp(hole.d_shift_comp),
223 confo_auto_rs(hole.confo_auto_rs),
224 confo_auto_bh(hole.confo_auto_bh),
225 confo_auto(hole.confo_auto),
226 confo_comp(hole.confo_comp),
227 confo_tot(hole.confo_tot),
228 d_confo_auto_rs(hole.d_confo_auto_rs),
229 d_confo_auto_bh(hole.d_confo_auto_bh),
230 d_confo_auto(hole.d_confo_auto),
231 d_confo_comp(hole.d_confo_comp),
232 taij_tot_rs(hole.taij_tot_rs),
233 taij_tot_rot(hole.taij_tot_rot),
234 taij_tot_bh(hole.taij_tot_bh),
235 taij_tot(hole.taij_tot),
236 taij_auto_rs(hole.taij_auto_rs),
237 taij_auto(hole.taij_auto),
238 taij_comp(hole.taij_comp),
239 taij_quad_tot_rs(hole.taij_quad_tot_rs),
240 taij_quad_tot_rot(hole.taij_quad_tot_rot),
241 taij_quad_tot_bh(hole.taij_quad_tot_bh),
242 taij_quad_tot(hole.taij_quad_tot),
243 taij_quad_auto(hole.taij_quad_auto),
244 taij_quad_comp(hole.taij_quad_comp)
245 {
246 set_der_0x0() ;
247 }
248
249 // Constructor from a file
250 // -----------------------
251 Hole_bhns::Hole_bhns(Map& mp_i, FILE* fich)
252 : Black_hole(mp_i, fich),
253 lapconf_auto_rs(mp_i, *(mp_i.get_mg()), fich),
254 lapconf_auto_bh(mp_i),
255 lapconf_auto(mp_i),
256 lapconf_comp(mp_i),
257 lapconf_tot(mp_i),
258 lapse_auto(mp_i),
259 lapse_tot(mp_i),
260 d_lapconf_auto_rs(mp_i, COV, mp_i.get_bvect_cart()),
261 d_lapconf_auto_bh(mp_i, COV, mp_i.get_bvect_cart()),
262 d_lapconf_auto(mp_i, COV, mp_i.get_bvect_cart()),
263 d_lapconf_comp(mp_i, COV, mp_i.get_bvect_cart()),
264 shift_auto_rs(mp_i, mp_i.get_bvect_cart(), fich),
265 shift_auto_bh(mp_i, CON, mp_i.get_bvect_cart()),
266 shift_auto(mp_i, CON, mp_i.get_bvect_cart()),
267 shift_comp(mp_i, CON, mp_i.get_bvect_cart()),
268 shift_tot(mp_i, CON, mp_i.get_bvect_cart()),
269 d_shift_auto_rs(mp_i, 2, CON, mp_i.get_bvect_cart()),
270 d_shift_auto_bh(mp_i, 2, CON, mp_i.get_bvect_cart()),
271 d_shift_auto(mp_i, 2, CON, mp_i.get_bvect_cart()),
272 d_shift_comp(mp_i, 2, CON, mp_i.get_bvect_cart()),
273 confo_auto_rs(mp_i, *(mp_i.get_mg()), fich),
274 confo_auto_bh(mp_i),
275 confo_auto(mp_i),
276 confo_comp(mp_i),
277 confo_tot(mp_i),
278 d_confo_auto_rs(mp_i, COV, mp_i.get_bvect_cart()),
279 d_confo_auto_bh(mp_i, COV, mp_i.get_bvect_cart()),
280 d_confo_auto(mp_i, COV, mp_i.get_bvect_cart()),
281 d_confo_comp(mp_i, COV, mp_i.get_bvect_cart()),
282 taij_tot_rs(mp_i, CON, mp_i.get_bvect_cart()),
283 taij_tot_rot(mp_i, CON, mp_i.get_bvect_cart()),
284 taij_tot_bh(mp_i, CON, mp_i.get_bvect_cart()),
285 taij_tot(mp_i, CON, mp_i.get_bvect_cart()),
286 taij_auto_rs(mp_i, CON, mp_i.get_bvect_cart()),
287 taij_auto(mp_i, CON, mp_i.get_bvect_cart()),
288 taij_comp(mp_i, CON, mp_i.get_bvect_cart()),
289 taij_quad_tot_rs(mp_i),
290 taij_quad_tot_rot(mp_i),
291 taij_quad_tot_bh(mp_i),
292 taij_quad_tot(mp_i),
293 taij_quad_auto(mp_i),
294 taij_quad_comp(mp_i)
295 {
296
297 // bc_lapconf_nd, bc_lapconf_fs, irrotational, and omega_spin
298 // are read from the file
299 fread(&bc_lapconf_nd, sizeof(bool), 1, fich) ;
300 fread(&bc_lapconf_fs, sizeof(bool), 1, fich) ;
301 fread(&irrotational, sizeof(bool), 1, fich) ;
302 fread(&omega_spin, sizeof(double), 1, fich) ;
303
304 // All other quantities are initialized to zero
305 // --------------------------------------------
306
307 lapconf_auto_bh = 1. ;
308 lapconf_auto_bh.std_spectral_base() ;
309 lapconf_auto = 1. ;
310 lapconf_auto.std_spectral_base() ;
311 lapconf_comp = 0. ;
312 lapconf_comp.std_spectral_base() ;
313 lapconf_tot = 1. ;
314 lapconf_tot.std_spectral_base() ;
315
316 lapse_auto = 1. ;
317 lapse_auto.std_spectral_base() ;
318 lapse_tot = 1. ;
319 lapse_tot.std_spectral_base() ;
320
321 d_lapconf_auto_rs.set_etat_zero() ;
322 d_lapconf_auto_bh.set_etat_zero() ;
323 d_lapconf_auto.set_etat_zero() ;
324 d_lapconf_comp.set_etat_zero() ;
325
326 shift_auto_bh.set_etat_zero() ;
327 shift_auto.set_etat_zero() ;
328 shift_comp.set_etat_zero() ;
329 shift_tot.set_etat_zero() ;
330 d_shift_auto_rs.set_etat_zero() ;
331 d_shift_auto_bh.set_etat_zero() ;
332 d_shift_auto.set_etat_zero() ;
333 d_shift_comp.set_etat_zero() ;
334
335 confo_auto_bh = 1. ;
336 confo_auto_bh.std_spectral_base() ;
337 confo_auto = 1. ;
338 confo_auto.std_spectral_base() ;
339 confo_comp = 0. ;
340 confo_comp.std_spectral_base() ;
341 confo_tot = 1. ;
342 confo_tot.std_spectral_base() ;
343
344 d_confo_auto_rs.set_etat_zero() ;
345 d_confo_auto_bh.set_etat_zero() ;
346 d_confo_auto.set_etat_zero() ;
347 d_confo_comp.set_etat_zero() ;
348
349 taij_tot_rs.set_etat_zero() ;
350 taij_tot_rot.set_etat_zero() ;
351 taij_tot_bh.set_etat_zero() ;
352 taij_tot.set_etat_zero() ;
353 taij_auto_rs.set_etat_zero() ;
354 taij_auto.set_etat_zero() ;
355 taij_comp.set_etat_zero() ;
356 taij_quad_tot_rs = 0. ;
357 taij_quad_tot_rs.std_spectral_base() ;
358 taij_quad_tot_rot = 0. ;
359 taij_quad_tot_rot.std_spectral_base() ;
360 taij_quad_tot_bh = 0. ;
361 taij_quad_tot_bh.std_spectral_base() ;
362 taij_quad_tot = 0. ;
363 taij_quad_tot.std_spectral_base() ;
364 taij_quad_auto = 0. ;
365 taij_quad_auto.std_spectral_base() ;
366 taij_quad_comp = 0. ;
367 taij_quad_comp.std_spectral_base() ;
368
369 // Pointers of derived quantities initialized to zero
370 // --------------------------------------------------
371 set_der_0x0() ;
372
373 }
374
375
376 //--------------------//
377 // Destructor //
378 //--------------------//
379
380 Hole_bhns::~Hole_bhns()
381 {
382
383 del_deriv() ;
384
385 }
386
387
388 //------------------------------------------//
389 // Management of derived quantities //
390 //------------------------------------------//
391
392 void Hole_bhns::del_deriv() const {
393
394 Black_hole::del_deriv() ;
395
396 if (p_mass_irr_bhns != 0x0) delete p_mass_irr_bhns ;
397 if (p_spin_am_bhns != 0x0) delete p_spin_am_bhns ;
398
399 set_der_0x0() ;
400
401 }
402
403 void Hole_bhns::set_der_0x0() const {
404
405 Black_hole::set_der_0x0() ;
406
407 p_mass_irr_bhns = 0x0 ;
408 p_spin_am_bhns = 0x0 ;
409
410 }
411
412
413 //--------------------//
414 // Assignment //
415 //--------------------//
416
417 // Assignment to another Hole_bhns
418 // -------------------------------
419 void Hole_bhns::operator=(const Hole_bhns& hole) {
420
421 // Assignment of quantities common to the derived classes of Black_hole
422 Black_hole::operator=(hole) ;
423
424 // Assignment of proper quantities of class Hole_bhns
425 bc_lapconf_nd = hole.bc_lapconf_nd ;
426 bc_lapconf_fs = hole.bc_lapconf_fs ;
427 irrotational = hole.irrotational ;
428 omega_spin = hole.omega_spin ;
429 lapconf_auto_rs = hole.lapconf_auto_rs ;
430 lapconf_auto_bh = hole.lapconf_auto_bh ;
431 lapconf_auto = hole.lapconf_auto ;
432 lapconf_comp = hole.lapconf_comp ;
433 lapconf_tot = hole.lapconf_tot ;
434 lapse_auto = hole.lapse_auto ;
435 lapse_tot = hole.lapse_tot ;
436 d_lapconf_auto_rs = hole.d_lapconf_auto_rs ;
437 d_lapconf_auto_bh = hole.d_lapconf_auto_bh ;
438 d_lapconf_auto = hole.d_lapconf_auto ;
439 d_lapconf_comp = hole.d_lapconf_comp ;
440 shift_auto_rs = hole.shift_auto_rs ;
441 shift_auto_bh = hole.shift_auto_bh ;
442 shift_auto = hole.shift_auto ;
443 shift_comp = hole.shift_comp ;
444 shift_tot = hole.shift_tot ;
445 d_shift_auto_rs = hole.d_shift_auto_rs ;
446 d_shift_auto_bh = hole.d_shift_auto_bh ;
447 d_shift_auto = hole.d_shift_auto ;
448 d_shift_comp = hole.d_shift_comp ;
449 confo_auto_rs = hole.confo_auto_rs ;
450 confo_auto_bh = hole.confo_auto_bh ;
451 confo_auto = hole.confo_auto ;
452 confo_comp = hole.confo_comp ;
453 confo_tot = hole.confo_tot ;
454 d_confo_auto_rs = hole.d_confo_auto_rs ;
455 d_confo_auto_bh = hole.d_confo_auto_bh ;
456 d_confo_auto = hole.d_confo_auto ;
457 d_confo_comp = hole.d_confo_comp ;
458 taij_tot_rs = hole.taij_tot_rs ;
459 taij_tot_rot = hole.taij_tot_rot ;
460 taij_tot_bh = hole.taij_tot_bh ;
461 taij_tot = hole.taij_tot ;
462 taij_auto_rs = hole.taij_auto_rs ;
463 taij_auto = hole.taij_auto ;
464 taij_comp = hole.taij_comp ;
465 taij_quad_tot_rs = hole.taij_quad_tot_rs ;
466 taij_quad_tot_rot = hole.taij_quad_tot_rot ;
467 taij_quad_tot_bh = hole.taij_quad_tot_bh ;
468 taij_quad_tot = hole.taij_quad_tot ;
469 taij_quad_auto = hole.taij_quad_auto ;
470 taij_quad_comp = hole.taij_quad_comp ;
471
472 del_deriv() ;
473
474 }
475
476
477 Scalar& Hole_bhns::set_lapconf_auto_rs() {
478
479 del_deriv() ;
480 return lapconf_auto_rs ;
481
482 }
483
484 Scalar& Hole_bhns::set_lapconf_auto_bh() {
485
486 del_deriv() ;
487 return lapconf_auto_bh ;
488
489 }
490
491 Scalar& Hole_bhns::set_lapconf_auto() {
492
493 del_deriv() ;
494 return lapconf_auto ;
495
496 }
497
498 Scalar& Hole_bhns::set_lapconf_comp() {
499
500 del_deriv() ;
501 return lapconf_comp ;
502
503 }
504
505 Scalar& Hole_bhns::set_lapconf_tot() {
506
507 del_deriv() ;
508 return lapconf_tot ;
509
510 }
511
512 Scalar& Hole_bhns::set_lapse_auto() {
513
514 del_deriv() ;
515 return lapse_auto ;
516
517 }
518
519 Scalar& Hole_bhns::set_lapse_tot() {
520
521 del_deriv() ;
522 return lapse_tot ;
523
524 }
525
526 Vector& Hole_bhns::set_shift_auto_rs() {
527
528 del_deriv() ;
529 return shift_auto_rs ;
530
531 }
532
533 Vector& Hole_bhns::set_shift_auto_bh() {
534
535 del_deriv() ;
536 return shift_auto_bh ;
537
538 }
539
540 Vector& Hole_bhns::set_shift_auto() {
541
542 del_deriv() ;
543 return shift_auto ;
544
545 }
546
547 Vector& Hole_bhns::set_shift_comp() {
548
549 del_deriv() ;
550 return shift_comp ;
551
552 }
553
554 Vector& Hole_bhns::set_shift_tot() {
555
556 del_deriv() ;
557 return shift_tot ;
558
559 }
560
561 Scalar& Hole_bhns::set_confo_auto_rs() {
562
563 del_deriv() ;
564 return confo_auto_rs ;
565
566 }
567
568 Scalar& Hole_bhns::set_confo_auto_bh() {
569
570 del_deriv() ;
571 return confo_auto_bh ;
572
573 }
574
575 Scalar& Hole_bhns::set_confo_auto() {
576
577 del_deriv() ;
578 return confo_auto ;
579
580 }
581
582 Scalar& Hole_bhns::set_confo_comp() {
583
584 del_deriv() ;
585 return confo_comp ;
586
587 }
588
589 Scalar& Hole_bhns::set_confo_tot() {
590
591 del_deriv() ;
592 return confo_tot ;
593
594 }
595
596
597 //-----------------//
598 // Outputs //
599 //-----------------//
600
601 // Save in a file
602 // --------------
603 void Hole_bhns::sauve(FILE* fich) const {
604
605 Black_hole::sauve(fich) ;
606
607 lapconf_auto_rs.sauve(fich) ;
608 shift_auto_rs.sauve(fich) ;
609 confo_auto_rs.sauve(fich) ;
610
611 fwrite(&bc_lapconf_nd, sizeof(bool), 1, fich) ;
612 fwrite(&bc_lapconf_fs, sizeof(bool), 1, fich) ;
613 fwrite(&irrotational, sizeof(bool), 1, fich) ;
614 fwrite(&omega_spin, sizeof(double), 1, fich) ;
615
616 }
617
618 // Printing
619 // --------
620 ostream& Hole_bhns::operator>>(ostream& ost) const {
621
622 using namespace Unites ;
623
624 // Black_hole::operator>>(ost) ;
625
626 ost << endl ;
627 ost << "Black hole in a BHNS binary" << endl ;
628 ost << "---------------------------" << endl ;
629
630 int nt = mp.get_mg()->get_nt(1) ;
631
632 ost << "Irreducible mass of BH : "
633 << mass_irr_bhns() / msol << " [Mo]" << endl ;
634 ost << "Mass in the background : "
635 << mass_bh / msol << " [Mo]" << endl ;
636 ost << "Radius of the apparent horison : "
637 << rad_ah() / km << " [km]" << endl ;
638 ost << "Spin angular velocity : "
639 << omega_spin * f_unit << " [rad/s]" << endl ;
640 ost << "Lapse function on the AH : "
641 << lapse_tot.val_grid_point(1,0,nt-1,0) << endl ;
642 ost << "Conformal factor on the AH : "
643 << confo_tot.val_grid_point(1,0,nt-1,0) << endl ;
644 ost << "shift(1) on the AH : "
645 << shift_tot(1).val_grid_point(1,0,nt-1,0) << endl ;
646 ost << "shift(2) on the AH : "
647 << shift_tot(2).val_grid_point(1,0,nt-1,0) << endl ;
648 ost << "shift(3) on the AH : "
649 << shift_tot(3).val_grid_point(1,0,nt-1,0) << endl ;
650
651 return ost ;
652
653 }
654
655 //--------------------------------//
656 // Computational routines //
657 //--------------------------------//
658
659 void Hole_bhns::relax_bhns(const Hole_bhns& hole_prev,
660 double relax_met, int mer, int fmer_met) {
661
662 double relax_met_jm1 = 1. - relax_met ;
663
664 if ( (mer != 0) && (mer % fmer_met == 0)) {
665
666 lapconf_auto_rs = relax_met * lapconf_auto_rs
667 + relax_met_jm1 * hole_prev.lapconf_auto_rs ;
668
669 shift_auto_rs = relax_met * shift_auto_rs
670 + relax_met_jm1 * hole_prev.shift_auto_rs ;
671
672 confo_auto_rs = relax_met * confo_auto_rs
673 + relax_met_jm1 * hole_prev.confo_auto_rs ;
674
675 }
676
677 del_deriv() ;
678
679 }
680
681 }