FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Warp.hpp
1
2//
3// $Id: Warp.hpp,v 1.1 2004/08/12 16:21:33 werner Exp $
4//
5// $Log: Warp.hpp,v $
6// Revision 1.1 2004/08/12 16:21:33 werner
7// Integration of numerical geodesics now compiles. Working is not yet satisfying.
8//
9// Revision 1.2 2004/05/05 15:56:52 werner
10// Separation of DOP core routines with dynamic size into the ODE library.
11//
12// Revision 1.1 2004/03/22 11:55:02 werner
13// Schwarzschild geodesic integration.
14//
15// Revision 1.1 2004/02/13 16:36:21 werner
16// Initial preliminiary version of the Vector Algebra Library.
17//
19#ifndef __Kerr_HPP
20#define __Kerr_HPP "Created 27.02.2001 21:42:27 by werner"
21
22#include <vecal/Christoffel.hpp>
23#include <vecal/Geodesic.hpp>
24
25namespace VecAl
26{
27
28struct Kerr
29{
30 Scalar_t m, a, e;
31
32 enum { t, r, h, p,
33 theta=h, phi = p
34 };
35
36 Kerr(const Scalar_t&mass)
37 : m(mass)
38 {}
39
40 void getMetric(Metric<Scalar_t,4>&g, const Point_t&P) const
41 {
42 Scalar_t sinTheta = sin(P[h]);
43
44 g.set(0);
45
46 S r2 = point[P4_R]*point[P4_R];
47 S tmp = cos(point[P4_H]);
48
49 S sig = r2 + a2*tmp*tmp;
50 S del = r2 + a2 + e2 - 2*m*point[P4_R];
51
52 tmp = sin(point[P4_H]);
53 S tmp2 = tmp*tmp;
54
55 g[M4_TT] = (a2*tmp2 - del)/sig;
56 g[M4_TP] = g[M4_PT] = -a*tmp2*(r2 + a2 - del)/sig;
57 g[M4_RR] = sig/del;
58 g[M4_HH] = sig;
59 g[M4_PP] = ((r2 + a2)*(r2 + a2) - del*a2*tmp2)/sig*tmp2;
60 }
61
62 void getChristoffel(Christoffel<Scalar_t,4>&G, const Point_t&P) const
63 {
64 Scalar_t sinTheta = sin(P[h]);
65
66 G.set(0);
67
68
69
70 S r2 = point[P4_R]*point[P4_R];
71 S tmpx = cos(point[P4_H]);
72
73 S sig = r2 + a2*tmpx*tmpx;
74 S del = r2 + a2 + e2 - 2*m*point[P4_R];
75
76 S tmp = sin(point[P4_H]);
77 S tmp2 = tmp*tmp;
78
79 S t_b = point[P4_R]*point[P4_R] + a2;
80 S t_c = t_b*t_b - del*a2*tmp2;
81 S t_d = del - a2*tmp2;
82 S t_e = t_b - del;
83 S t_f = point[P4_R] - m;
84
85 S t_n = t_d*t_c + a2*tmp2*t_e*t_e;
86
87
88
89 chr[C4_TTR] =
90 chr[C4_TRT] = (t_c*(t_f - point[P4_R]*t_d/sig)
91 + a2*tmp2*t_e*(m - point[P4_R]*t_e/sig))/t_n;
92 chr[C4_TTH] =
93 chr[C4_THT] = a2*tmp*tmpx/t_n*(-t_c + t_d*t_c/sig
94 + t_e*t_e*(1 + a2*tmp2/sig));
95 chr[C4_TRP] =
96 chr[C4_TPR] = a*tmp2/t_n*(m*t_c - t_e*(2*point[P4_R]*t_b
97 - a2*tmp2*t_f));
98 chr[C4_TPH] =
99 chr[C4_THP] = a2*a*del*tmp2*tmp*tmpx*t_e/t_n;
100
101 chr[C4_RTT] = (sig*t_f - point[P4_R]*t_d)/sig/sig/sig*del;
102 chr[C4_RTP] =
103 chr[C4_RPT] = ((sig*m - point[P4_R]*t_e)/sig/sig/sig
104 *del*a*tmp2);
105 chr[C4_RRR] = (del*point[P4_R] - sig*t_f)/del/sig;
106 chr[C4_RRH] =
107 chr[C4_RHR] = -a2*tmp*tmpx/sig;
108 chr[C4_RPP] = (-t_b*2*point[P4_R] + t_f*a2*tmp2
109 + t_c*point[P4_R]/sig)*del*tmp2/sig/sig;
110 chr[C4_RHH] = -del*point[P4_R]/sig;
111
112
113 chr[C4_PTR] =
114 chr[C4_PRT] = -a/t_n*(m*t_d - t_f*t_e);
115 chr[C4_PTH] =
116 chr[C4_PHT] = -a*tmpx*t_e/t_n*(t_d/tmp + a2*tmp);
117 chr[C4_PRP] =
118 chr[C4_PPR] = (t_d*(2*point[P4_R]*t_b - a2*tmp2*t_f
119 - point[P4_R]*t_c/sig)
120 +a2*tmp2*t_e*(m - point[P4_R]*t_e/sig))/t_n;
121 chr[C4_PPH] =
122 chr[C4_PHP] = (t_d*tmpx*(t_c*(1/tmp + a2*tmp/sig)
123 - a2*del*tmp)
124 + a2*tmp*tmpx*t_e*t_e*(1 + a2*tmp2/sig))/t_n;
125
126 chr[C4_HTT] = -(sig - del + a2*tmp2)/sig/sig/sig*a2*tmp*tmpx;
127 chr[C4_HTP] =
128 chr[C4_HPT] = tmp*tmpx*t_e/sig/sig*(1 + a2*a*tmp2/sig);
129 chr[C4_HRR] = a2*tmp*tmpx/del/sig;
130 chr[C4_HRH] =
131 chr[C4_HHR] = point[P4_r]/sig;
132 chr[C4_HPP] = -tmp*tmpx/sig/sig*(t_b*t_b - 2*del*a2*tmp2
133 + t_c*a2*tmp2/sig);
134 chr[C4_HHH] = -a2*tmp*tmpx/sig;
135
136 }
137};
138
139} /* namespace VecAl */
140
141#endif /* __Kerr_HPP */
complex< _Tp > sin(const complex< _Tp > &)
complex< _Tp > cos(const complex< _Tp > &)
void set(const T &Value)
Set all elements to the same value.
Definition vector/Iterator.hpp:724