Debian Codegraph @

C++/Source/Compobj/kerr_QI.C

raw
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 char kerr_QI_C[] = "$Header: /cvsroot/Lorene/C++/Source/Compobj/kerr_QI.C,v 1.4 2014/10/13 08:52:49 j_novak Exp $" ;
29
30 /*
31 * $Id: kerr_QI.C,v 1.4 2014/10/13 08:52:49 j_novak Exp $
32 * $Log: kerr_QI.C,v $
33 * Revision 1.4 2014/10/13 08:52:49 j_novak
34 * Lorene classes and functions now belong to the namespace Lorene.
35 *
36 * Revision 1.3 2013/04/04 08:53:47 e_gourgoulhon
37 * Minor improvements
38 *
39 * Revision 1.2 2013/04/03 12:09:50 e_gourgoulhon
40 * New computation of b_car
41 *
42 * Revision 1.1 2013/04/02 23:17:18 e_gourgoulhon
43 * New class Kerr_QI
44 *
45 *
46 * $Header: /cvsroot/Lorene/C++/Source/Compobj/kerr_QI.C,v 1.4 2014/10/13 08:52:49 j_novak Exp $
47 *
48 */
49
50
51 // C headers
52 #include <cassert>
53
54 // Lorene headers
55 #include "compobj.h"
56 #include "unites.h"
57
58 //--------------//
59 // Constructors //
60 //--------------//
61
62 // Standard constructor
63 // --------------------
64 namespace Lorene {
65 Kerr_QI::Kerr_QI(Map& mpi, double mass, double a_over_m) :
66 Compobj_QI(mpi)
67 {
68 mm = mass ;
69 aa = a_over_m * mm ;
70 double mm2 = mm*mm ;
71 double aa2 = aa*aa ;
72 double hh = sqrt(mm2-aa2) ; // Eq. (98)
73 double hh2 = hh*hh ;
74 double r_hor = hh / double(2) ; // Eq. (10)
75
76 const Coord& r = mp.r ; // r field
77 const Coord& cost = mp.cost ; // cos(theta) field
78 const Coord& sint = mp.sint ; // sin(theta) field
79 Mtbl r2 = r*r ;
80 Mtbl cost2 = cost*cost ;
81 Mtbl sint2 = sint*sint ;
82
83 // A^2
84 a_car = 1 + 2*mm/r + (3*mm2 + aa2*(2*cost2-1))/(2*r2) + hh2*mm/(2*r*r2) +
85 hh2*hh2/(16*r2*r2) ; // Eq. (121)
86 a_car.set_domain(0) = 1 ;
87 a_car.std_spectral_base() ;
88
89 // Boyer-Lindquist radial coordinate and associated quantities:
90 Mtbl rBL = r + hh2/(4*r) + mm ; // Eq. (110)
91 Mtbl rBL2 = rBL*rBL ;
92 Mtbl sigma = rBL2 + aa2*cost2 ; // Eq. (93)
93 Mtbl rBLovr = 1 + mm/r + r_hor*r_hor/r2 ; // R/r
94
95 // B^2
96 b_car = rBLovr * ( rBLovr + 2*aa2*mm*sint2 / (r*sigma) ) + aa2 / r2 ; // Eq. (125)
97 b_car.set_domain(0) = 1 ;
98 b_car.std_spectral_base() ;
99 bbb = sqrt(b_car) ;
100 bbb.std_spectral_base() ;
101
102 // N
103 nn = (1 - r_hor*r_hor / r2) / bbb ; // Eq. (81) + (10)
104 nn.set_domain(0) = 1 ;
105 nn.std_spectral_base() ;
106
107 // N^phi
108 nphi = 2*aa*mm / (sigma*(rBL+aa2/rBL) + 2*aa2*mm*sint2) ; // Eq. (126)
109 if (nphi.get_etat() == ETATQCQ) {
110 nphi.set_domain(0) = 0 ;
111 }
112 nphi.std_spectral_base() ;
113
114 // Pointers of derived quantities initialized to zero :
115 set_der_0x0() ;
116 }
117
118 // Copy constructor
119 // --------------------
120 Kerr_QI::Kerr_QI(const Kerr_QI& other) :
121 Compobj_QI(other),
122 mm(other.mm),
123 aa(other.aa)
124 {
125 // Pointers of derived quantities initialized to zero :
126 set_der_0x0() ;
127 }
128
129
130 // Constructor from a file
131 // -----------------------
132 Kerr_QI::Kerr_QI(Map& mpi, FILE* fich) :
133 Compobj_QI(mpi)
134 {
135 // Pointers of derived quantities initialized to zero :
136 set_der_0x0() ;
137
138 // Read of the saved fields:
139 // ------------------------
140
141
142 }
143
144 //------------//
145 // Destructor //
146 //------------//
147
148 Kerr_QI::~Kerr_QI(){
149
150 del_deriv() ;
151
152 }
153
154
155 //----------------------------------//
156 // Management of derived quantities //
157 //----------------------------------//
158
159 void Kerr_QI::del_deriv() const {
160
161 Compobj_QI::del_deriv() ;
162
163
164 Kerr_QI::set_der_0x0() ;
165 }
166
167
168 void Kerr_QI::set_der_0x0() const {
169
170 }
171
172 //--------------//
173 // Assignment //
174 //--------------//
175
176 // Assignment to another Kerr_QI
177 // --------------------------------
178 void Kerr_QI::operator=(const Kerr_QI& other) {
179
180 // Assignment of quantities common to all the derived classes of Compobj_QI
181 Compobj_QI::operator=(other) ;
182
183 mm = other.mm ;
184 aa = other.aa ;
185
186 del_deriv() ; // Deletes all derived quantities
187 }
188
189 //--------------//
190 // Outputs //
191 //--------------//
192
193 // Save in a file
194 // --------------
195 void Kerr_QI::sauve(FILE* fich) const {
196
197
198 }
199
200 // Printing
201 // --------
202
203 ostream& Kerr_QI::operator>>(ostream& ost) const {
204
205 using namespace Unites ;
206
207 Compobj_QI::operator>>(ost) ;
208
209 ost << endl << "Kerr spacetime in quasi-isotropic coordinates (class Kerr_QI) " << endl ;
210
211 ost << "M = " << mm << " a = " << aa << endl ;
212
213 return ost ;
214
215 }
216
217 //-------------------------//
218 // Computational methods //
219 //-------------------------//
220
221 }