Debian Codegraph @

C++/Source/Hole_bhns/hole_bhns_global.C

raw
1 /*
2 * Methods of class Hole_bhns to compute global quantities
3 *
4 * (see file hole_bhns.h for documentation).
5 *
6 */
7
8 /*
9 * Copyright (c) 2005,2007 Keisuke Taniguchi
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 hole_bhns_global_C[] = "$Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_global.C,v 1.5 2014/10/13 08:53:00 j_novak Exp $" ;
29
30 /*
31 * $Id: hole_bhns_global.C,v 1.5 2014/10/13 08:53:00 j_novak Exp $
32 * $Log: hole_bhns_global.C,v $
33 * Revision 1.5 2014/10/13 08:53:00 j_novak
34 * Lorene classes and functions now belong to the namespace Lorene.
35 *
36 * Revision 1.4 2014/10/06 15:13:10 j_novak
37 * Modified #include directives to use c++ syntax.
38 *
39 * Revision 1.3 2008/07/02 21:10:15 k_taniguchi
40 * A bug removed.
41 *
42 * Revision 1.2 2008/05/15 19:07:26 k_taniguchi
43 * Introduction of the quasilocal spin angular momentum.
44 *
45 * Revision 1.1 2007/06/22 01:25:15 k_taniguchi
46 * *** empty log message ***
47 *
48 *
49 * $Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_global.C,v 1.5 2014/10/13 08:53:00 j_novak Exp $
50 *
51 */
52
53 // C++ headers
54 //#include <>
55
56 // C headers
57 #include <cmath>
58
59 // Lorene headers
60 #include "hole_bhns.h"
61 #include "unites.h"
62 #include "utilitaires.h"
63
64 //-----------------------------------------//
65 // Irreducible mass of BH //
66 //-----------------------------------------//
67
68 namespace Lorene {
69 double Hole_bhns::mass_irr_bhns() const {
70
71 // Fundamental constants and units
72 // -------------------------------
73 using namespace Unites ;
74
75 if (p_mass_irr_bhns == 0x0) { // a new computation is required
76
77 Scalar psi4(mp) ;
78 psi4 = pow(confo_tot, 4.) ;
79 psi4.std_spectral_base() ;
80 psi4.annule_domain(0) ;
81 psi4.raccord(1) ;
82
83 double radius_ah = mp.val_r(1,-1.,M_PI/2.,0.) ;
84
85 Map_af& mp_aff= dynamic_cast<Map_af&>(mp) ;
86
87 double a_ah = mp_aff.integrale_surface(psi4, radius_ah) ;
88 double mirr = sqrt(a_ah/16./M_PI) / ggrav ;
89
90 p_mass_irr_bhns = new double( mirr ) ;
91
92 }
93
94 return *p_mass_irr_bhns ;
95
96 }
97
98 //----------------------------------------------------------//
99 // Quasilocal spin angular momentum of BH //
100 //----------------------------------------------------------//
101
102 double Hole_bhns::spin_am_bhns(const Tbl& xi_i, const double& phi_i,
103 const double& theta_i, const int& nrk_phi,
104 const int& nrk_theta) const {
105
106 // Fundamental constants and units
107 // -------------------------------
108 using namespace Unites ;
109
110 if (p_spin_am_bhns == 0x0) { // a new computation is required
111
112 double mass = ggrav * mass_bh ;
113
114 Scalar rr(mp) ;
115 rr = mp.r ;
116 rr.std_spectral_base() ;
117
118 Scalar st(mp) ;
119 st = mp.sint ;
120 st.std_spectral_base() ;
121 Scalar ct(mp) ;
122 ct = mp.cost ;
123 ct.std_spectral_base() ;
124 Scalar sp(mp) ;
125 sp = mp.sinp ;
126 sp.std_spectral_base() ;
127 Scalar cp(mp) ;
128 cp = mp.cosp ;
129 cp.std_spectral_base() ;
130
131 Vector ll(mp, CON, mp.get_bvect_cart()) ;
132 ll.set_etat_qcq() ;
133 ll.set(1) = st % cp ;
134 ll.set(2) = st % sp ;
135 ll.set(3) = ct ;
136 ll.std_spectral_base() ;
137
138 double radius_ah = mp.val_r(1,-1.,M_PI/2.,0.) ;
139
140 if (kerrschild) {
141
142 cout << "Not yet prepared!!!" << endl ;
143 abort() ;
144
145 }
146 else { // Isotropic coordinates
147
148 // Sets C/M^2 for each case of the lapse boundary condition
149 // --------------------------------------------------------
150 double cc ;
151
152 if (bc_lapconf_nd) { // Neumann boundary condition
153 if (bc_lapconf_fs) { // First condition
154 // d(\alpha \psi)/dr = 0
155 // ---------------------
156 cc = 2. * (sqrt(13.) - 1.) / 3. ;
157 }
158 else { // Second condition
159 // d(\alpha \psi)/dr = (\alpha \psi)/(2 rah)
160 // -----------------------------------------
161 cc = 4. / 3. ;
162 }
163 }
164 else { // Dirichlet boundary condition
165 if (bc_lapconf_fs) { // First condition
166 // (\alpha \psi) = 1/2
167 // -------------------
168 cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
169 abort() ;
170 }
171 else { // Second condition
172 // (\alpha \psi) = 1/sqrt(2.) \psi_KS
173 // ----------------------------------
174 cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ;
175 abort() ;
176 // cc = 2. * sqrt(2.) ;
177 }
178 }
179
180 Scalar r_are(mp) ;
181 r_are = r_coord(bc_lapconf_nd, bc_lapconf_fs) ;
182 r_are.std_spectral_base() ;
183
184 // Killing vector of the spherical components
185 Vector killing_spher(mp, COV, mp.get_bvect_spher()) ;
186 killing_spher.set_etat_qcq() ;
187 killing_spher = killing_vect(xi_i, phi_i, theta_i,
188 nrk_phi, nrk_theta) ;
189 killing_spher.std_spectral_base() ;
190
191 killing_spher.set(2) = confo_tot * confo_tot * radius_ah
192 * killing_spher(2) ;
193 killing_spher.set(3) = confo_tot * confo_tot * radius_ah
194 * killing_spher(3) ;
195 // killing_spher(3) is already divided by sin(theta)
196 killing_spher.std_spectral_base() ;
197
198 // Killing vector of the Cartesian components
199 Vector killing(mp, COV, mp.get_bvect_cart()) ;
200 killing.set_etat_qcq() ;
201 killing.set(1) = (killing_spher(2) * ct * cp - killing_spher(3) * sp)
202 / radius_ah ;
203 killing.set(2) = (killing_spher(2) * ct * sp + killing_spher(3) * cp)
204 / radius_ah ;
205 killing.set(3) = - killing_spher(2) * st / radius_ah ;
206 killing.std_spectral_base() ;
207
208 // Surface integral <- dzpuis should be 0
209 // --------------------------------------
210 // Source terms in the surface integral
211 Scalar source_1(mp) ;
212 source_1 = (ll(1) * (taij_tot_rs(1,1) * killing(1)
213 + taij_tot_rs(1,2) * killing(2)
214 + taij_tot_rs(1,3) * killing(3))
215 + ll(2) * (taij_tot_rs(2,1) * killing(1)
216 + taij_tot_rs(2,2) * killing(2)
217 + taij_tot_rs(2,3) * killing(3))
218 + ll(3) * (taij_tot_rs(3,1) * killing(1)
219 + taij_tot_rs(3,2) * killing(2)
220 + taij_tot_rs(3,3) * killing(3)))
221 / pow(confo_tot, 4.) ;
222 source_1.std_spectral_base() ;
223 source_1.dec_dzpuis(2) ; // dzpuis : 2 -> 0
224
225 Scalar source_2(mp) ;
226 source_2 = -2. * pow(confo_tot, 3.) * mass * mass * cc
227 * sqrt(1. - 2.*mass/r_are/rr + cc*cc*pow(mass/r_are/rr,4.))
228 * (ll(1)*killing(1) + ll(2)*killing(2) + ll(3)*killing(3))
229 / lapconf_tot / pow(r_are*rr, 3.) ;
230 source_2.std_spectral_base() ;
231
232 Scalar source_surf(mp) ;
233 source_surf = source_1 + source_2 ;
234 source_surf.std_spectral_base() ;
235 source_surf.annule_domain(0) ;
236 source_surf.raccord(1) ;
237
238 Map_af& mp_aff= dynamic_cast<Map_af&>(mp) ;
239
240 double spin = mp_aff.integrale_surface(source_surf, radius_ah) ;
241 double spin_angmom = 0.5 * spin / qpig ;
242
243 p_spin_am_bhns = new double( spin_angmom ) ;
244
245 }
246
247 }
248
249 return *p_spin_am_bhns ;
250
251 }
252 }