v0.15.0
Loading...
Searching...
No Matches
Tensor3_antisymmetric_times_Tensor3.hpp
Go to the documentation of this file.
1/* Fully contracts a Tensor3_antisymmetric with a Tensor3, yielding a
2 typename promote<T,U>::V. I removed the identically zero components of
3 Tensor3_antisymmetric.*/
4
5#pragma once
6
7namespace FTensor
8{
9 /* A(i,j,k)*B(i,j,k) */
10
11 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
12 char j, char k, int Current_Dim0, int Current_Dim1,
13 int Current_Dim2>
19 {
20 return a(Current_Dim0 - 1, Current_Dim1 - 1, Current_Dim2 - 1)
21 * b(Current_Dim0 - 1, Current_Dim1 - 1, Current_Dim2 - 1)
25 }
26
27 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
28 char j, char k, int Current_Dim0, int Current_Dim2>
32 const Number<Current_Dim0> &, const Number<1> &,
34 {
35 return a(Current_Dim0 - 1, 0, Current_Dim2 - 1)
36 * b(Current_Dim0 - 1, 0, Current_Dim2 - 1)
39 }
40
41 /* A special case for when the last two indices are equal. */
42
43 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
44 char j, char k, int Current_Dim0, int Current_Dim2>
55
56 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
57 char j, char k, int Current_Dim0>
61 const Number<Current_Dim0> &, const Number<2> &, const Number<1> &)
62 {
63 return a(Current_Dim0 - 1, 1, 0) * b(Current_Dim0 - 1, 1, 0)
66 }
67
68 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
69 char j, char k>
73 const Number<1> &, const Number<2> &, const Number<1> &)
74 {
75 return a(0, 1, 0) * b(0, 1, 0);
76 }
77
78 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
79 char j, char k>
80 typename promote<T, U>::V
87
88 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
89 char j, char k>
90 typename promote<T, U>::V
96
97 /* A(i,j,k)*B(k,i,j) */
98
99 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
100 char j, char k, int Current_Dim0, int Current_Dim1,
101 int Current_Dim2>
106 const Number<Current_Dim2> &)
107 {
108 return a(Current_Dim0 - 1, Current_Dim1 - 1, Current_Dim2 - 1)
109 * b(Current_Dim2 - 1, Current_Dim0 - 1, Current_Dim1 - 1)
113 }
114
115 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
116 char j, char k, int Current_Dim0, int Current_Dim2>
120 const Number<Current_Dim0> &, const Number<1> &,
121 const Number<Current_Dim2> &)
122 {
123 return a(Current_Dim0 - 1, 0, Current_Dim2 - 1)
124 * b(Current_Dim2 - 1, Current_Dim0 - 1, 0)
127 }
128
129 /* A special case for when the last two indices are equal. */
130
131 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
132 char j, char k, int Current_Dim0, int Current_Dim2>
143
144 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
145 char j, char k, int Current_Dim0>
149 const Number<Current_Dim0> &, const Number<2> &, const Number<1> &)
150 {
151 return a(Current_Dim0 - 1, 1, 0) * b(0, Current_Dim0 - 1, 1)
154 }
155
156 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
157 char j, char k>
161 const Number<1> &, const Number<2> &, const Number<1> &)
162 {
163 return a(0, 1, 0) * b(0, 0, 1);
164 }
165
166 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
167 char j, char k>
168 typename promote<T, U>::V
175
176 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
177 char j, char k>
178 typename promote<T, U>::V
184
185 /* A(i,j,k)*B(j,k,i) */
186
187 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
188 char j, char k, int Current_Dim0, int Current_Dim1,
189 int Current_Dim2>
194 const Number<Current_Dim2> &)
195 {
196 return a(Current_Dim0 - 1, Current_Dim1 - 1, Current_Dim2 - 1)
197 * b(Current_Dim1 - 1, Current_Dim2 - 1, Current_Dim0 - 1)
201 }
202
203 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
204 char j, char k, int Current_Dim0, int Current_Dim2>
208 const Number<Current_Dim0> &, const Number<1> &,
209 const Number<Current_Dim2> &)
210 {
211 return a(Current_Dim0 - 1, 0, Current_Dim2 - 1)
212 * b(0, Current_Dim2 - 1, Current_Dim0 - 1)
215 }
216
217 /* A special case for when the last two indices are equal. */
218
219 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
220 char j, char k, int Current_Dim0, int Current_Dim2>
231
232 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
233 char j, char k, int Current_Dim0>
237 const Number<Current_Dim0> &, const Number<2> &, const Number<1> &)
238 {
239 return a(Current_Dim0 - 1, 1, 0) * b(1, 0, Current_Dim0 - 1)
242 }
243
244 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
245 char j, char k>
249 const Number<1> &, const Number<2> &, const Number<1> &)
250 {
251 return a(0, 1, 0) * b(1, 0, 0);
252 }
253
254 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
255 char j, char k>
256 typename promote<T, U>::V
263
264 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
265 char j, char k>
266 typename promote<T, U>::V
272
273 /* A(i,j,k)*B(j,i,k) */
274
275 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
276 char j, char k, int Current_Dim0, int Current_Dim1,
277 int Current_Dim2>
282 const Number<Current_Dim2> &)
283 {
284 return a(Current_Dim0 - 1, Current_Dim1 - 1, Current_Dim2 - 1)
285 * b(Current_Dim1 - 1, Current_Dim0 - 1, Current_Dim2 - 1)
289 }
290
291 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
292 char j, char k, int Current_Dim0, int Current_Dim2>
296 const Number<Current_Dim0> &, const Number<1> &,
297 const Number<Current_Dim2> &)
298 {
299 return a(Current_Dim0 - 1, 0, Current_Dim2 - 1)
300 * b(0, Current_Dim0 - 1, Current_Dim2 - 1)
303 }
304
305 /* A special case for when the last two indices are equal. */
306
307 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
308 char j, char k, int Current_Dim0, int Current_Dim2>
319
320 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
321 char j, char k, int Current_Dim0>
325 const Number<Current_Dim0> &, const Number<2> &, const Number<1> &)
326 {
327 return a(Current_Dim0 - 1, 1, 0) * b(1, Current_Dim0 - 1, 0)
330 }
331
332 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
333 char j, char k>
337 const Number<1> &, const Number<2> &, const Number<1> &)
338 {
339 return a(0, 1, 0) * b(1, 0, 0);
340 }
341
342 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
343 char j, char k>
344 typename promote<T, U>::V
351
352 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
353 char j, char k>
354 typename promote<T, U>::V
360
361 /* A(i,j,k)*B(k,j,i) */
362
363 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
364 char j, char k, int Current_Dim0, int Current_Dim1,
365 int Current_Dim2>
370 const Number<Current_Dim2> &)
371 {
372 return a(Current_Dim0 - 1, Current_Dim1 - 1, Current_Dim2 - 1)
373 * b(Current_Dim2 - 1, Current_Dim1 - 1, Current_Dim0 - 1)
377 }
378
379 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
380 char j, char k, int Current_Dim0, int Current_Dim2>
384 const Number<Current_Dim0> &, const Number<1> &,
385 const Number<Current_Dim2> &)
386 {
387 return a(Current_Dim0 - 1, 0, Current_Dim2 - 1)
388 * b(Current_Dim2 - 1, 0, Current_Dim0 - 1)
391 }
392
393 /* A special case for when the last two indices are equal. */
394
395 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
396 char j, char k, int Current_Dim0, int Current_Dim2>
407
408 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
409 char j, char k, int Current_Dim0>
413 const Number<Current_Dim0> &, const Number<2> &, const Number<1> &)
414 {
415 return a(Current_Dim0 - 1, 1, 0) * b(0, 1, Current_Dim0 - 1)
418 }
419
420 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
421 char j, char k>
425 const Number<1> &, const Number<2> &, const Number<1> &)
426 {
427 return a(0, 1, 0) * b(0, 1, 0);
428 }
429
430 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
431 char j, char k>
432 typename promote<T, U>::V
439
440 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
441 char j, char k>
442 typename promote<T, U>::V
448
449 /* A(i,j,k)*B(i,k,j) */
450
451 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
452 char j, char k, int Current_Dim0, int Current_Dim1,
453 int Current_Dim2>
458 const Number<Current_Dim2> &)
459 {
460 return a(Current_Dim0 - 1, Current_Dim1 - 1, Current_Dim2 - 1)
461 * b(Current_Dim0 - 1, Current_Dim2 - 1, Current_Dim1 - 1)
465 }
466
467 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
468 char j, char k, int Current_Dim0, int Current_Dim2>
472 const Number<Current_Dim0> &, const Number<1> &,
473 const Number<Current_Dim2> &)
474 {
475 return a(Current_Dim0 - 1, 0, Current_Dim2 - 1)
476 * b(Current_Dim0 - 1, Current_Dim2 - 1, 0)
479 }
480
481 /* A special case for when the last two indices are equal. */
482
483 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
484 char j, char k, int Current_Dim0, int Current_Dim2>
495
496 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
497 char j, char k, int Current_Dim0>
501 const Number<Current_Dim0> &, const Number<2> &, const Number<1> &)
502 {
503 return a(Current_Dim0 - 1, 1, 0) * b(Current_Dim0 - 1, 0, 1)
506 }
507
508 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
509 char j, char k>
513 const Number<1> &, const Number<2> &, const Number<1> &)
514 {
515 return a(0, 1, 0) * b(0, 0, 1);
516 }
517
518 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
519 char j, char k>
520 typename promote<T, U>::V
527
528 template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
529 char j, char k>
530 typename promote<T, U>::V
536}
constexpr double a
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
Tensors class implemented by Walter Landry.
Definition FTensor.hpp:51
promote< T, U >::V T3as_times_T3_120(const Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > &a, const Tensor3_Expr< B, U, Dim0, Dim12, Dim12, j, k, i > &b, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &)
promote< T, U >::V T3as_times_T3_201(const Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > &a, const Tensor3_Expr< B, U, Dim0, Dim12, Dim12, k, i, j > &b, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &)
promote< T, U >::V T3as_times_T3_210(const Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > &a, const Tensor3_Expr< B, U, Dim0, Dim12, Dim12, k, j, i > &b, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &)
promote< T, U >::V operator*(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Ddg_Expr< B, U, Dim, Dim, i, k, j, l > &b)
promote< T, U >::V T3as_times_T3_012(const Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > &a, const Tensor3_Expr< B, U, Dim0, Dim12, Dim12, i, j, k > &b, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &)
promote< T, U >::V T3as_times_T3_102(const Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > &a, const Tensor3_Expr< B, U, Dim0, Dim12, Dim12, j, i, k > &b, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &)
constexpr AssemblyType A