| 1 |
/* |
| 2 |
* Method of class Hole_bhns to compute metric quantities from |
| 3 |
* the companion neutron-star and total metric quantities |
| 4 |
* |
| 5 |
* (see file hole_bhns.h for documentation). |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
/* |
| 10 |
* Copyright (c) 2005-2007 Keisuke Taniguchi |
| 11 |
* |
| 12 |
* This file is part of LORENE. |
| 13 |
* |
| 14 |
* LORENE is free software; you can redistribute it and/or modify |
| 15 |
* it under the terms of the GNU General Public License version 2 |
| 16 |
* as published by the Free Software Foundation. |
| 17 |
* |
| 18 |
* LORENE is distributed in the hope that it will be useful, |
| 19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 |
* GNU General Public License for more details. |
| 22 |
* |
| 23 |
* You should have received a copy of the GNU General Public License |
| 24 |
* along with LORENE; if not, write to the Free Software |
| 25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 26 |
* |
| 27 |
*/ |
| 28 |
|
| 29 |
char hole_bhns_upmetr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_upmetr.C,v 1.3 2014/10/13 08:53:00 j_novak Exp $" ; |
| 30 |
|
| 31 |
/* |
| 32 |
* $Id: hole_bhns_upmetr.C,v 1.3 2014/10/13 08:53:00 j_novak Exp $ |
| 33 |
* $Log: hole_bhns_upmetr.C,v $ |
| 34 |
* Revision 1.3 2014/10/13 08:53:00 j_novak |
| 35 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 36 |
* |
| 37 |
* Revision 1.2 2008/05/15 19:08:15 k_taniguchi |
| 38 |
* Change of some parameters. |
| 39 |
* |
| 40 |
* Revision 1.1 2007/06/22 01:25:31 k_taniguchi |
| 41 |
* *** empty log message *** |
| 42 |
* |
| 43 |
* |
| 44 |
* $Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_upmetr.C,v 1.3 2014/10/13 08:53:00 j_novak Exp $ |
| 45 |
* |
| 46 |
*/ |
| 47 |
|
| 48 |
// C++ headers |
| 49 |
//#include <> |
| 50 |
|
| 51 |
// C headers |
| 52 |
//#include <> |
| 53 |
|
| 54 |
// Lorene headers |
| 55 |
#include "hole_bhns.h" |
| 56 |
#include "star_bhns.h" |
| 57 |
#include "utilitaires.h" |
| 58 |
#include "unites.h" |
| 59 |
|
| 60 |
namespace Lorene { |
| 61 |
void Hole_bhns::update_metric_bhns(const Star_bhns& star, |
| 62 |
const Hole_bhns& hole_prev, |
| 63 |
double relax) { |
| 64 |
|
| 65 |
// Fundamental constants and units |
| 66 |
// ------------------------------- |
| 67 |
using namespace Unites ; |
| 68 |
|
| 69 |
//----------------------------------------------------- |
| 70 |
// Computation of quantities coming from the companion |
| 71 |
//----------------------------------------------------- |
| 72 |
|
| 73 |
const Map& mp_ns (star.get_mp()) ; |
| 74 |
|
| 75 |
double mass = ggrav * mass_bh ; |
| 76 |
|
| 77 |
// Lapconf function |
| 78 |
// ---------------- |
| 79 |
|
| 80 |
if ( (star.get_lapconf_auto()).get_etat() == ETATZERO ) { |
| 81 |
lapconf_comp.set_etat_zero() ; |
| 82 |
} |
| 83 |
else { |
| 84 |
lapconf_comp.set_etat_qcq() ; |
| 85 |
lapconf_comp.import( star.get_lapconf_auto() ) ; |
| 86 |
lapconf_comp.std_spectral_base() ; |
| 87 |
} |
| 88 |
|
| 89 |
// Shift vector |
| 90 |
// ------------ |
| 91 |
|
| 92 |
if ( (star.get_shift_auto())(2).get_etat() == ETATZERO ) { |
| 93 |
assert( (star.get_shift_auto())(1).get_etat() == ETATZERO ) ; |
| 94 |
assert( (star.get_shift_auto())(3).get_etat() == ETATZERO ) ; |
| 95 |
|
| 96 |
shift_comp.set_etat_zero() ; |
| 97 |
} |
| 98 |
else { |
| 99 |
shift_comp.set_etat_qcq() ; |
| 100 |
shift_comp.set_triad(mp.get_bvect_cart()) ; |
| 101 |
|
| 102 |
Vector comp_shift(star.get_shift_auto()) ; |
| 103 |
comp_shift.change_triad(mp_ns.get_bvect_cart()) ; |
| 104 |
comp_shift.change_triad(mp.get_bvect_cart()) ; |
| 105 |
|
| 106 |
assert( *(shift_comp.get_triad()) == *(comp_shift.get_triad()) ) ; |
| 107 |
|
| 108 |
(shift_comp.set(1)).import( comp_shift(1) ) ; |
| 109 |
(shift_comp.set(2)).import( comp_shift(2) ) ; |
| 110 |
(shift_comp.set(3)).import( comp_shift(3) ) ; |
| 111 |
|
| 112 |
shift_comp.std_spectral_base() ; |
| 113 |
} |
| 114 |
|
| 115 |
// Conformal factor |
| 116 |
// ---------------- |
| 117 |
|
| 118 |
if ( (star.get_confo_auto()).get_etat() == ETATZERO ) { |
| 119 |
confo_comp.set_etat_zero() ; |
| 120 |
} |
| 121 |
else { |
| 122 |
confo_comp.set_etat_qcq() ; |
| 123 |
confo_comp.import( star.get_confo_auto() ) ; |
| 124 |
confo_comp.std_spectral_base() ; |
| 125 |
} |
| 126 |
|
| 127 |
//---------------------------------------------------- |
| 128 |
// Relaxation on lapconf_comp, shift_comp, confo_comp |
| 129 |
//---------------------------------------------------- |
| 130 |
|
| 131 |
double relax_jm1 = 1. - relax ; |
| 132 |
|
| 133 |
lapconf_comp = relax * lapconf_comp |
| 134 |
+ relax_jm1 * (hole_prev.lapconf_comp) ; |
| 135 |
|
| 136 |
shift_comp = relax * shift_comp + relax_jm1 * (hole_prev.shift_comp) ; |
| 137 |
|
| 138 |
confo_comp = relax * confo_comp + relax_jm1 * (hole_prev.confo_comp) ; |
| 139 |
|
| 140 |
|
| 141 |
// Coordinates |
| 142 |
// ----------- |
| 143 |
Scalar rr(mp) ; |
| 144 |
rr = mp.r ; |
| 145 |
rr.std_spectral_base() ; |
| 146 |
Scalar st(mp) ; |
| 147 |
st = mp.sint ; |
| 148 |
st.std_spectral_base() ; |
| 149 |
Scalar ct(mp) ; |
| 150 |
ct = mp.cost ; |
| 151 |
ct.std_spectral_base() ; |
| 152 |
Scalar sp(mp) ; |
| 153 |
sp = mp.sinp ; |
| 154 |
sp.std_spectral_base() ; |
| 155 |
Scalar cp(mp) ; |
| 156 |
cp = mp.cosp ; |
| 157 |
cp.std_spectral_base() ; |
| 158 |
|
| 159 |
Vector ll(mp, CON, mp.get_bvect_cart()) ; |
| 160 |
ll.set_etat_qcq() ; |
| 161 |
ll.set(1) = st % cp ; |
| 162 |
ll.set(2) = st % sp ; |
| 163 |
ll.set(3) = ct ; |
| 164 |
ll.std_spectral_base() ; |
| 165 |
|
| 166 |
|
| 167 |
if (kerrschild) { |
| 168 |
|
| 169 |
//---------------------------------------------- |
| 170 |
// Metric quantities from the analytic solution |
| 171 |
//---------------------------------------------- |
| 172 |
|
| 173 |
lapconf_auto_bh = 1. / sqrt(1.+2.*mass/rr) ; |
| 174 |
lapconf_auto_bh.std_spectral_base() ; |
| 175 |
lapconf_auto_bh.annule_domain(0) ; |
| 176 |
lapconf_auto_bh.raccord(1) ; |
| 177 |
|
| 178 |
confo_auto_bh = 1. ; |
| 179 |
confo_auto_bh.std_spectral_base() ; |
| 180 |
|
| 181 |
shift_auto_bh = 2. * lapconf_auto_bh*lapconf_auto_bh*mass * ll / rr ; |
| 182 |
shift_auto_bh.std_spectral_base() ; |
| 183 |
shift_auto_bh.annule_domain(0) ; |
| 184 |
|
| 185 |
//--------------------------------- |
| 186 |
// Derivative of metric quantities |
| 187 |
//--------------------------------- |
| 188 |
|
| 189 |
d_lapconf_auto_rs.set_etat_qcq() ; |
| 190 |
for (int i=1; i<=3; i++) |
| 191 |
d_lapconf_auto_rs.set(i) = lapconf_auto_rs.deriv(i) ; |
| 192 |
|
| 193 |
d_lapconf_auto_rs.std_spectral_base() ; |
| 194 |
|
| 195 |
d_lapconf_auto_bh.set_etat_qcq() ; |
| 196 |
for (int i=1; i<=3; i++) { |
| 197 |
d_lapconf_auto_bh.set(i) = pow(lapconf_auto_bh,3.) * mass * ll(i) |
| 198 |
/ rr / rr ; |
| 199 |
} |
| 200 |
d_lapconf_auto_bh.std_spectral_base() ; |
| 201 |
d_lapconf_auto_bh.annule_domain(0) ; |
| 202 |
d_lapconf_auto_bh.inc_dzpuis(2) ; |
| 203 |
|
| 204 |
d_lapconf_auto = d_lapconf_auto_rs + d_lapconf_auto_bh ; |
| 205 |
d_lapconf_auto.std_spectral_base() ; |
| 206 |
|
| 207 |
d_shift_auto_rs.set_etat_qcq() ; |
| 208 |
for (int i=1; i<=3; i++) { |
| 209 |
for (int j=1; j<=3; j++) { |
| 210 |
d_shift_auto_rs.set(i,j) = shift_auto_rs(j).deriv(i) ; |
| 211 |
} |
| 212 |
} |
| 213 |
|
| 214 |
d_shift_auto_rs.std_spectral_base() ; |
| 215 |
|
| 216 |
d_shift_auto_bh.set_etat_qcq() ; |
| 217 |
for (int i=1; i<=3; i++) { |
| 218 |
for (int j=1; j<=3; j++) { |
| 219 |
d_shift_auto_bh.set(i,j) = 2.*lapconf_auto_bh |
| 220 |
*lapconf_auto_bh*mass |
| 221 |
* (flat.con()(i,j) |
| 222 |
- 2.*lapconf_auto_bh*lapconf_auto_bh*(1.+mass/rr) |
| 223 |
* ll(i) * ll(j)) |
| 224 |
/ rr / rr ; |
| 225 |
} |
| 226 |
} |
| 227 |
d_shift_auto_bh.std_spectral_base() ; |
| 228 |
d_shift_auto_bh.annule_domain(0) ; |
| 229 |
d_shift_auto_bh.inc_dzpuis(2) ; |
| 230 |
|
| 231 |
d_shift_auto = d_shift_auto_rs + d_shift_auto_bh ; |
| 232 |
d_shift_auto.std_spectral_base() ; |
| 233 |
|
| 234 |
d_confo_auto_rs.set_etat_qcq() ; |
| 235 |
for (int i=1; i<=3; i++) |
| 236 |
d_confo_auto_rs.set(i) = confo_auto_rs.deriv(i) ; |
| 237 |
|
| 238 |
d_confo_auto_rs.std_spectral_base() ; |
| 239 |
|
| 240 |
d_confo_auto_bh.set_etat_qcq() ; |
| 241 |
for (int i=1; i<=3; i++) |
| 242 |
d_confo_auto_bh.set(i) = 0. ; |
| 243 |
|
| 244 |
d_confo_auto_bh.std_spectral_base() ; |
| 245 |
|
| 246 |
d_confo_auto = d_confo_auto_rs + d_confo_auto_bh ; |
| 247 |
d_confo_auto.std_spectral_base() ; |
| 248 |
|
| 249 |
} |
| 250 |
else { // Isotropic coordinates with the maximal slicing |
| 251 |
|
| 252 |
// Sets C/M^2 for each case of the lapse boundary condition |
| 253 |
// -------------------------------------------------------- |
| 254 |
double cc ; |
| 255 |
|
| 256 |
if (bc_lapconf_nd) { // Neumann boundary condition |
| 257 |
if (bc_lapconf_fs) { // First condition |
| 258 |
// d(\alpha \psi)/dr = 0 |
| 259 |
// --------------------- |
| 260 |
cc = 2. * (sqrt(13.) - 1.) / 3. ; |
| 261 |
} |
| 262 |
else { // Second condition |
| 263 |
// d(\alpha \psi)/dr = (\alpha \psi)/(2 rah) |
| 264 |
// ----------------------------------------- |
| 265 |
cc = 4. / 3. ; |
| 266 |
} |
| 267 |
} |
| 268 |
else { // Dirichlet boundary condition |
| 269 |
if (bc_lapconf_fs) { // First condition |
| 270 |
// (\alpha \psi) = 1/2 |
| 271 |
// ------------------- |
| 272 |
cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ; |
| 273 |
abort() ; |
| 274 |
} |
| 275 |
else { // Second condition |
| 276 |
// (\alpha \psi) = 1/sqrt(2.) \psi_KS |
| 277 |
// ----------------------------------- |
| 278 |
cout << "!!!!! WARNING: Not yet prepared !!!!!" << endl ; |
| 279 |
abort() ; |
| 280 |
// cc = 2. * sqrt(2.) ; |
| 281 |
} |
| 282 |
} |
| 283 |
|
| 284 |
//---------------------------------------------- |
| 285 |
// Metric quantities from the analytic solution |
| 286 |
//---------------------------------------------- |
| 287 |
|
| 288 |
Scalar r_are(mp) ; |
| 289 |
r_are = r_coord(bc_lapconf_nd, bc_lapconf_fs) ; |
| 290 |
r_are.std_spectral_base() ; |
| 291 |
|
| 292 |
lapconf_auto_bh = sqrt(1. - 2.*mass/r_are/rr |
| 293 |
+ cc*cc*pow(mass/r_are/rr, 4.)) * sqrt(r_are) ; |
| 294 |
lapconf_auto_bh.std_spectral_base() ; |
| 295 |
lapconf_auto_bh.annule_domain(0) ; |
| 296 |
lapconf_auto_bh.raccord(1) ; |
| 297 |
|
| 298 |
confo_auto_bh = sqrt(r_are) ; |
| 299 |
confo_auto_bh.std_spectral_base() ; |
| 300 |
confo_auto_bh.annule_domain(0) ; |
| 301 |
confo_auto_bh.raccord(1) ; |
| 302 |
|
| 303 |
shift_auto_bh = mass * mass * cc * ll / rr / rr / pow(r_are, 3.) ; |
| 304 |
shift_auto_bh.std_spectral_base() ; |
| 305 |
shift_auto_bh.annule_domain(0) ; |
| 306 |
for (int i=1; i<=3; i++) |
| 307 |
shift_auto_bh.set(i).raccord(1) ; |
| 308 |
|
| 309 |
//--------------------------------- |
| 310 |
// Derivative of metric quantities |
| 311 |
//--------------------------------- |
| 312 |
|
| 313 |
d_lapconf_auto_rs.set_etat_qcq() ; |
| 314 |
for (int i=1; i<=3; i++) |
| 315 |
d_lapconf_auto_rs.set(i) = lapconf_auto_rs.deriv(i) ; |
| 316 |
|
| 317 |
d_lapconf_auto_rs.std_spectral_base() ; |
| 318 |
|
| 319 |
d_lapconf_auto_bh.set_etat_qcq() ; |
| 320 |
for (int i=1; i<=3; i++) { |
| 321 |
d_lapconf_auto_bh.set(i) = sqrt(r_are) |
| 322 |
* (mass/r_are/rr - 2.*cc*cc*pow(mass/r_are/rr,4.)) |
| 323 |
* ll(i) / rr |
| 324 |
+ 0.5 * sqrt(r_are) |
| 325 |
* (sqrt(1. - 2.*mass/r_are/rr + cc*cc*pow(mass/r_are/rr,4.))-1.) |
| 326 |
* sqrt(1. - 2.*mass/r_are/rr + cc*cc*pow(mass/r_are/rr,4.)) |
| 327 |
* ll(i) / rr ; |
| 328 |
} |
| 329 |
d_lapconf_auto_bh.std_spectral_base() ; |
| 330 |
d_lapconf_auto_bh.annule_domain(0) ; |
| 331 |
d_lapconf_auto_bh.inc_dzpuis(2) ; |
| 332 |
|
| 333 |
d_lapconf_auto = d_lapconf_auto_rs + d_lapconf_auto_bh ; |
| 334 |
d_lapconf_auto.std_spectral_base() ; |
| 335 |
d_lapconf_auto.annule_domain(0) ; |
| 336 |
for (int i=1; i<=3; i++) |
| 337 |
d_lapconf_auto.set(i).raccord(1) ; |
| 338 |
|
| 339 |
d_shift_auto_rs.set_etat_qcq() ; |
| 340 |
for (int i=1; i<=3; i++) { |
| 341 |
for (int j=1; j<=3; j++) { |
| 342 |
d_shift_auto_rs.set(i,j) = shift_auto_rs(j).deriv(i) ; |
| 343 |
} |
| 344 |
} |
| 345 |
|
| 346 |
d_shift_auto_rs.std_spectral_base() ; |
| 347 |
|
| 348 |
d_shift_auto_bh.set_etat_qcq() ; |
| 349 |
for (int i=1; i<=3; i++) { |
| 350 |
for (int j=1; j<=3; j++) { |
| 351 |
d_shift_auto_bh.set(i,j) = |
| 352 |
mass*mass*cc*(flat.con()(i,j) |
| 353 |
-3.*sqrt(1. - 2.*mass/r_are/rr |
| 354 |
+cc*cc*pow(mass/r_are/rr,4.)) |
| 355 |
*ll(i)*ll(j)) |
| 356 |
/ pow(r_are*rr,3.) ; |
| 357 |
} |
| 358 |
} |
| 359 |
d_shift_auto_bh.std_spectral_base() ; |
| 360 |
d_shift_auto_bh.annule_domain(0) ; |
| 361 |
d_shift_auto_bh.inc_dzpuis(2) ; |
| 362 |
|
| 363 |
d_shift_auto = d_shift_auto_rs + d_shift_auto_bh ; |
| 364 |
d_shift_auto.std_spectral_base() ; |
| 365 |
d_shift_auto.annule_domain(0) ; |
| 366 |
for (int i=1; i<=3; i++) { |
| 367 |
for (int j=1; j<=3; j++) { |
| 368 |
d_shift_auto.set(i,j).raccord(1) ; |
| 369 |
} |
| 370 |
} |
| 371 |
|
| 372 |
d_confo_auto_rs.set_etat_qcq() ; |
| 373 |
for (int i=1; i<=3; i++) |
| 374 |
d_confo_auto_rs.set(i) = confo_auto_rs.deriv(i) ; |
| 375 |
|
| 376 |
d_confo_auto_rs.std_spectral_base() ; |
| 377 |
|
| 378 |
d_confo_auto_bh.set_etat_qcq() ; |
| 379 |
for (int i=1; i<=3; i++) { |
| 380 |
d_confo_auto_bh.set(i) = 0.5*sqrt(r_are) |
| 381 |
*(sqrt(1. - 2.*mass/r_are/rr +cc*cc*pow(mass/r_are/rr,4.)) - 1.) |
| 382 |
* ll(i) / rr ; |
| 383 |
} |
| 384 |
d_confo_auto_bh.std_spectral_base() ; |
| 385 |
d_confo_auto_bh.annule_domain(0) ; |
| 386 |
d_confo_auto_bh.inc_dzpuis(2) ; |
| 387 |
|
| 388 |
d_confo_auto = d_confo_auto_rs + d_confo_auto_bh ; |
| 389 |
d_confo_auto.std_spectral_base() ; |
| 390 |
d_confo_auto.annule_domain(0) ; |
| 391 |
for (int i=1; i<=3; i++) |
| 392 |
d_confo_auto.set(i).raccord(1) ; |
| 393 |
|
| 394 |
} |
| 395 |
|
| 396 |
//------------------------- |
| 397 |
// Total metric quantities |
| 398 |
//------------------------- |
| 399 |
|
| 400 |
lapconf_auto = lapconf_auto_rs + lapconf_auto_bh ; |
| 401 |
lapconf_auto.std_spectral_base() ; |
| 402 |
lapconf_auto.annule_domain(0) ; |
| 403 |
lapconf_auto.raccord(1) ; |
| 404 |
|
| 405 |
lapconf_tot = lapconf_auto_rs + lapconf_auto_bh + lapconf_comp ; |
| 406 |
lapconf_tot.std_spectral_base() ; |
| 407 |
lapconf_tot.annule_domain(0) ; |
| 408 |
lapconf_tot.raccord(1) ; |
| 409 |
|
| 410 |
shift_auto = shift_auto_rs + shift_auto_bh ; |
| 411 |
shift_auto.std_spectral_base() ; |
| 412 |
shift_auto.annule_domain(0) ; |
| 413 |
for (int i=1; i<=3; i++) { |
| 414 |
shift_auto.set(i).raccord(1) ; |
| 415 |
} |
| 416 |
|
| 417 |
shift_tot = shift_auto_rs + shift_auto_bh + shift_comp ; |
| 418 |
shift_tot.std_spectral_base() ; |
| 419 |
shift_tot.annule_domain(0) ; |
| 420 |
for (int i=1; i<=3; i++) { |
| 421 |
shift_tot.set(i).raccord(1) ; |
| 422 |
} |
| 423 |
|
| 424 |
confo_auto = confo_auto_rs + confo_auto_bh ; |
| 425 |
confo_auto.std_spectral_base() ; |
| 426 |
confo_auto.annule_domain(0) ; |
| 427 |
confo_auto.raccord(1) ; |
| 428 |
|
| 429 |
confo_tot = confo_auto_rs + confo_auto_bh + confo_comp ; |
| 430 |
confo_tot.std_spectral_base() ; |
| 431 |
confo_tot.annule_domain(0) ; |
| 432 |
confo_tot.raccord(1) ; |
| 433 |
|
| 434 |
lapse_auto = lapconf_auto / confo_tot ; |
| 435 |
lapse_auto.std_spectral_base() ; |
| 436 |
|
| 437 |
lapse_tot = lapconf_tot / confo_tot ; |
| 438 |
lapse_tot.std_spectral_base() ; |
| 439 |
|
| 440 |
// The derived quantities are obsolete |
| 441 |
// ----------------------------------- |
| 442 |
|
| 443 |
del_deriv() ; |
| 444 |
|
| 445 |
} |
| 446 |
} |