FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Schwarzschild.hpp
1
2//
3// $Id: Schwarzschild.hpp,v 1.9 2007/02/22 23:11:52 werner Exp $
4//
5// $Log: Schwarzschild.hpp,v $
6// Revision 1.9 2007/02/22 23:11:52 werner
7// Using Eagle library instead of Vecal
8//
9// Revision 1.8 2004/09/03 12:26:15 werner
10// Adjusted moved header files.
11//
12// Revision 1.7 2004/08/12 16:21:33 werner
13// Integration of numerical geodesics now compiles. Working is not yet satisfying.
14//
15// Revision 1.6 2004/05/13 16:44:23 werner
16// Formulate Christoffel symbols via direct vectorization.
17//
18// Revision 1.5 2004/05/11 16:53:47 werner
19// Introduction of coordinate systems for improved type-safety.
20// Will support easy coordinate transformations soon.
21//
22// Revision 1.4 2004/05/06 22:42:16 werner
23// Towards a specification of a spacetime via the Acceleration structure.
24//
25// Revision 1.3 2004/05/03 13:33:33 werner
26// integration improved
27//
28// Revision 1.2 2004/03/29 11:51:02 werner
29// Common interface among simple integrators, DiffMe and Vecal, and preliminiary work on integrating dop853.
30//
31// Revision 1.1 2004/03/22 11:55:02 werner
32// Schwarzschild geodesic integration.
33//
34// Revision 1.1 2004/02/13 16:36:21 werner
35// Initial preliminiary version of the Vector Algebra Library.
36//
38#ifndef __Schwarzschild_HPP
39#define __Schwarzschild_HPP "Created 27.02.2001 21:42:27 by werner"
40
41#include "Geodesic.hpp"
42#include <eagle/STA.hpp>
43
44namespace Traum
45{
46 using namespace Eagle;
47
51struct Schwarzschild : Chart<STA::SphericalChart4D>
52{
53 typedef Chart<STA::SphericalChart4D> Polar4Dd;
54
55 using Polar4Dd::Point_t;
56 using Polar4Dd::Scalar_t;
57 using Polar4Dd::Vector_t;
58 using Polar4Dd::Metric;
59 using Polar4Dd::Christoffel;
60
61 enum
62 {
63 t = Polar4Dd::T,
64 h = Polar4Dd::THETA,
65 p = Polar4Dd::PHI,
66 r = Polar4Dd::R
67 };
68
69 Scalar_t m;
70
71 Schwarzschild(const Scalar_t&mass)
72 : m(mass)
73 {}
74
75 void getMetric(Metric&g, const Point_t&P) const
76 {
77 Scalar_t sinTheta = sin(P[h]);
78
79 g.set(0);
80 g(t,t) = 1 - 2*m/P[r];
81 g(r,r) = -1/g(t,t);
82 g(h,h) = -P[r]*P[r];
83 g(p,p) = g(h,h)*sinTheta*sinTheta ;
84 }
85
86 void getChristoffel(Christoffel_t&G, const Point_t&P) const
87 {
88 Scalar_t sinTheta = sin(P[h]);
89 G.set(0.0);
90 G(t,t,r) = G(t,r,r) = m/P[r]/(P[r] - 2*m);
91 G(r,t,t) = m*(1 - 2*m/P[r]) / (P[r] * P[r] );
92 G(r,r,r) = -G(t,t,r);
93 G(r,h,h) = 2*m - P[r];
94 G(r,p,p) = G(r,h,h)*sinTheta*sinTheta;
95 G(h,r,h) = G(h,h,r)= 1/P[r];
96 G(h,p,p) = -sinTheta*cos( P[h] );
97 G(p,r,p) = G(p,p,r) = G(h,r,h);
98 G(p,h,p) = G(p,p,h) = 1/tan( P[h] );
99 }
100};
101
102} /* namespace VecAl */
103
104#endif /* __Schwarzschild_HPP */
complex< _Tp > sin(const complex< _Tp > &)
complex< _Tp > tan(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
Implementation of the Schwarzschild spacetime in polar coordinates.
Definition Schwarzschild.hpp:52