SphericalSymmetric.hpp

00001 
00002 //
00003 // $Id: SphericalSymmetric.hpp,v 1.2 2004/05/11 16:53:47 werner Exp $
00004 //
00005 // $Log: SphericalSymmetric.hpp,v $
00006 // Revision 1.2  2004/05/11 16:53:47  werner
00007 // Introduction of coordinate systems for improved type-safety.
00008 // Will support easy coordinate transformations soon.
00009 //
00010 // Revision 1.1  2004/03/22 11:55:02  werner
00011 // Schwarzschild geodesic integration.
00012 //
00013 // Revision 1.1  2004/02/13 16:36:21  werner
00014 // Initial preliminiary version of the Vector Algebra Library.
00015 //
00017 #ifndef __Schwarzschild_HPP
00018 #define __Schwarzschild_HPP "Created 27.02.2001 21:42:27 by werner"
00019 
00020 #include <vecal/Christoffel.hpp>
00021 #include <vecal/Geodesic.hpp>
00022 
00023 namespace VecAl
00024 {
00025 
00030 struct  SphericalSymmetric
00031 {
00032         enum { t, r, h, p,
00033                theta=h, phi = p
00034         };
00035 
00036         Scalar_t A(Scalar_t r, Scalar_t t);
00037         Scalar_t B(Scalar_t r, Scalar_t t);
00038 
00039 
00048         void metric(Metric<Scalar_t,4>&g, const Point_t&P) const
00049         {
00050         Scalar_t sinTheta = sin(P[h]);
00051 
00052                 g.set(0);
00053                 g(t,t) =  A(P[r], P[t]);
00054                 g(r,r) = -B(P[r], P[t]);
00055                 g(h,h) = -P[r]*P[r];
00056                 g(p,p) = -P[r]*P[r]*sinTheta*sinTheta;
00057         }
00058 
00067         void cometric(Metric<Scalar_t,4>&g, const Point_t&P) const
00068         {
00069         Scalar_t sinTheta = sin(P[h]);
00070 
00071                 g.set(0);
00072                 g(t,t) =  1/A(P[r], P[t]);
00073                 g(r,r) = -1/B(P[r], P[t]);
00074                 g(h,h) = -1/(P[r]*P[r]);
00075                 g(p,p) = -1/(P[r]*P[r]*sinTheta*sinTheta);
00076         }
00077 
00078 
00102         void getChristoffel(Christoffel<Scalar_t,4>&G, const Point_t&P) const
00103         {
00104         Scalar_t sinTheta = sin(P[h]);
00105 
00106                 G.set(0);
00107                 G(t,t,t) = dotA(P[r], P[t]) / (2*A(P[r], P[t]) );
00108                 /*
00109                 G(t,t,r) = G(t,r,r)  = m/P[r]/(P[r] - 2*m);
00110                 G(r,t,t) = m*(1 - 2*m/P[r]) / (P[r] * P[r] );
00111                 G(r,r,r) = -G(t,t,r);
00112                 G(r,h,h) = 2*m - P[r];
00113                 G(r,p,p) = G(r,h,h)*sinTheta*sinTheta;
00114                 G(h,r,h) = G(h,h,r)= 1/P[r];
00115                 G(h,p,p) = -sinTheta*cos( P[h] );
00116                 G(p,r,p) = G(p,p,r) = G(h,r,h);
00117                 g^p_ph = cos(theta)/sin(theta)
00118                 G(p,h,p) = G(p,p,h) = 1/tan( P[h] );
00119                 */
00120         }
00121 
00122 
00141         void Ricci(Metric<Scalar_t,4>&g, const Point_t&P) const
00142         {}
00143 };
00144 
00145 } /* namespace VecAl */ 
00146 
00147 #endif /* __Schwarzschild_HPP */