Line data Source code
1 1 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : /// \file
5 : /// Defines a list of useful type aliases for tensors
6 :
7 : #pragma once
8 :
9 : #include "DataStructures/Tensor/IndexType.hpp"
10 : #include "DataStructures/Tensor/Symmetry.hpp"
11 :
12 : /// \cond
13 : class DataVector;
14 : template <typename X, typename Symm, typename IndexList>
15 : class Tensor;
16 : /// \endcond
17 :
18 : /// \ingroup TensorGroup
19 : /// Scalar type
20 : template <typename T>
21 1 : using Scalar = Tensor<T, Symmetry<>, index_list<>>;
22 :
23 : /*!
24 : * \ingroup TensorGroup
25 : * \brief Type aliases to construct common Tensors
26 : *
27 : * Lower case letters represent covariant indices and upper case letters
28 : * represent contravariant indices. Letters a, b, c, d represent spacetime
29 : * indices and i, j, k, l represent spatial indices.
30 : */
31 1 : namespace tnsr {
32 : // Rank 1
33 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
34 : IndexType Index = IndexType::Spacetime>
35 0 : using a = Tensor<DataType, tmpl::integral_list<std::int32_t, 1>,
36 : index_list<Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo,
37 : Fr, Index>>>;
38 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
39 : IndexType Index = IndexType::Spacetime>
40 0 : using A = Tensor<DataType, tmpl::integral_list<std::int32_t, 1>,
41 : index_list<Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up,
42 : Fr, Index>>>;
43 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
44 0 : using i = Tensor<DataType, tmpl::integral_list<std::int32_t, 1>,
45 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
46 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
47 0 : using I = Tensor<DataType, tmpl::integral_list<std::int32_t, 1>,
48 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
49 :
50 : // Rank 2
51 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
52 : IndexType Index = IndexType::Spacetime>
53 0 : using ab = Tensor<
54 : DataType, tmpl::integral_list<std::int32_t, 2, 1>,
55 : index_list<
56 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
57 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
58 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
59 : IndexType Index = IndexType::Spacetime>
60 0 : using Ab = Tensor<
61 : DataType, tmpl::integral_list<std::int32_t, 2, 1>,
62 : index_list<
63 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
64 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
65 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
66 : IndexType Index = IndexType::Spacetime>
67 0 : using aB = Tensor<
68 : DataType, tmpl::integral_list<std::int32_t, 2, 1>,
69 : index_list<
70 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
71 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
72 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
73 : IndexType Index = IndexType::Spacetime>
74 0 : using AB = Tensor<
75 : DataType, tmpl::integral_list<std::int32_t, 2, 1>,
76 : index_list<
77 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
78 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
79 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
80 0 : using aI =
81 : Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
82 : index_list<Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr,
83 : IndexType::Spacetime>,
84 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr,
85 : IndexType::Spatial>>>;
86 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
87 0 : using ij = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
88 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
89 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
90 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
91 0 : using iJ = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
92 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
93 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
94 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
95 0 : using Ij = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
96 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
97 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
98 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
99 0 : using IJ = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
100 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
101 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
102 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
103 0 : using iA = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
104 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
105 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>>>;
106 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
107 0 : using ia = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
108 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
109 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
110 :
111 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
112 : IndexType Index = IndexType::Spacetime>
113 0 : using aa = Tensor<
114 : DataType, tmpl::integral_list<std::int32_t, 1, 1>,
115 : index_list<
116 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
117 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
118 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
119 : IndexType Index = IndexType::Spacetime>
120 0 : using AA = Tensor<
121 : DataType, tmpl::integral_list<std::int32_t, 1, 1>,
122 : index_list<
123 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
124 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
125 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
126 0 : using ii = Tensor<DataType, tmpl::integral_list<std::int32_t, 1, 1>,
127 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
128 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
129 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
130 0 : using II = Tensor<DataType, tmpl::integral_list<std::int32_t, 1, 1>,
131 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
132 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
133 :
134 : // Rank 3 - spacetime
135 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
136 : IndexType Index = IndexType::Spacetime>
137 0 : using abc = Tensor<
138 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
139 : index_list<
140 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
141 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
142 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
143 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
144 : IndexType Index = IndexType::Spacetime>
145 0 : using abC = Tensor<
146 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
147 : index_list<
148 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
149 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
150 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
151 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
152 : IndexType Index = IndexType::Spacetime>
153 0 : using aaB = Tensor<
154 : DataType, tmpl::integral_list<std::int32_t, 2, 2, 1>,
155 : index_list<
156 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
157 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
158 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
159 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
160 : IndexType Index = IndexType::Spacetime>
161 0 : using aBc = Tensor<
162 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
163 : index_list<
164 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
165 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
166 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
167 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
168 : IndexType Index = IndexType::Spacetime>
169 0 : using Abc = Tensor<
170 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
171 : index_list<
172 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
173 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
174 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
175 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
176 : IndexType Index = IndexType::Spacetime>
177 0 : using aBC = Tensor<
178 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
179 : index_list<
180 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
181 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
182 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
183 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
184 : IndexType Index = IndexType::Spacetime>
185 0 : using AbC = Tensor<
186 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
187 : index_list<
188 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
189 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
190 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
191 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
192 : IndexType Index = IndexType::Spacetime>
193 0 : using ABc = Tensor<
194 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
195 : index_list<
196 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
197 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
198 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
199 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
200 : IndexType Index = IndexType::Spacetime>
201 0 : using ABC = Tensor<
202 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
203 : index_list<
204 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
205 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
206 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
207 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
208 : IndexType Index = IndexType::Spacetime>
209 0 : using abb = Tensor<
210 : DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
211 : index_list<
212 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
213 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
214 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
215 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
216 : IndexType Index = IndexType::Spacetime>
217 0 : using Abb = Tensor<
218 : DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
219 : index_list<
220 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
221 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
222 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
223 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
224 : IndexType Index = IndexType::Spacetime>
225 0 : using aBB = Tensor<
226 : DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
227 : index_list<
228 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
229 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
230 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
231 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
232 : IndexType Index = IndexType::Spacetime>
233 0 : using ABB = Tensor<
234 : DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
235 : index_list<
236 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
237 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
238 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>>>;
239 :
240 : // Rank 3 - spatial
241 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
242 0 : using iii = Tensor<DataType, tmpl::integral_list<std::int32_t, 1, 1, 1>,
243 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
244 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
245 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
246 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
247 0 : using ijk = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
248 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
249 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
250 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
251 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
252 0 : using ijK = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
253 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
254 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
255 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
256 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
257 0 : using iJk = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
258 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
259 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
260 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
261 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
262 0 : using Ijk = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
263 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
264 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
265 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
266 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
267 0 : using iJK = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
268 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
269 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
270 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
271 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
272 0 : using IjK = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
273 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
274 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
275 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
276 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
277 0 : using IJk = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
278 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
279 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
280 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
281 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
282 0 : using IJK = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
283 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
284 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
285 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
286 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
287 0 : using ijj = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
288 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
289 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
290 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
291 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
292 0 : using Ijj = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
293 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
294 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
295 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
296 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
297 0 : using iJJ = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
298 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
299 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
300 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
301 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
302 0 : using IJJ = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
303 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
304 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
305 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
306 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
307 0 : using III = Tensor<DataType, tmpl::integral_list<std::int32_t, 1, 1, 1>,
308 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
309 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
310 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
311 :
312 : // Rank 3 - mixed spacetime spatial
313 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
314 0 : using iab = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
315 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
316 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
317 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
318 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
319 0 : using iaB = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
320 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
321 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
322 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>>>;
323 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
324 0 : using iAb = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
325 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
326 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>,
327 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
328 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
329 0 : using iAB = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1>,
330 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
331 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>,
332 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>>>;
333 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
334 0 : using iaa = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
335 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
336 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
337 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
338 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
339 0 : using aia = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1, 2>,
340 : index_list<SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
341 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
342 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
343 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
344 0 : using iAA = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
345 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
346 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>,
347 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>>>;
348 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
349 0 : using Iaa = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1, 1>,
350 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
351 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
352 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
353 :
354 : // Rank 4 - Mixed
355 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
356 0 : using ijaa = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1, 1>,
357 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
358 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
359 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
360 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
361 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
362 0 : using iiaa = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 2, 1, 1>,
363 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
364 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
365 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
366 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
367 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
368 0 : using iiAA = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 2, 1, 1>,
369 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
370 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
371 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>,
372 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>>>;
373 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
374 0 : using iAbb = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1, 1>,
375 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
376 : SpacetimeIndex<SpatialDim, UpLo::Up, Fr>,
377 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
378 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
379 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
380 0 : using iabb = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1, 1>,
381 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
382 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
383 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
384 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
385 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
386 0 : using Ijaa = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1, 1>,
387 : index_list<SpatialIndex<SpatialDim, UpLo::Up, Fr>,
388 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
389 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>,
390 : SpacetimeIndex<SpatialDim, UpLo::Lo, Fr>>>;
391 :
392 : // Rank 4 - generic (default spacetime)
393 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
394 : IndexType Index = IndexType::Spacetime>
395 0 : using abcc = Tensor<
396 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1, 1>,
397 : index_list<
398 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
399 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
400 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
401 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
402 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial,
403 : IndexType Index = IndexType::Spacetime>
404 0 : using aBcc = Tensor<
405 : DataType, tmpl::integral_list<std::int32_t, 3, 2, 1, 1>,
406 : index_list<
407 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
408 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Up, Fr, Index>,
409 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>,
410 : Tensor_detail::TensorIndexType<SpatialDim, UpLo::Lo, Fr, Index>>>;
411 :
412 : // Rank 4 - spatial
413 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
414 0 : using ijkk = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1, 1>,
415 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
416 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
417 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
418 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
419 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
420 0 : using iJkk = Tensor<DataType, tmpl::integral_list<std::int32_t, 3, 2, 1, 1>,
421 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
422 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
423 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
424 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>>>;
425 :
426 : template <typename DataType, size_t SpatialDim, typename Fr = Frame::Inertial>
427 0 : using iiJJ = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 2, 1, 1>,
428 : index_list<SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
429 : SpatialIndex<SpatialDim, UpLo::Lo, Fr>,
430 : SpatialIndex<SpatialDim, UpLo::Up, Fr>,
431 : SpatialIndex<SpatialDim, UpLo::Up, Fr>>>;
432 : } // namespace tnsr
433 :
434 : /*!
435 : * \brief Inverse Jacobian $(J^{-1})^\hat{i}_j =
436 : * \frac{\partial \xi^\hat{i}}{\partial x^j}$
437 : *
438 : * The first (upper) index is in the \p SourceFrame with coordinates
439 : * $\xi^\hat{i}$ (often "logical"), and the second (lower) index is in the
440 : * \p TargetFrame with coordinates $x^j$ (often "inertial").
441 : */
442 : template <typename DataType, size_t Dim, typename SourceFrame,
443 : typename TargetFrame>
444 1 : using InverseJacobian =
445 : Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
446 : index_list<SpatialIndex<Dim, UpLo::Up, SourceFrame>,
447 : SpatialIndex<Dim, UpLo::Lo, TargetFrame>>>;
448 :
449 : /*!
450 : * \brief Jacobian $J^i_\hat{j} = \frac{\partial x^i}{\partial \xi^\hat{j}}$
451 : *
452 : * The first (upper) index is in the \p TargetFrame with coordinates $x^i$
453 : * (often "inertial"), and the second (lower) index is in the \p SourceFrame
454 : * with coordinates $\xi^\hat{j}$ (often "logical").
455 : *
456 : * \note The indices produced by the `logical_partial_derivative` function
457 : * are in the opposite order.
458 : */
459 : template <typename DataType, size_t Dim, typename SourceFrame,
460 : typename TargetFrame>
461 1 : using Jacobian = Tensor<DataType, tmpl::integral_list<std::int32_t, 2, 1>,
462 : index_list<SpatialIndex<Dim, UpLo::Up, TargetFrame>,
463 : SpatialIndex<Dim, UpLo::Lo, SourceFrame>>>;
|