Acceleration.hpp

00001 
00002 //
00003 // $Id: Acceleration.hpp,v 1.2 2004/05/11 18:05:10 werner Exp $
00004 //
00005 // $Log: Acceleration.hpp,v $
00006 // Revision 1.2  2004/05/11 18:05:10  werner
00007 // *** empty log message ***
00008 //
00009 // Revision 1.1  2004/05/06 22:42:16  werner
00010 // Towards a specification of a spacetime via the Acceleration structure.
00011 //
00012 //
00014 #ifndef __ACCELERATION_HPP
00015 #define __ACCELERATION_HPP "Created 03.05.2004 21:44:45 by werner benger"
00016 
00017 #include "Geodesic.hpp"
00018 #include <ode/Integrate853.hpp>
00019 
00020 namespace Traum
00021 {
00022 using namespace VecAl;
00023 
00024 template <class SpaceTime> 
00025         class AffineAcceleration
00026 {
00027         const SpaceTime&ST;
00028 public:
00029         typedef typename SpaceTime::Scalar_t     Scalar_t;
00030         typedef typename SpaceTime::Point_t      Point_t;
00031         typedef typename SpaceTime::Vector_t     Vector_t;
00032         typedef typename SpaceTime::Christoffel_t Christoffel_t;
00033 
00034         typedef typename Point_t::Vector_t PointComponents_t;
00035         enum { Dims = PointComponents_t::SIZE };
00036 
00037         AffineAcceleration(const SpaceTime&R)
00038         : ST(R)
00039         {}
00040 
00044         Vector_t operator()(const Point_t&q, const Vector_t&dot_q) const
00045         {
00046         Christoffel_t Gamma;
00047                 ST.getChristoffel(Gamma, q);
00048                 return Vector_t( Gamma(dot_q, dot_q) );
00049         }
00050 };
00051 
00052 template <class SpaceTime> 
00053 class TimeAcceleration : public AffineAcceleration<SpaceTime>
00054 {
00055 public:
00056         typedef typename AffineAcceleration<SpaceTime>::Point_t  Point_t;
00057         typedef typename AffineAcceleration<SpaceTime>::Vector_t Vector_t;
00058 
00059         Vector_t operator()(const Point_t&q, const Vector_t&dot_q) const
00060         {
00061         Vector_t v = AffineAcceleration<SpaceTime>::operator()(q, dot_q);
00062                 return -v + dot_q*v[0];
00063         }
00064 };
00065 
00066 
00067 } // namespace Vecal
00068 
00069 #endif // __ACCELERATION_HPP