Peano
TP_ConservedVectorNames.h
Go to the documentation of this file.
1 #pragma once
2 
21 namespace TP {
22 namespace Z4VectorShortcuts {
23 
24 const int g11 = 0;
25 const int g12 = 1;
26 const int g13 = 2;
27 const int g22 = 3;
28 const int g23 = 4;
29 const int g33 = 5;
30 const int K11 = 6;
31 const int K12 = 7;
32 const int K13 = 8;
33 const int K22 = 9;
34 const int K23 = 10;
35 const int K33 = 11;
36 const int Z1 = 12;
37 const int Z2 = 13;
38 const int Z3 = 14;
39 const int Theta = 15;
40 const int lapse = 16;
41 const int shift1 = 17;
42 const int shift2 = 18;
43 const int shift3 = 19;
44 const int b1 = 20;
45 const int b2 = 21;
46 const int b3 = 22;
47 const int A1 = 23;
48 const int A2 = 24;
49 const int A3 = 25;
50 const int B11 = 26;
51 const int B21 = 27;
52 const int B31 = 28;
53 const int B12 = 29;
54 const int B22 = 30;
55 const int B32 = 31;
56 const int B13 = 32;
57 const int B23 = 33;
58 const int B33 = 34;
59 const int D111 = 35;
60 const int D112 = 36;
61 const int D113 = 37;
62 const int D122 = 38;
63 const int D123 = 39;
64 const int D133 = 40;
65 const int D211 = 41;
66 const int D212 = 42;
67 const int D213 = 43;
68 const int D222 = 44;
69 const int D223 = 45;
70 const int D233 = 46;
71 const int D311 = 47;
72 const int D312 = 48;
73 const int D313 = 49;
74 const int D322 = 50;
75 const int D323 = 51;
76 const int D333 = 52;
77 const int K0 = 53;
78 
79 // total length of conserved vector
80 const int Qlen = 54;
81 
82 /************************** Syntactic sugar (example from SRHD) ********************************/
83 /************************** Just for placing it somewhere, currently not used ******************/
84 
85 // Method 1: C++ namespaced constants, as present here.
86 
87 // Method 2:
88 // Labels for indices into Q and V, used only in the local scope. However, the C++ namespace
89 // allows the same just with a cleaner notation.
96 /* Usage:
97  function foo(double* Q, double* V) {
98  DEFINE_LABELS;
99  Q[rho] = V[p];
100  }
101  You can archieve the same when writing
102  function foo(double* Q, double* V) {
103  using namespace TP::Z4VectorShortcuts;
104  Q[rho] = V[p];
105  }
106 */
107 
108 
109 // direct references deep into X (might be named V, Q, S, whatever)
110 // Pro: More natural, shorter names for fields
111 // Contra: Can only be used for one state vector in a scope.
112 // Will produce a lot of warnings when -Wunused-but-set-variable warnings is active
114 /* Usage:
115  function foo(double* Q) {
116  SHORTHANDS(Q);
117  rho = p*p + vx;
118  }
119 */
120 
121 } // namespace Z4VectorShortcuts
122 } // namespace TP
123 
This file contains aliases for making access to the long state vector Q as used eg.
Definition: CoordTransf.cpp:13