FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
EulerGeodesic.hpp
1
2//
3// $Id: EulerGeodesic.hpp,v 1.1 2004/08/12 16:21:33 werner Exp $
4//
5// $Log: EulerGeodesic.hpp,v $
6// Revision 1.1 2004/08/12 16:21:33 werner
7// Integration of numerical geodesics now compiles. Working is not yet satisfying.
8//
9// Revision 1.8 2004/05/12 14:36:22 werner
10// Separation of chart definitions on a manifold and the tangential space.
11// Introduced convenient coordinate transformations.
12//
13// Revision 1.7 2004/05/11 18:05:10 werner
14//
15// Revision 1.6 2004/05/11 16:53:47 werner
16// Introduction of coordinate systems for improved type-safety.
17// Will support easy coordinate transformations soon.
18//
19// Revision 1.5 2004/05/06 22:42:16 werner
20// Towards a specification of a spacetime via the Acceleration structure.
21//
22// Revision 1.4 2004/05/05 15:56:52 werner
23// Separation of DOP core routines with dynamic size into the ODE library.
24//
25// Revision 1.3 2004/05/03 13:33:33 werner
26// integration improved
27//
28// Revision 1.2 2004/03/29 11:51:02 werner
29// Common interface among simple integrators, DiffMe and Vecal, and preliminiary work on integrating dop853.
30//
31// Revision 1.1 2004/03/22 11:55:02 werner
32// Schwarzschild geodesic integration.
33//
34// Revision 1.1 2004/02/13 16:36:21 werner
35// Initial preliminiary version of the Vector Algebra Library.
36//
38#ifndef __EulerGeodesic_HPP
39#define __EulerGeodesic_HPP "Created 27.02.2001 21:42:27 by werner"
40
41#include <vecal/Matrix.hpp>
42#include <ode/Integrator.hpp>
43
44namespace Traum
45{
46
51template <class Acceleration>
53{
54 typedef typename Acceleration::Scalar_t Scalar_t;
55 typedef typename Acceleration::Point_t Point_t;
56 typedef typename Acceleration::Vector_t Vector_t;
57 typedef typename Acceleration::Christoffel_t Christoffel_t;
58
59 typedef typename Point_t::Vector_t PointComponents_t;
60 enum { Dims = PointComponents_t::SIZE };
61
62 Point_t x;
63 Vector_t v;
64
65 const Acceleration&Accel;
66 Scalar_t ds;
67
68 EulerGeodesic(const Acceleration&A)
69 : Accel(A), ds(1)
70 {}
71
72 success_code advance(bool backward=false)
73 {
74 if (backward)
75 {
76 x -= v * ds;
77 v += Accel(x, v) * ds;
78 }
79 else
80 {
81 x += v * ds;
82 v -= Accel(x, v) * ds;
83 }
84 return StepOk;
85 }
86};
87
88
89} /* namespace VecAl */
90
91#endif /* __EulerGeodesic_HPP */
Class EulerGeodesic is coordinate-independent.
Definition EulerGeodesic.hpp:53