LORENE
kerr_QI.C
1/*
2 * Methods of the class Kerr_QI
3 *
4 * (see file compobj.h for documentation).
5 *
6 */
7
8/*
9 * Copyright (c) 2013 Claire Some, Eric Gourgoulhon
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
29
30/*
31 * $Id: kerr_QI.C,v 1.6 2018/11/16 14:34:35 j_novak Exp $
32 * $Log: kerr_QI.C,v $
33 * Revision 1.6 2018/11/16 14:34:35 j_novak
34 * Changed minor points to avoid some compilation warnings.
35 *
36 * Revision 1.5 2016/12/05 16:17:49 j_novak
37 * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
38 *
39 * Revision 1.4 2014/10/13 08:52:49 j_novak
40 * Lorene classes and functions now belong to the namespace Lorene.
41 *
42 * Revision 1.3 2013/04/04 08:53:47 e_gourgoulhon
43 * Minor improvements
44 *
45 * Revision 1.2 2013/04/03 12:09:50 e_gourgoulhon
46 * New computation of b_car
47 *
48 * Revision 1.1 2013/04/02 23:17:18 e_gourgoulhon
49 * New class Kerr_QI
50 *
51 *
52 * $Header: /cvsroot/Lorene/C++/Source/Compobj/kerr_QI.C,v 1.6 2018/11/16 14:34:35 j_novak Exp $
53 *
54 */
55
56
57// C headers
58#include <cassert>
59
60// Lorene headers
61#include "compobj.h"
62#include "unites.h"
63
64 //--------------//
65 // Constructors //
66 //--------------//
67
68// Standard constructor
69// --------------------
70namespace Lorene {
71Kerr_QI::Kerr_QI(Map& mpi, double mass, double a_over_m) :
72 Compobj_QI(mpi)
73{
74 mm = mass ;
75 aa = a_over_m * mm ;
76 double mm2 = mm*mm ;
77 double aa2 = aa*aa ;
78 double hh = sqrt(mm2-aa2) ; // Eq. (98)
79 double hh2 = hh*hh ;
80 double r_hor = hh / double(2) ; // Eq. (10)
81
82 const Coord& r = mp.r ; // r field
83 const Coord& cost = mp.cost ; // cos(theta) field
84 const Coord& sint = mp.sint ; // sin(theta) field
85 Mtbl r2 = r*r ;
86 Mtbl cost2 = cost*cost ;
87 Mtbl sint2 = sint*sint ;
88
89 // A^2
90 a_car = 1 + 2*mm/r + (3*mm2 + aa2*(2*cost2-1))/(2*r2) + hh2*mm/(2*r*r2) +
91 hh2*hh2/(16*r2*r2) ; // Eq. (121)
92 a_car.set_domain(0) = 1 ;
93 a_car.std_spectral_base() ;
94
95 // Boyer-Lindquist radial coordinate and associated quantities:
96 Mtbl rBL = r + hh2/(4*r) + mm ; // Eq. (110)
97 Mtbl rBL2 = rBL*rBL ;
98 Mtbl sigma = rBL2 + aa2*cost2 ; // Eq. (93)
99 Mtbl rBLovr = 1 + mm/r + r_hor*r_hor/r2 ; // R/r
100
101 // B^2
102 b_car = rBLovr * ( rBLovr + 2*aa2*mm*sint2 / (r*sigma) ) + aa2 / r2 ; // Eq. (125)
103 b_car.set_domain(0) = 1 ;
104 b_car.std_spectral_base() ;
105 bbb = sqrt(b_car) ;
106 bbb.std_spectral_base() ;
107
108 // N
109 nn = (1 - r_hor*r_hor / r2) / bbb ; // Eq. (81) + (10)
110 nn.set_domain(0) = 1 ;
111 nn.std_spectral_base() ;
112
113 // N^phi
114 nphi = 2*aa*mm / (sigma*(rBL+aa2/rBL) + 2*aa2*mm*sint2) ; // Eq. (126)
115 if (nphi.get_etat() == ETATQCQ) {
116 nphi.set_domain(0) = 0 ;
117 }
118 nphi.std_spectral_base() ;
119
120 // Pointers of derived quantities initialized to zero :
121 set_der_0x0() ;
122}
123
124// Copy constructor
125// --------------------
127 Compobj_QI(other),
128 mm(other.mm),
129 aa(other.aa)
130{
131 // Pointers of derived quantities initialized to zero :
132 set_der_0x0() ;
133}
134
135
136// Constructor from a file
137// -----------------------
138Kerr_QI::Kerr_QI(Map& mpi, FILE*) :
139 Compobj_QI(mpi)
140{
141 // Pointers of derived quantities initialized to zero :
142 set_der_0x0() ;
143
144 // Read of the saved fields:
145 // ------------------------
146
147
148}
149
150 //------------//
151 // Destructor //
152 //------------//
153
155
156 del_deriv() ;
157
158}
159
160
161 //----------------------------------//
162 // Management of derived quantities //
163 //----------------------------------//
164
165void Kerr_QI::del_deriv() const {
166
168
169
171}
172
173
175
176}
177
178 //--------------//
179 // Assignment //
180 //--------------//
181
182// Assignment to another Kerr_QI
183// --------------------------------
184void Kerr_QI::operator=(const Kerr_QI& other) {
185
186 // Assignment of quantities common to all the derived classes of Compobj_QI
187 Compobj_QI::operator=(other) ;
188
189 mm = other.mm ;
190 aa = other.aa ;
191
192 del_deriv() ; // Deletes all derived quantities
193}
194
195 //--------------//
196 // Outputs //
197 //--------------//
198
199// Save in a file
200// --------------
201void Kerr_QI::sauve(FILE* ) const {
202
203
204}
205
206// Printing
207// --------
208
209ostream& Kerr_QI::operator>>(ostream& ost) const {
210
211 using namespace Unites ;
212
214
215 ost << endl << "Kerr spacetime in quasi-isotropic coordinates (class Kerr_QI) " << endl ;
216
217 ost << "M = " << mm << " a = " << aa << endl ;
218
219 return ost ;
220
221}
222
223 //-------------------------//
224 // Computational methods //
225 //-------------------------//
226
227}
void operator=(const Compobj_QI &)
Assignment to another Compobj_QI.
Definition compobj_QI.C:198
Scalar nphi
Metric coefficient .
Definition compobj.h:299
virtual void del_deriv() const
Deletes all the derived quantities.
Definition compobj_QI.C:166
Compobj_QI(Map &map_i)
Standard constructor.
Definition compobj_QI.C:89
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition compobj_QI.C:267
Scalar b_car
Square of the metric factor B.
Definition compobj.h:296
Scalar bbb
Metric factor B.
Definition compobj.h:293
Scalar a_car
Square of the metric factor A.
Definition compobj.h:290
Scalar nn
Lapse function N .
Definition compobj.h:138
Map & mp
Mapping describing the coordinate system (r,theta,phi).
Definition compobj.h:135
Active physical coordinates and mapping derivatives.
Definition coord.h:90
virtual ~Kerr_QI()
Destructor.
Definition kerr_QI.C:154
virtual void del_deriv() const
Deletes all the derived quantities.
Definition kerr_QI.C:165
double mm
mass parameter
Definition compobj.h:827
Kerr_QI(Map &mp_i, double mass, double a_over_m)
Standard constructor.
Definition kerr_QI.C:71
void operator=(const Kerr_QI &)
Assignment to another Kerr_QI.
Definition kerr_QI.C:184
double aa
angular momentum parameter
Definition compobj.h:831
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition kerr_QI.C:174
virtual void sauve(FILE *) const
Save in a file.
Definition kerr_QI.C:201
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition kerr_QI.C:209
Multi-domain array.
Definition mtbl.h:118
Cmp sqrt(const Cmp &)
Square root.
Definition cmp_math.C:223
Lorene prototypes.
Definition app_hor.h:67
Coord cost
Definition map.h:734
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Definition map.C:142
Coord r
r coordinate centered on the grid
Definition map.h:730
Coord sint
Definition map.h:733
Standard units of space, time and mass.