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 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 ;
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 ;
99  bbb = sqrt(b_car) ;
101 
102  // N
103  nn = (1 - r_hor*r_hor / r2) / bbb ; // Eq. (81) + (10)
104  nn.set_domain(0) = 1 ;
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  }
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 
149 
150  del_deriv() ;
151 
152 }
153 
154 
155  //----------------------------------//
156  // Management of derived quantities //
157  //----------------------------------//
158 
159 void Kerr_QI::del_deriv() const {
160 
162 
163 
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 }
Base class for axisymmetric stationary compact objects in Quasi-Isotropic coordinates (***under devel...
Definition: compobj.h:280
virtual void sauve(FILE *) const
Save in a file.
Definition: kerr_QI.C:195
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:220
Kerr spacetime in Quasi-Isotropic coordinates (***under development***).
Definition: compobj.h:816
Multi-domain array.
Definition: mtbl.h:118
Lorene prototypes.
Definition: app_hor.h:64
Standard units of space, time and mass.
Base class for coordinate mappings.
Definition: map.h:670
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Definition: scalar.C:784
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Definition: scalar.h:554
void operator=(const Kerr_QI &)
Assignment to another Kerr_QI.
Definition: kerr_QI.C:178
Scalar a_car
Square of the metric factor A.
Definition: compobj.h:287
Tbl & set_domain(int l)
Read/write of the value in a given domain.
Definition: scalar.h:615
Scalar nphi
Metric coefficient .
Definition: compobj.h:296
Scalar b_car
Square of the metric factor B.
Definition: compobj.h:293
Coord sint
Definition: map.h:721
Scalar bbb
Metric factor B.
Definition: compobj.h:290
void operator=(const Compobj_QI &)
Assignment to another Compobj_QI.
Definition: compobj_QI.C:195
Active physical coordinates and mapping derivatives.
Definition: coord.h:90
virtual void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Definition: kerr_QI.C:168
Kerr_QI(Map &mp_i, double mass, double a_over_m)
Standard constructor.
Definition: kerr_QI.C:65
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: kerr_QI.C:159
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition: compobj_QI.C:264
Scalar nn
Lapse function N .
Definition: compobj.h:135
double mm
mass parameter
Definition: compobj.h:824
virtual ~Kerr_QI()
Destructor.
Definition: kerr_QI.C:148
virtual ostream & operator>>(ostream &) const
Operator >> (virtual function called by the operator <<).
Definition: kerr_QI.C:203
double aa
angular momentum parameter
Definition: compobj.h:828
virtual void del_deriv() const
Deletes all the derived quantities.
Definition: compobj_QI.C:163
Map & mp
Mapping describing the coordinate system (r,theta,phi)
Definition: compobj.h:132
Coord r
r coordinate centered on the grid
Definition: map.h:718
Coord cost
Definition: map.h:722