NumericalSpacetime.hpp

00001 
00002 //
00003 // $Id: NumericalSpacetime.hpp,v 1.1 2004/08/24 09:09:53 werner Exp $
00004 //
00005 // $Log: NumericalSpacetime.hpp,v $
00006 // Revision 1.1  2004/08/24 09:09:53  werner
00007 // Towards VC7
00008 //
00009 // Revision 1.6  2004/05/13 16:44:23  werner
00010 // Formulate Christoffel symbols via direct vectorization.
00011 //
00012 // Revision 1.5  2004/05/11 16:53:47  werner
00013 // Introduction of coordinate systems for improved type-safety.
00014 // Will support easy coordinate transformations soon.
00015 //
00016 // Revision 1.4  2004/05/06 22:42:16  werner
00017 // Towards a specification of a spacetime via the Acceleration structure.
00018 //
00019 // Revision 1.3  2004/05/03 13:33:33  werner
00020 // integration improved
00021 //
00022 // Revision 1.2  2004/03/29 11:51:02  werner
00023 // Common interface among simple integrators, DiffMe and Vecal, and preliminiary work on integrating dop853.
00024 //
00025 // Revision 1.1  2004/03/22 11:55:02  werner
00026 // Schwarzschild geodesic integration.
00027 //
00028 // Revision 1.1  2004/02/13 16:36:21  werner
00029 // Initial preliminiary version of the Vector Algebra Library.
00030 //
00032 #ifndef __NumericalSpacetime_HPP
00033 #define __NumericalSpacetime_HPP "Created 27.02.2001 21:42:27 by werner"
00034 
00035 #include <vecal/ipol/ChristoffelField.hpp>
00036 
00037 namespace Traum
00038 {
00039 
00043 template <class MetricArray, class CoordinateSystem>
00044 struct  NumericalSpacetime : public CoordinateSystem
00045 {
00046         typedef CoordinateSystem CoordinateSystem_t;
00047 
00048         enum { Dims = MetricArray::Dims };
00049         typedef typename MetricArray::value_type        metric_type;
00050         typedef typename MetricArray::Storage_t MetricStorage_t;
00051 
00052         typedef typename CoordinateSystem::Point_t  Point_t;
00053         typedef typename CoordinateSystem::Scalar_t Scalar_t;
00054         typedef typename CoordinateSystem::Vector_t Vector_t;
00055         typedef typename CoordinateSystem::Metric_t Metric_t;
00056 
00057         typedef CubicIpol<metric_type>  MetricInterpol;
00058 
00059         typedef typename Point_t::Vector_t::value_type CoordinateType;
00060 
00061         const MetricArray & g;
00062 
00063         typedef Interpolate<Dims, metric_type, MetricStorage_t, MetricInterpol, CoordinateType> MetricField_t;
00064 
00066         NumericalSpacetime(const MetricArray&metric)
00067         : g(metric)
00068         {}
00069 
00071         void getMetric(Metric_t&g_p, const Point_t&P) const
00072         {
00073         MetricField_t mf(g,P);
00074                 mf.eval(g_p);
00075         }
00076 
00078         Vector_t operator()(const Point_t&q, const Vector_t&dot_q) const
00079         {
00080         Vector_t a;
00081         ChristoffelField<MetricArray> Chris(g, q);
00082 
00083                 Chris.getCoordinateAcceleration(a, dot_q);
00084                 return a;
00085         }
00086 };
00087 
00088 } /* namespace Traum */ 
00089 
00090 #endif /* __NumericalSpacetime_HPP */
00091 
00092