| 1 |
/* |
| 2 |
* Copyright (c) 2000-2001 Philippe Grandclement |
| 3 |
* |
| 4 |
* This file is part of LORENE. |
| 5 |
* |
| 6 |
* LORENE is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation; either version 2 of the License, or |
| 9 |
* (at your option) any later version. |
| 10 |
* |
| 11 |
* LORENE is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with LORENE; if not, write to the Free Software |
| 18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
|
| 23 |
char bhole_init_kerr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bhole/bhole_init_kerr.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $" ; |
| 24 |
|
| 25 |
/* |
| 26 |
* $Id: bhole_init_kerr.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $ |
| 27 |
* $Log: bhole_init_kerr.C,v $ |
| 28 |
* Revision 1.4 2014/10/13 08:52:40 j_novak |
| 29 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 30 |
* |
| 31 |
* Revision 1.3 2014/10/06 15:12:58 j_novak |
| 32 |
* Modified #include directives to use c++ syntax. |
| 33 |
* |
| 34 |
* Revision 1.2 2002/10/16 14:36:32 j_novak |
| 35 |
* Reorganization of #include instructions of standard C++, in order to |
| 36 |
* use experimental version 3 of gcc. |
| 37 |
* |
| 38 |
* Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon |
| 39 |
* LORENE |
| 40 |
* |
| 41 |
* Revision 2.1 2000/12/14 10:45:20 phil |
| 42 |
* ATTENTION : PASSAGE DE PHI A PSI |
| 43 |
* |
| 44 |
* Revision 2.0 2000/10/20 09:18:56 phil |
| 45 |
* *** empty log message *** |
| 46 |
* |
| 47 |
* |
| 48 |
* $Header: /cvsroot/Lorene/C++/Source/Bhole/bhole_init_kerr.C,v 1.4 2014/10/13 08:52:40 j_novak Exp $ |
| 49 |
* |
| 50 |
*/ |
| 51 |
|
| 52 |
//standard |
| 53 |
#include <cstdlib> |
| 54 |
#include <cmath> |
| 55 |
|
| 56 |
// Lorene |
| 57 |
#include "tenseur.h" |
| 58 |
#include "bhole.h" |
| 59 |
|
| 60 |
namespace Lorene { |
| 61 |
void Bhole::init_kerr (double masse, double moment) { |
| 62 |
|
| 63 |
// On verifie si le rayon est bien calcule |
| 64 |
assert (rayon == sqrt (masse*masse-moment*moment)/2.) ; |
| 65 |
|
| 66 |
// Valeur de omega : |
| 67 |
omega = moment/2/masse/(masse+sqrt(masse*masse-moment*moment)) ; |
| 68 |
|
| 69 |
// Calcul de R : |
| 70 |
Mtbl grand_r (mp.get_mg()) ; |
| 71 |
grand_r = mp.r + (masse*masse-moment*moment)/4/mp.r + masse ; |
| 72 |
|
| 73 |
// Calcul de sigma : |
| 74 |
Mtbl sigma (mp.get_mg()) ; |
| 75 |
sigma = moment*moment*mp.cost*mp.cost + grand_r*grand_r ; |
| 76 |
|
| 77 |
// Calcul de grand_a : |
| 78 |
Cmp grand_a (mp) ; |
| 79 |
grand_a = 1 + 2*masse/mp.r + |
| 80 |
(3*masse*masse+moment*moment*mp.cost*mp.cost)/2/mp.r/mp.r |
| 81 |
+ (2*masse*rayon*rayon)/pow(mp.r, 3.) + pow(rayon/mp.r, 4.) ; |
| 82 |
grand_a.set_val_inf(1) ; |
| 83 |
grand_a.std_base_scal() ; |
| 84 |
grand_a.raccord(1) ; |
| 85 |
|
| 86 |
// Calcul de n_phi : |
| 87 |
Cmp n_phi(mp) ; |
| 88 |
n_phi = (2*moment*masse*grand_r) / (sigma*(grand_r*grand_r+moment*moment) |
| 89 |
+ 2*moment*moment*masse*grand_r*mp.sint*mp.sint) ; |
| 90 |
n_phi.annule(0) ; |
| 91 |
n_phi.set_val_inf (0) ; |
| 92 |
n_phi.std_base_scal() ; |
| 93 |
|
| 94 |
// Calcul de N : |
| 95 |
Cmp carre (mp) ; |
| 96 |
carre = 1-(2*masse*grand_r)/sigma + (4*moment*moment*masse*masse |
| 97 |
*grand_r*grand_r*mp.sint*mp.sint)/ |
| 98 |
(sigma*sigma*(grand_r*grand_r+moment*moment)+2*moment*moment*sigma*masse* |
| 99 |
grand_r*mp.sint*mp.sint) ; |
| 100 |
carre.set_val_inf(1) ; |
| 101 |
carre.set_val_hor(0, 1) ; |
| 102 |
carre.std_base_scal() ; |
| 103 |
carre.annule(0) ; |
| 104 |
|
| 105 |
n_auto.set_etat_qcq() ; |
| 106 |
n_auto.set() = sqrt(carre) ; |
| 107 |
n_auto.set().set_dzpuis(0) ; |
| 108 |
n_auto.set_std_base() ; |
| 109 |
n_auto.set().raccord(1) ; |
| 110 |
|
| 111 |
// Calcul de psi : |
| 112 |
psi_auto.set_etat_qcq() ; |
| 113 |
psi_auto.set() = pow(grand_a, 0.25) ; |
| 114 |
psi_auto.set().set_dzpuis(0) ; |
| 115 |
psi_auto.set_std_base() ; |
| 116 |
psi_auto.set().raccord(1) ; |
| 117 |
|
| 118 |
// Calcul du shift : |
| 119 |
shift_auto.set_etat_qcq() ; |
| 120 |
shift_auto.set_std_base() ; |
| 121 |
Valeur auxi (mp.get_mg()) ; |
| 122 |
auxi = n_phi.va.mult_st().mult_sp() ; |
| 123 |
shift_auto.set(0) = auxi ; |
| 124 |
auxi = -n_phi.va.mult_st().mult_cp() ; |
| 125 |
shift_auto.set(1) = auxi ; |
| 126 |
shift_auto.set(2).set_etat_zero() ; |
| 127 |
|
| 128 |
shift_auto.inc_dzpuis() ; |
| 129 |
|
| 130 |
for (int i=0 ; i<2 ; i++) { |
| 131 |
shift_auto.set(i).mult_r() ; |
| 132 |
shift_auto.set(i).raccord(1) ; |
| 133 |
assert (shift_auto(i).check_dzpuis (0)) ; |
| 134 |
} |
| 135 |
} |
| 136 |
} |