FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
EvalChristoffel.hpp
1
2//
3// $Id: EvalChristoffel.hpp,v 1.4 2004/08/12 16:21:34 werner Exp $
4//
5// $Log: EvalChristoffel.hpp,v $
6// Revision 1.4 2004/08/12 16:21:34 werner
7// Integration of numerical geodesics now compiles. Working is not yet satisfying.
8//
9// Revision 1.3 2004/05/14 10:01:47 werner
10// removed comment.
11//
12// Revision 1.2 2004/05/13 16:43:43 werner
13// Remove debug code.
14//
15// Revision 1.1 2004/05/13 12:19:16 werner
16// Interfacing the DiffMe library.
17//
18// Revision 1.7 2004/05/11 18:05:10 werner
19//
20// Revision 1.6 2004/05/06 22:42:16 werner
21// Towards a specification of a spacetime via the Acceleration structure.
22//
23// Revision 1.5 2004/05/03 13:33:33 werner
24// integration improved
25//
26// Revision 1.4 2004/03/30 13:16:35 werner
27// little more
28//
29// Revision 1.3 2004/03/29 11:51:02 werner
30// Common interface among simple integrators, DiffMe and Vecal, and preliminiary work on integrating dop853.
31//
32// Revision 1.2 2004/03/24 13:23:02 werner
33// Experimental DiffMe interface
34//
35// Revision 1.1 2004/03/22 11:55:02 werner
36// Schwarzschild geodesic integration.
37//
38// Revision 1.1 2004/02/13 16:36:21 werner
39// Initial preliminiary version of the Vector Algebra Library.
40//
42#ifndef __EvalChristoffel_HPP
43#define __EvalChristoffel_HPP "Created 27.02.2001 21:42:27 by werner"
44
45#include <diffme/Tensor.hpp>
46#include <diffme/Variable.hpp>
47#include <diffme/Power.hpp>
48#include <vecal/Christoffel.hpp>
49
50namespace Traum
51{
52 using namespace DiffMe;
53 using VecAl::Christoffel;
54
55template <int i, int j, int k, template <int,int> class g>
57{
58 typedef g<i,j> g_ij;
59 typedef typename Coordinate<g_ij>::result coord_t;
60
61 enum { dims = coord_t::dims };
62
63 typedef typename ChristoffelSymbols<i,j, g, k>::result Gk_ij;
64
65 // C['x'] = 3.0;
66
67template <class dstvalue, class srcvalue>
68static void eval(Context<srcvalue>&C, Christoffel<dims, dstvalue>&Gamma)
69 {
70 Gamma(k,i,j) = Eval<Gk_ij>::eval(C);
71 }
72};
73
74
75template <int I, int J, int K, template <int,int> class g, int dims>
77{
78
79template <class dstvalue, class srcvalue>
80static void eval(Context<srcvalue>&C, Christoffel<dims, dstvalue>&Gamma)
81 {
83 EvalChristoffelIJK <I, J, K-1 ,g, dims>::eval(C, Gamma);
84 }
85};
86
87template <int I, int J, template <int,int> class g, int dims>
88struct EvalChristoffelIJK<I,J, 0, g, dims>
89{
90
91template <class dstvalue, class srcvalue>
92static void eval(Context<srcvalue>&C, Christoffel<dims, dstvalue>&Gamma)
93 {
95 }
96};
97
98
99template <int I, int J, template <int,int> class g, int dims>
101{
102
103template <class dstvalue, class srcvalue>
104static void eval(Context<srcvalue>&C, Christoffel<dims, dstvalue>&Gamma)
105 {
107 EvalChristoffelIJ <I, J-1, g, dims>::eval(C, Gamma);
108 }
109};
110
111template <int I, template <int,int> class g, int dims>
112struct EvalChristoffelIJ<I, 0, g, dims>
113{
114
115template <class dstvalue, class srcvalue>
116static void eval(Context<srcvalue>&C, Christoffel<dims, dstvalue>&Gamma)
117 {
119 }
120};
121
122
123
124
125template <int I, template <int,int> class g, int dims>
127{
128
129template <class dstvalue, class srcvalue>
130static void eval(Context<srcvalue>&C, Christoffel<dims, dstvalue>&Gamma)
131 {
133 EvalChristoffelI <I-1, g, dims>::eval(C, Gamma);
134 }
135};
136
137template <template <int,int> class g, int dims>
138struct EvalChristoffelI<0, g, dims>
139{
140
141template <class dstvalue, class srcvalue>
142static void eval(Context<srcvalue>&C, Christoffel<dims, dstvalue>&Gamma)
143 {
145 }
146};
147
148
149
150template <template <int,int> class g>
152{
153 typedef typename Coordinate<g<0,0> >::result coord_t;
154 enum { dims = coord_t::dims };
155
156template <class dstvalue, class srcvalue>
157static void eval(Context<srcvalue>&C, Christoffel<dims, dstvalue>&Gamma)
158 {
159 EvalChristoffelI <dims-1, g, dims>::eval(C, Gamma);
160 }
161};
162
163} /* namespace Traum */
164
165#endif /* __Christoffel_HPP */
166
167
Definition EvalChristoffel.hpp:57
Definition EvalChristoffel.hpp:77
Definition EvalChristoffel.hpp:101
Definition EvalChristoffel.hpp:127
Definition EvalChristoffel.hpp:152