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 
23 
24 
25 /*
26  * $Id: bhole_init_kerr.C,v 1.5 2016/12/05 16:17:45 j_novak Exp $
27  * $Log: bhole_init_kerr.C,v $
28  * Revision 1.5 2016/12/05 16:17:45 j_novak
29  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
30  *
31  * Revision 1.4 2014/10/13 08:52:40 j_novak
32  * Lorene classes and functions now belong to the namespace Lorene.
33  *
34  * Revision 1.3 2014/10/06 15:12:58 j_novak
35  * Modified #include directives to use c++ syntax.
36  *
37  * Revision 1.2 2002/10/16 14:36:32 j_novak
38  * Reorganization of #include instructions of standard C++, in order to
39  * use experimental version 3 of gcc.
40  *
41  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
42  * LORENE
43  *
44  * Revision 2.1 2000/12/14 10:45:20 phil
45  * ATTENTION : PASSAGE DE PHI A PSI
46  *
47  * Revision 2.0 2000/10/20 09:18:56 phil
48  * *** empty log message ***
49  *
50  *
51  * $Header: /cvsroot/Lorene/C++/Source/Bhole/bhole_init_kerr.C,v 1.5 2016/12/05 16:17:45 j_novak Exp $
52  *
53  */
54 
55 //standard
56 #include <cstdlib>
57 #include <cmath>
58 
59 // Lorene
60 #include "tenseur.h"
61 #include "bhole.h"
62 
63 namespace Lorene {
64 void Bhole::init_kerr (double masse, double moment) {
65 
66  // On verifie si le rayon est bien calcule
67  assert (rayon == sqrt (masse*masse-moment*moment)/2.) ;
68 
69  // Valeur de omega :
70  omega = moment/2/masse/(masse+sqrt(masse*masse-moment*moment)) ;
71 
72  // Calcul de R :
73  Mtbl grand_r (mp.get_mg()) ;
74  grand_r = mp.r + (masse*masse-moment*moment)/4/mp.r + masse ;
75 
76  // Calcul de sigma :
77  Mtbl sigma (mp.get_mg()) ;
78  sigma = moment*moment*mp.cost*mp.cost + grand_r*grand_r ;
79 
80  // Calcul de grand_a :
81  Cmp grand_a (mp) ;
82  grand_a = 1 + 2*masse/mp.r +
83  (3*masse*masse+moment*moment*mp.cost*mp.cost)/2/mp.r/mp.r
84  + (2*masse*rayon*rayon)/pow(mp.r, 3.) + pow(rayon/mp.r, 4.) ;
85  grand_a.set_val_inf(1) ;
86  grand_a.std_base_scal() ;
87  grand_a.raccord(1) ;
88 
89  // Calcul de n_phi :
90  Cmp n_phi(mp) ;
91  n_phi = (2*moment*masse*grand_r) / (sigma*(grand_r*grand_r+moment*moment)
92  + 2*moment*moment*masse*grand_r*mp.sint*mp.sint) ;
93  n_phi.annule(0) ;
94  n_phi.set_val_inf (0) ;
95  n_phi.std_base_scal() ;
96 
97  // Calcul de N :
98  Cmp carre (mp) ;
99  carre = 1-(2*masse*grand_r)/sigma + (4*moment*moment*masse*masse
100  *grand_r*grand_r*mp.sint*mp.sint)/
101  (sigma*sigma*(grand_r*grand_r+moment*moment)+2*moment*moment*sigma*masse*
102  grand_r*mp.sint*mp.sint) ;
103  carre.set_val_inf(1) ;
104  carre.set_val_hor(0, 1) ;
105  carre.std_base_scal() ;
106  carre.annule(0) ;
107 
108  n_auto.set_etat_qcq() ;
109  n_auto.set() = sqrt(carre) ;
110  n_auto.set().set_dzpuis(0) ;
111  n_auto.set_std_base() ;
112  n_auto.set().raccord(1) ;
113 
114  // Calcul de psi :
116  psi_auto.set() = pow(grand_a, 0.25) ;
117  psi_auto.set().set_dzpuis(0) ;
119  psi_auto.set().raccord(1) ;
120 
121  // Calcul du shift :
124  Valeur auxi (mp.get_mg()) ;
125  auxi = n_phi.va.mult_st().mult_sp() ;
126  shift_auto.set(0) = auxi ;
127  auxi = -n_phi.va.mult_st().mult_cp() ;
128  shift_auto.set(1) = auxi ;
130 
132 
133  for (int i=0 ; i<2 ; i++) {
134  shift_auto.set(i).mult_r() ;
135  shift_auto.set(i).raccord(1) ;
136  assert (shift_auto(i).check_dzpuis (0)) ;
137  }
138 }
139 }
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition: cmp.h:446
void init_kerr(double masse, double moment)
Set the inital values to those of Kerr.
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
void annule(int l)
Sets the Cmp to zero in a given domain.
Definition: cmp.C:351
const Valeur & mult_sp() const
Returns applied to *this.
void set_std_base()
Set the standard spectal basis of decomposition for each component.
Definition: tenseur.C:1186
Multi-domain array.
Definition: mtbl.h:118
Lorene prototypes.
Definition: app_hor.h:67
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Definition: map.h:777
Tenseur psi_auto
Part of generated by the hole.
Definition: bhole.h:290
Values and coefficients of a (real-value) function.
Definition: valeur.h:297
void inc_dzpuis()
dzpuis += 1 ;
Definition: tenseur.C:1133
Tenseur shift_auto
Part of generated by the hole.
Definition: bhole.h:297
Coord sint
Definition: map.h:733
void mult_r()
Multiplication by r everywhere.
Definition: cmp_r_manip.C:94
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: cmp.C:292
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
Definition: tenseur.C:840
Map_af & mp
Affine mapping.
Definition: bhole.h:273
void set_val_inf(double val)
Sets the value of the Cmp to val at infinity.
Definition: cmp_manip.C:129
const Valeur & mult_st() const
Returns applied to *this.
double rayon
Radius of the horizon in LORENE&#39;s units.
Definition: bhole.h:274
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Definition: cmp.C:647
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:162
const Valeur & mult_cp() const
Returns applied to *this.
void raccord(int n)
Performs the matching of the nucleus with respect to the first shell.
Definition: cmp_raccord.C:173
double omega
Angular velocity in LORENE&#39;s units.
Definition: bhole.h:275
void set_dzpuis(int)
Set a value to dzpuis.
Definition: cmp.C:657
Tenseur n_auto
Part of N generated by the hole.
Definition: bhole.h:286
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Definition: tenseur.C:652
Valeur va
The numerical value of the Cmp.
Definition: cmp.h:464
Coord r
r coordinate centered on the grid
Definition: map.h:730
Coord cost
Definition: map.h:734