00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 char hole_bhns_rk_phi_C[] = "$Header: /cvsroot/Lorene/C++/Source/Hole_bhns/hole_bhns_rk_phi.C,v 1.2 2008/07/02 20:47:55 k_taniguchi Exp $" ;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #include <math.h>
00050
00051
00052 #include "hole_bhns.h"
00053 #include "unites.h"
00054 #include "utilitaires.h"
00055
00056
00057
00058
00059
00060 Tbl Hole_bhns::runge_kutta_phi(const Tbl& xi_i, const double& phi_i,
00061 const int& nrk_phi) const {
00062
00063 using namespace Unites ;
00064
00065 const Mg3d* mg = mp.get_mg() ;
00066 int np = mg->get_np(1) ;
00067
00068 Tbl xi_f(3) ;
00069 xi_f.set_etat_qcq() ;
00070
00071 if (kerrschild) {
00072
00073 cout << "Not yet prepared!!!" << endl ;
00074 abort() ;
00075
00076 }
00077 else {
00078
00079
00080 double xi_t0 = xi_i(0) ;
00081 double xi_p0 = xi_i(1) ;
00082 double xi_l0 = xi_i(2) ;
00083 double phi0 = phi_i ;
00084
00085 double dp = 2. * M_PI / double(np) / double(nrk_phi) ;
00086
00087 double rah = rad_ah() ;
00088
00089 Scalar dlnconfo(mp) ;
00090 dlnconfo = confo_tot.dsdt() / confo_tot ;
00091 dlnconfo.std_spectral_base() ;
00092
00093 Scalar laplnconfo(mp) ;
00094 laplnconfo = confo_tot.lapang() / confo_tot ;
00095 laplnconfo.std_spectral_base() ;
00096
00097 Scalar confo2(mp) ;
00098 confo2 = confo_tot * confo_tot ;
00099 confo2.std_spectral_base() ;
00100
00101 double xi_t1, xi_t2, xi_t3, xi_t4, xi_tf ;
00102 double xi_p1, xi_p2, xi_p3, xi_p4, xi_pf ;
00103 double xi_l1, xi_l2, xi_l3, xi_l4, xi_lf ;
00104 double f1, f2, f3, f4 ;
00105 double g1, g2, g3, g4 ;
00106 double h1, h2, h3, h4 ;
00107
00108
00109
00110
00111
00112 for (int i=0; i<nrk_phi; i++) {
00113
00114
00115 f1 = - xi_l0 * rah * confo2.val_point(rah, M_PI/2., phi0)
00116 + 2. * xi_p0 * dlnconfo.val_point(rah, M_PI/2., phi0) ;
00117 g1 = -2. * xi_t0 * dlnconfo.val_point(rah, M_PI/2., phi0) ;
00118 h1 = (1. - 2.*laplnconfo.val_point(rah, M_PI/2., phi0)) * xi_t0
00119 / rah / confo2.val_point(rah, M_PI/2., phi0) ;
00120
00121 xi_t1 = dp * f1 ;
00122 xi_p1 = dp * g1 ;
00123 xi_l1 = dp * h1 ;
00124
00125
00126 f2 = - (xi_l0+0.5*xi_l1) * rah
00127 * confo2.val_point(rah, M_PI/2., phi0+0.5*dp)
00128 + 2. * (xi_p0+0.5*xi_p1)
00129 * dlnconfo.val_point(rah, M_PI/2., phi0+0.5*dp) ;
00130 g2 = -2. * (xi_t0+0.5*xi_t1)
00131 * dlnconfo.val_point(rah, M_PI/2., phi0+0.5*dp) ;
00132 h2 = (1. - 2.*laplnconfo.val_point(rah, M_PI/2., phi0+0.5*dp))
00133 * (xi_t0+0.5*xi_t1) / rah
00134 / confo2.val_point(rah, M_PI/2., phi0+0.5*dp) ;
00135
00136 xi_t2 = dp * f2 ;
00137 xi_p2 = dp * g2 ;
00138 xi_l2 = dp * h2 ;
00139
00140
00141 f3 = - (xi_l0+0.5*xi_l2) * rah
00142 * confo2.val_point(rah, M_PI/2., phi0+0.5*dp)
00143 + 2. * (xi_p0+0.5*xi_p2)
00144 * dlnconfo.val_point(rah, M_PI/2., phi0+0.5*dp) ;
00145 g3 = -2. * (xi_t0+0.5*xi_t2)
00146 * dlnconfo.val_point(rah, M_PI/2., phi0+0.5*dp) ;
00147 h3 = (1. - 2.*laplnconfo.val_point(rah, M_PI/2., phi0+0.5*dp))
00148 * (xi_t0+0.5*xi_t2) / rah
00149 / confo2.val_point(rah, M_PI/2., phi0+0.5*dp) ;
00150
00151 xi_t3 = dp * f3 ;
00152 xi_p3 = dp * g3 ;
00153 xi_l3 = dp * h3 ;
00154
00155
00156 f4 = - (xi_l0+xi_l3) * rah * confo2.val_point(rah, M_PI/2., phi0+dp)
00157 + 2. * (xi_p0+xi_p3) * dlnconfo.val_point(rah, M_PI/2., phi0+dp) ;
00158 g4 = -2. * (xi_t0+xi_t3) * dlnconfo.val_point(rah, M_PI/2., phi0+dp) ;
00159 h4 = (1. - 2.*laplnconfo.val_point(rah, M_PI/2., phi0+dp))
00160 * (xi_t0+xi_t3) / rah / confo2.val_point(rah, M_PI/2., phi0+dp) ;
00161
00162 xi_t4 = dp * f4 ;
00163 xi_p4 = dp * g4 ;
00164 xi_l4 = dp * h4 ;
00165
00166
00167
00168 xi_tf = xi_t0 + (xi_t1 + 2.*xi_t2 + 2.*xi_t3 + xi_t4) / 6. ;
00169 xi_pf = xi_p0 + (xi_p1 + 2.*xi_p2 + 2.*xi_p3 + xi_p4) / 6. ;
00170 xi_lf = xi_l0 + (xi_l1 + 2.*xi_l2 + 2.*xi_l3 + xi_l4) / 6. ;
00171
00172
00173
00174
00175 xi_t0 = xi_tf ;
00176 xi_p0 = xi_pf ;
00177 xi_l0 = xi_lf ;
00178
00179 }
00180
00181 xi_f.set(0) = xi_tf ;
00182 xi_f.set(1) = xi_pf ;
00183 xi_f.set(2) = xi_lf ;
00184
00185 }
00186
00187 return xi_f ;
00188
00189 }