Schwarzschild.hpp

00001 
00002 //
00003 // $Id: Schwarzschild.hpp,v 1.9 2007/02/22 23:11:52 werner Exp $
00004 //
00005 // $Log: Schwarzschild.hpp,v $
00006 // Revision 1.9  2007/02/22 23:11:52  werner
00007 // Using Eagle library instead of Vecal
00008 //
00009 // Revision 1.8  2004/09/03 12:26:15  werner
00010 // Adjusted moved header files.
00011 //
00012 // Revision 1.7  2004/08/12 16:21:33  werner
00013 // Integration of numerical geodesics now compiles. Working is not yet satisfying.
00014 //
00015 // Revision 1.6  2004/05/13 16:44:23  werner
00016 // Formulate Christoffel symbols via direct vectorization.
00017 //
00018 // Revision 1.5  2004/05/11 16:53:47  werner
00019 // Introduction of coordinate systems for improved type-safety.
00020 // Will support easy coordinate transformations soon.
00021 //
00022 // Revision 1.4  2004/05/06 22:42:16  werner
00023 // Towards a specification of a spacetime via the Acceleration structure.
00024 //
00025 // Revision 1.3  2004/05/03 13:33:33  werner
00026 // integration improved
00027 //
00028 // Revision 1.2  2004/03/29 11:51:02  werner
00029 // Common interface among simple integrators, DiffMe and Vecal, and preliminiary work on integrating dop853.
00030 //
00031 // Revision 1.1  2004/03/22 11:55:02  werner
00032 // Schwarzschild geodesic integration.
00033 //
00034 // Revision 1.1  2004/02/13 16:36:21  werner
00035 // Initial preliminiary version of the Vector Algebra Library.
00036 //
00038 #ifndef __Schwarzschild_HPP
00039 #define __Schwarzschild_HPP "Created 27.02.2001 21:42:27 by werner"
00040 
00041 #include "Geodesic.hpp"
00042 #include <eagle/STA.hpp>
00043 
00044 namespace Traum
00045 {
00046         using namespace Eagle;
00047 
00051 struct  Schwarzschild : Chart<STA::SphericalChart4D>
00052 {
00053         typedef Chart<STA::SphericalChart4D> Polar4Dd;
00054 
00055         using Polar4Dd::Point_t;
00056         using Polar4Dd::Scalar_t;
00057         using Polar4Dd::Vector_t;
00058         using Polar4Dd::Metric;
00059         using Polar4Dd::Christoffel;
00060 
00061         enum
00062         {
00063                 t = Polar4Dd::T,
00064                 h = Polar4Dd::THETA,
00065                 p = Polar4Dd::PHI,
00066                 r = Polar4Dd::R
00067         };
00068 
00069         Scalar_t        m;
00070 
00071         Schwarzschild(const Scalar_t&mass)
00072         : m(mass)
00073         {}
00074 
00075         void getMetric(Metric&g, const Point_t&P) const
00076         {
00077         Scalar_t sinTheta = sin(P[h]);
00078 
00079                 g.set(0);
00080                 g(t,t) = 1 - 2*m/P[r];
00081                 g(r,r) = -1/g(t,t);
00082                 g(h,h) = -P[r]*P[r];
00083                 g(p,p) =  g(h,h)*sinTheta*sinTheta ;
00084         }
00085 
00086         void getChristoffel(Christoffel_t&G, const Point_t&P) const
00087         {
00088         Scalar_t sinTheta = sin(P[h]); 
00089                 G.set(0.0); 
00090                 G(t,t,r) = G(t,r,r)  = m/P[r]/(P[r] - 2*m);
00091                 G(r,t,t) = m*(1 - 2*m/P[r]) / (P[r] * P[r] );
00092                 G(r,r,r) = -G(t,t,r);
00093                 G(r,h,h) = 2*m - P[r];
00094                 G(r,p,p) = G(r,h,h)*sinTheta*sinTheta;
00095                 G(h,r,h) = G(h,h,r)= 1/P[r];
00096                 G(h,p,p) = -sinTheta*cos( P[h] );
00097                 G(p,r,p) = G(p,p,r) = G(h,r,h);
00098                 G(p,h,p) = G(p,p,h) = 1/tan( P[h] );
00099         }
00100 };
00101 
00102 } /* namespace VecAl */ 
00103 
00104 #endif /* __Schwarzschild_HPP */