| 1 |
/* |
| 2 |
* Reads a black hole with an isolated horizon configuration |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
/* |
| 7 |
* Copyright (c) 2005 Francois Limousin |
| 8 |
* Jose Luis Jaramillo |
| 9 |
* |
| 10 |
* This file is part of LORENE. |
| 11 |
* |
| 12 |
* LORENE is free software; you can redistribute it and/or modify |
| 13 |
* it under the terms of the GNU General Public License version 2 |
| 14 |
* as published by the Free Software Foundation. |
| 15 |
* |
| 16 |
* LORENE is distributed in the hope that it will be useful, |
| 17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 |
* GNU General Public License for more details. |
| 20 |
* |
| 21 |
* You should have received a copy of the GNU General Public License |
| 22 |
* along with LORENE; if not, write to the Free Software |
| 23 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 |
* |
| 25 |
*/ |
| 26 |
|
| 27 |
char lit_ih_C[] = "$Header: /cvsroot/Lorene/Codes/Isol_hor/lit_ih.C,v 1.6 2014/10/13 08:53:57 j_novak Exp $" ; |
| 28 |
|
| 29 |
/* |
| 30 |
* $Id: lit_ih.C,v 1.6 2014/10/13 08:53:57 j_novak Exp $ |
| 31 |
* $Log: lit_ih.C,v $ |
| 32 |
* Revision 1.6 2014/10/13 08:53:57 j_novak |
| 33 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 34 |
* |
| 35 |
* Revision 1.5 2014/10/06 15:09:45 j_novak |
| 36 |
* Modified #include directives to use c++ syntax. |
| 37 |
* |
| 38 |
* Revision 1.4 2005/09/12 12:34:09 f_limousin |
| 39 |
* Compilation Warning - Change of convention for the angular velocity |
| 40 |
* Add Berlin boundary condition in the case of binary horizons. |
| 41 |
* |
| 42 |
* Revision 1.3 2005/03/09 10:35:28 f_limousin |
| 43 |
* Drawing of K_{ij}s^is^j and new initialisation of A^{ij} thanks to |
| 44 |
* the function update_aa(). |
| 45 |
* |
| 46 |
* Revision 1.2 2005/03/04 18:24:09 jl_jaramillo |
| 47 |
* Extrinsic curvature graphical output. |
| 48 |
* |
| 49 |
* Revision 1.1 2005/03/03 10:19:47 f_limousin |
| 50 |
* First version |
| 51 |
* |
| 52 |
* |
| 53 |
* $Header: /cvsroot/Lorene/Codes/Isol_hor/lit_ih.C,v 1.6 2014/10/13 08:53:57 j_novak Exp $ |
| 54 |
* |
| 55 |
*/ |
| 56 |
|
| 57 |
//standard |
| 58 |
#include <cstdlib> |
| 59 |
#include <cmath> |
| 60 |
|
| 61 |
// LORENE |
| 62 |
#include "type_parite.h" |
| 63 |
#include "nbr_spx.h" |
| 64 |
#include "proto.h" |
| 65 |
#include "param.h" |
| 66 |
#include "coord.h" |
| 67 |
#include "scalar.h" |
| 68 |
#include "cmp.h" |
| 69 |
#include "tensor.h" |
| 70 |
#include "tenseur.h" |
| 71 |
#include "isol_hor.h" |
| 72 |
#include "graphique.h" |
| 73 |
#include "utilitaires.h" |
| 74 |
#include "unites.h" |
| 75 |
|
| 76 |
|
| 77 |
using namespace Lorene ; |
| 78 |
|
| 79 |
int main(int argc, char** argv) { |
| 80 |
|
| 81 |
using namespace Unites ; |
| 82 |
|
| 83 |
if (argc <2) { |
| 84 |
cout <<" Passer nom du ficher en arguments SVP !" << endl ; |
| 85 |
abort() ; |
| 86 |
} |
| 87 |
|
| 88 |
char* name_fich = argv[1] ; |
| 89 |
|
| 90 |
FILE* fich = fopen(name_fich, "r") ; |
| 91 |
Mg3d grid (fich) ; |
| 92 |
Map_af mp (grid, fich) ; |
| 93 |
Isol_hor isolhor (mp, fich, true) ; |
| 94 |
fclose(fich) ; |
| 95 |
|
| 96 |
isolhor.update_aa() ; |
| 97 |
|
| 98 |
// PLOTS |
| 99 |
// ------- |
| 100 |
|
| 101 |
// Graphic output of the different fields |
| 102 |
//--------------------------------------- |
| 103 |
|
| 104 |
Vector beta (isolhor.beta()) ; |
| 105 |
Scalar bb (contract(beta, 0, isolhor.tgam().radial_vect() |
| 106 |
.down(0, isolhor.tgam()), 0) |
| 107 |
*isolhor.psi()*isolhor.psi()) ; |
| 108 |
|
| 109 |
des_meridian(isolhor.nn(), 1.00001, 10, "nn", 0) ; |
| 110 |
arrete() ; |
| 111 |
des_profile(isolhor.psi(), 1.00001, 10, 1., 1., "psi") ; |
| 112 |
des_profile(bb, 1.00001, 10, M_PI/2., 0., "b in Pi/2, 0") ; |
| 113 |
des_profile(bb, 1.00001, 10, M_PI/2., M_PI, "b in Pi/2, Pi") ; |
| 114 |
des_profile(isolhor.beta()(3), 1.00001, 10, |
| 115 |
M_PI/2., 0., "beta_phi en pi/2") ; |
| 116 |
|
| 117 |
// Definition of the surface |
| 118 |
|
| 119 |
Cmp surface (mp) ; |
| 120 |
surface = pow(mp.r, 2.)-pow(isolhor.get_radius(), 2.) ; |
| 121 |
surface.annule(grid.get_nzone()-1) ; |
| 122 |
surface.std_base_scal() ; |
| 123 |
|
| 124 |
// Shift |
| 125 |
|
| 126 |
Tenseur shift (mp, 1, CON, mp.get_bvect_cart()) ; |
| 127 |
shift.set_etat_qcq() ; |
| 128 |
beta.change_triad(mp.get_bvect_cart()) ; |
| 129 |
Cmp shift_x (beta(1)) ; |
| 130 |
Cmp shift_y (beta(2)) ; |
| 131 |
Cmp shift_z (beta(3)) ; |
| 132 |
shift.set(0) = shift_x ; |
| 133 |
shift.set(1) = shift_y ; |
| 134 |
shift.set(2) = shift_z ; |
| 135 |
|
| 136 |
des_coupe_vect_z(shift, 0, -1, 0.7, 3, "shift", &surface) ; |
| 137 |
des_coupe_vect_x(shift, 0, -1, 0.7, 3, "shift", &surface) ; |
| 138 |
|
| 139 |
Vector beta_rad (mp, CON, mp.get_bvect_spher()) ; |
| 140 |
beta_rad = isolhor.b_tilde() * isolhor.tgam().radial_vect() ; |
| 141 |
beta_rad.change_triad(mp.get_bvect_cart()) ; |
| 142 |
shift_x = beta_rad(1) ; |
| 143 |
shift_y = beta_rad(2) ; |
| 144 |
shift_z = beta_rad(3) ; |
| 145 |
shift.set(0) = shift_x ; |
| 146 |
shift.set(1) = shift_y ; |
| 147 |
shift.set(2) = shift_z ; |
| 148 |
|
| 149 |
des_coupe_vect_z(shift, 0, -1, 0.7, 3, "radial shift ", &surface) ; |
| 150 |
des_coupe_vect_x(shift, 0, -1, 0.7, 3, "radial shift", &surface) ; |
| 151 |
|
| 152 |
Vector beta_ang (mp, CON, mp.get_bvect_spher()) ; |
| 153 |
beta_ang = beta - beta_rad ; |
| 154 |
beta_ang.change_triad(mp.get_bvect_cart()) ; |
| 155 |
shift_x = beta_ang(1) ; |
| 156 |
shift_y = beta_ang(2) ; |
| 157 |
shift_z = beta_ang(3) ; |
| 158 |
shift.set(0) = shift_x ; |
| 159 |
shift.set(1) = shift_y ; |
| 160 |
shift.set(2) = shift_z ; |
| 161 |
|
| 162 |
des_coupe_vect_z(shift, 0, -1, 0.7, 3, "shift angular", &surface) ; |
| 163 |
des_coupe_vect_x(shift, 0, -1, 0.7, 3, "shift angular", &surface) ; |
| 164 |
|
| 165 |
// \gamma^{rr} and \gamma^{rp} |
| 166 |
|
| 167 |
Cmp gam_rr (isolhor.gam_uu()(1,1)) ; |
| 168 |
Cmp gam_rp (isolhor.gam_uu()(3,1)) ; |
| 169 |
|
| 170 |
des_coupe_z(gam_rr, 0, -5, 5, -5, 5, "gam_rr", &surface) ; |
| 171 |
des_coupe_x(gam_rr, 0, -5, 5, -5, 5, "gam_rr", &surface) ; |
| 172 |
des_coupe_z(gam_rp, 0, -5, 5, -5, 5, "gam_rp", &surface) ; |
| 173 |
des_coupe_x(gam_rp, 0, -5, 5, -5, 5, "gam_rp", &surface) ; |
| 174 |
|
| 175 |
// K^{rr}, K^{rt} and K^{rp} |
| 176 |
|
| 177 |
Vector pp(contract(isolhor.k_dd(), 0,isolhor.tgam().radial_vect() , 0)/isolhor.psi()/isolhor.psi()) ; |
| 178 |
Cmp ksp (pp(3)) ; |
| 179 |
des_coupe_z(ksp, 0, -5, 5, -5, 5, "K^sp", &surface) ; |
| 180 |
|
| 181 |
pp.change_triad(mp.get_bvect_cart()) ; |
| 182 |
Cmp ksx (pp(1)) ; |
| 183 |
Cmp ksy (pp(2)) ; |
| 184 |
Cmp ksz (pp(3)) ; |
| 185 |
|
| 186 |
des_coupe_z(ksx, 0, -5, 5, -5, 5, "K^sx", &surface) ; |
| 187 |
des_coupe_z(ksy, 0, -5, 5, -5, 5, "K^sy", &surface) ; |
| 188 |
des_coupe_z(ksz, 0, -5, 5, -5, 5, "K^sz", &surface) ; |
| 189 |
|
| 190 |
// Lapse |
| 191 |
|
| 192 |
Cmp lapse (isolhor.nn()) ; |
| 193 |
des_coupe_z(lapse, 0, -5, 5, -5, 5, "lapse", &surface) ; |
| 194 |
des_coupe_x(lapse, 0, -5, 5, -5, 5, "lapse", &surface) ; |
| 195 |
|
| 196 |
// Psi |
| 197 |
|
| 198 |
Cmp psi (isolhor.psi()) ; |
| 199 |
des_coupe_z(psi, 0, -5, 5, -5, 5, "psi", &surface) ; |
| 200 |
des_coupe_x(psi, 0, -5, 5, -5, 5, "psi", &surface) ; |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
return 1 ; |
| 206 |
} |