LORENE
bhole_init_kerr.C
1/*
2 * Copyright (c) 2000-2001 Philippe Grandclement
3 *
4 * This file is part of LORENE.
5 *
6 * LORENE is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * LORENE is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with LORENE; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22
23char bhole_init_kerr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bhole/bhole_init_kerr.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $" ;
24
25/*
26 * $Id: bhole_init_kerr.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $
27 * $Log: bhole_init_kerr.C,v $
28 * Revision 1.4 2014/10/13 08:52:40 j_novak
29 * Lorene classes and functions now belong to the namespace Lorene.
30 *
31 * Revision 1.3 2014/10/06 15:12:58 j_novak
32 * Modified #include directives to use c++ syntax.
33 *
34 * Revision 1.2 2002/10/16 14:36:32 j_novak
35 * Reorganization of #include instructions of standard C++, in order to
36 * use experimental version 3 of gcc.
37 *
38 * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
39 * LORENE
40 *
41 * Revision 2.1 2000/12/14 10:45:20 phil
42 * ATTENTION : PASSAGE DE PHI A PSI
43 *
44 * Revision 2.0 2000/10/20 09:18:56 phil
45 * *** empty log message ***
46 *
47 *
48 * $Header: /cvsroot/Lorene/C++/Source/Bhole/bhole_init_kerr.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $
49 *
50 */
51
52//standard
53#include <cstdlib>
54#include <cmath>
55
56// Lorene
57#include "tenseur.h"
58#include "bhole.h"
59
60namespace Lorene {
61void Bhole::init_kerr (double masse, double moment) {
62
63 // On verifie si le rayon est bien calcule
64 assert (rayon == sqrt (masse*masse-moment*moment)/2.) ;
65
66 // Valeur de omega :
67 omega = moment/2/masse/(masse+sqrt(masse*masse-moment*moment)) ;
68
69 // Calcul de R :
70 Mtbl grand_r (mp.get_mg()) ;
71 grand_r = mp.r + (masse*masse-moment*moment)/4/mp.r + masse ;
72
73 // Calcul de sigma :
74 Mtbl sigma (mp.get_mg()) ;
75 sigma = moment*moment*mp.cost*mp.cost + grand_r*grand_r ;
76
77 // Calcul de grand_a :
78 Cmp grand_a (mp) ;
79 grand_a = 1 + 2*masse/mp.r +
80 (3*masse*masse+moment*moment*mp.cost*mp.cost)/2/mp.r/mp.r
81 + (2*masse*rayon*rayon)/pow(mp.r, 3.) + pow(rayon/mp.r, 4.) ;
82 grand_a.set_val_inf(1) ;
83 grand_a.std_base_scal() ;
84 grand_a.raccord(1) ;
85
86 // Calcul de n_phi :
87 Cmp n_phi(mp) ;
88 n_phi = (2*moment*masse*grand_r) / (sigma*(grand_r*grand_r+moment*moment)
89 + 2*moment*moment*masse*grand_r*mp.sint*mp.sint) ;
90 n_phi.annule(0) ;
91 n_phi.set_val_inf (0) ;
92 n_phi.std_base_scal() ;
93
94 // Calcul de N :
95 Cmp carre (mp) ;
96 carre = 1-(2*masse*grand_r)/sigma + (4*moment*moment*masse*masse
97 *grand_r*grand_r*mp.sint*mp.sint)/
98 (sigma*sigma*(grand_r*grand_r+moment*moment)+2*moment*moment*sigma*masse*
99 grand_r*mp.sint*mp.sint) ;
100 carre.set_val_inf(1) ;
101 carre.set_val_hor(0, 1) ;
102 carre.std_base_scal() ;
103 carre.annule(0) ;
104
106 n_auto.set() = sqrt(carre) ;
107 n_auto.set().set_dzpuis(0) ;
109 n_auto.set().raccord(1) ;
110
111 // Calcul de psi :
113 psi_auto.set() = pow(grand_a, 0.25) ;
114 psi_auto.set().set_dzpuis(0) ;
116 psi_auto.set().raccord(1) ;
117
118 // Calcul du shift :
121 Valeur auxi (mp.get_mg()) ;
122 auxi = n_phi.va.mult_st().mult_sp() ;
123 shift_auto.set(0) = auxi ;
124 auxi = -n_phi.va.mult_st().mult_cp() ;
125 shift_auto.set(1) = auxi ;
127
129
130 for (int i=0 ; i<2 ; i++) {
131 shift_auto.set(i).mult_r() ;
132 shift_auto.set(i).raccord(1) ;
133 assert (shift_auto(i).check_dzpuis (0)) ;
134 }
135}
136}
Tenseur psi_auto
Part of generated by the hole.
Definition bhole.h:290
Tenseur shift_auto
Part of generated by the hole.
Definition bhole.h:297
double omega
Angular velocity in LORENE's units.
Definition bhole.h:275
Tenseur n_auto
Part of N generated by the hole.
Definition bhole.h:286
double rayon
Radius of the horizon in LORENE's units.
Definition bhole.h:274
Map_af & mp
Affine mapping.
Definition bhole.h:273
void init_kerr(double masse, double moment)
Set the inital values to those of Kerr.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
void set_val_hor(double val, int zone)
Sets the value of the Cmp to val on the inner boudary of the shell number zone .This is usefull for d...
Definition cmp_manip.C:159
Valeur va
The numerical value of the Cmp
Definition cmp.h:464
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition cmp.C:644
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition cmp.C:348
void mult_r()
Multiplication by r everywhere.
Definition cmp_r_manip.C:91
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition cmp.C:289
void set_dzpuis(int)
Set a value to dzpuis.
Definition cmp.C:654
void set_val_inf(double val)
Sets the value of the Cmp to val at infinity.
Definition cmp_manip.C:126
void raccord(int n)
Performs the matching of the nucleus with respect to the first shell.
Coord sint
Definition map.h:721
Coord r
r coordinate centered on the grid
Definition map.h:718
Coord cost
Definition map.h:722
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition map.h:765
Multi-domain array.
Definition mtbl.h:118
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition tenseur.C:824
void inc_dzpuis()
dzpuis += 1 ;
Definition tenseur.C:1117
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition tenseur.C:636
void set_std_base()
Set the standard spectal basis of decomposition for each component.
Definition tenseur.C:1170
Values and coefficients of a (real-value) function.
Definition valeur.h:287
const Valeur & mult_st() const
Returns applied to *this.
const Valeur & mult_cp() const
Returns applied to *this.
const Valeur & mult_sp() const
Returns applied to *this.
Cmp sqrt(const Cmp &)
Square root.
Definition cmp_math.C:220
Cmp pow(const Cmp &, int)
Power .
Definition cmp_math.C:348
Lorene prototypes.
Definition app_hor.h:64