00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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 }
00089
00090 #endif
00091
00092