Warp.hpp

00001 
00002 //
00003 // $Id: Warp.hpp,v 1.1 2004/08/12 16:21:33 werner Exp $
00004 //
00005 // $Log: Warp.hpp,v $
00006 // Revision 1.1  2004/08/12 16:21:33  werner
00007 // Integration of numerical geodesics now compiles. Working is not yet satisfying.
00008 //
00009 // Revision 1.2  2004/05/05 15:56:52  werner
00010 // Separation of DOP core routines with dynamic size into the ODE library.
00011 //
00012 // Revision 1.1  2004/03/22 11:55:02  werner
00013 // Schwarzschild geodesic integration.
00014 //
00015 // Revision 1.1  2004/02/13 16:36:21  werner
00016 // Initial preliminiary version of the Vector Algebra Library.
00017 //
00019 #ifndef __Kerr_HPP
00020 #define __Kerr_HPP "Created 27.02.2001 21:42:27 by werner"
00021 
00022 #include <vecal/Christoffel.hpp>
00023 #include <vecal/Geodesic.hpp>
00024 
00025 namespace VecAl
00026 {
00027 
00028 struct  Kerr
00029 {
00030         Scalar_t        m, a, e;
00031 
00032         enum { t, r, h, p,
00033                theta=h, phi = p
00034         };
00035 
00036         Kerr(const Scalar_t&mass)
00037         : m(mass)
00038         {}
00039 
00040         void getMetric(Metric<Scalar_t,4>&g, const Point_t&P) const
00041         {
00042         Scalar_t sinTheta = sin(P[h]);
00043 
00044                 g.set(0);
00045 
00046         S r2 = point[P4_R]*point[P4_R];
00047         S tmp = cos(point[P4_H]);
00048 
00049         S sig = r2 + a2*tmp*tmp;
00050         S del = r2 + a2 + e2 - 2*m*point[P4_R];
00051 
00052                 tmp = sin(point[P4_H]);
00053         S tmp2 = tmp*tmp;
00054 
00055                 g[M4_TT] = (a2*tmp2 -  del)/sig;
00056                 g[M4_TP] = g[M4_PT] = -a*tmp2*(r2 + a2 - del)/sig;
00057                 g[M4_RR] = sig/del;
00058                 g[M4_HH] = sig;
00059                 g[M4_PP] = ((r2 + a2)*(r2 + a2) - del*a2*tmp2)/sig*tmp2;
00060         }
00061 
00062         void getChristoffel(Christoffel<Scalar_t,4>&G, const Point_t&P) const
00063         {
00064         Scalar_t sinTheta = sin(P[h]);
00065 
00066                 G.set(0);
00067 
00068 
00069 
00070         S r2 = point[P4_R]*point[P4_R];
00071         S tmpx = cos(point[P4_H]);
00072 
00073         S sig = r2 + a2*tmpx*tmpx;
00074         S del = r2 + a2 + e2 - 2*m*point[P4_R];
00075 
00076         S tmp = sin(point[P4_H]);
00077         S tmp2 = tmp*tmp;
00078 
00079         S t_b = point[P4_R]*point[P4_R] + a2;
00080         S t_c = t_b*t_b - del*a2*tmp2;
00081         S t_d = del - a2*tmp2;
00082         S t_e = t_b - del;
00083         S t_f = point[P4_R] - m;
00084 
00085         S t_n = t_d*t_c + a2*tmp2*t_e*t_e;
00086 
00087 
00088 
00089         chr[C4_TTR] =
00090            chr[C4_TRT] = (t_c*(t_f - point[P4_R]*t_d/sig)
00091                           + a2*tmp2*t_e*(m - point[P4_R]*t_e/sig))/t_n;
00092         chr[C4_TTH] =
00093            chr[C4_THT] = a2*tmp*tmpx/t_n*(-t_c + t_d*t_c/sig
00094                                           + t_e*t_e*(1 + a2*tmp2/sig));
00095         chr[C4_TRP] =
00096            chr[C4_TPR] = a*tmp2/t_n*(m*t_c - t_e*(2*point[P4_R]*t_b
00097                                                   - a2*tmp2*t_f));
00098         chr[C4_TPH] =
00099            chr[C4_THP] = a2*a*del*tmp2*tmp*tmpx*t_e/t_n;
00100 
00101         chr[C4_RTT] = (sig*t_f - point[P4_R]*t_d)/sig/sig/sig*del;
00102         chr[C4_RTP] =
00103            chr[C4_RPT] = ((sig*m - point[P4_R]*t_e)/sig/sig/sig
00104                           *del*a*tmp2);
00105         chr[C4_RRR] = (del*point[P4_R] - sig*t_f)/del/sig;
00106         chr[C4_RRH] =
00107            chr[C4_RHR] = -a2*tmp*tmpx/sig;
00108         chr[C4_RPP] = (-t_b*2*point[P4_R] + t_f*a2*tmp2
00109                        + t_c*point[P4_R]/sig)*del*tmp2/sig/sig;
00110         chr[C4_RHH] = -del*point[P4_R]/sig;
00111         
00112         
00113         chr[C4_PTR] =
00114            chr[C4_PRT] = -a/t_n*(m*t_d - t_f*t_e);
00115         chr[C4_PTH] =
00116            chr[C4_PHT] = -a*tmpx*t_e/t_n*(t_d/tmp + a2*tmp);
00117         chr[C4_PRP] =
00118            chr[C4_PPR] = (t_d*(2*point[P4_R]*t_b - a2*tmp2*t_f
00119                                - point[P4_R]*t_c/sig)
00120                           +a2*tmp2*t_e*(m - point[P4_R]*t_e/sig))/t_n;
00121         chr[C4_PPH] =
00122            chr[C4_PHP] = (t_d*tmpx*(t_c*(1/tmp + a2*tmp/sig)
00123                                     - a2*del*tmp)
00124                           + a2*tmp*tmpx*t_e*t_e*(1 + a2*tmp2/sig))/t_n;
00125 
00126         chr[C4_HTT] = -(sig - del + a2*tmp2)/sig/sig/sig*a2*tmp*tmpx;
00127         chr[C4_HTP] =
00128            chr[C4_HPT] = tmp*tmpx*t_e/sig/sig*(1 + a2*a*tmp2/sig);
00129         chr[C4_HRR] = a2*tmp*tmpx/del/sig;
00130         chr[C4_HRH] =
00131            chr[C4_HHR] = point[P4_r]/sig;
00132         chr[C4_HPP] = -tmp*tmpx/sig/sig*(t_b*t_b - 2*del*a2*tmp2
00133                                          + t_c*a2*tmp2/sig);
00134         chr[C4_HHH] = -a2*tmp*tmpx/sig;
00135 
00136         }
00137 };
00138 
00139 } /* namespace VecAl */ 
00140 
00141 #endif /* __Kerr_HPP */