v0.14.0
Searching...
No Matches
Dg_and_Dg.hpp
Go to the documentation of this file.
1/* Subtracts a Dg from a Dg, yielding a
2 Tensor3_antisymmetric. */
3
4#pragma once
5
6namespace FTensor
7{
8 /* A(i,j,k)-B(i,k,j)->Tensor3_antisymmetric */
9
10 template <class A, class B, class T, class U, int Dim, char i, char j, char k>
12 {
15
16 public:
17 typename promote<T, U>::V
18 operator()(const int N1, const int N2, const int N3) const
19 {
20 return iterA(N1, N2, N3) - iterB(N1, N3, N2);
21 }
22
25 : iterA(a), iterB(b)
26 {}
27 };
28
29 template <class A, class B, class T, class U, int Dim, char i, char j, char k>
30 Tensor3_antisymmetric_Expr<Dg_and_Dg_12<A, B, T, U, Dim, i, j, k>,
31 typename promote<T, U>::V, Dim, Dim, i, j, k>
34 {
37 Dim, Dim, i, j, k>(TensorExpr(a, b));
38 }
39
40 /* A(i,j,k)-B(k,j,i)->Tensor3_antisymmetric */
41 /* We have to do a little index gymnastics here because a
42 Tensor3_antisymmetric is antisymmetric on the last two indices, not
43 the first and last index. */
44
45 template <class A, class B, class T, class U, int Dim, char i, char j, char k>
47 {
50
51 public:
52 typename promote<T, U>::V
53 operator()(const int N1, const int N2, const int N3) const
54 {
55 return iterA(N2, N1, N3) - iterB(N3, N1, N2);
56 }
57
60 : iterA(a), iterB(b)
61 {}
62 };
63
64 template <class A, class B, class T, class U, int Dim, char i, char j, char k>
65 Tensor3_antisymmetric_Expr<Dg_and_Dg_02<A, B, T, U, Dim, i, j, k>,
66 typename promote<T, U>::V, Dim, Dim, j, i, k>
69 {
72 Dim, Dim, j, i, k>(TensorExpr(a, b));
73 }
74}
static Number< 2 > N2
static Number< 1 > N1
constexpr double a
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Dg_and_Dg.hpp:53
Dg_Expr< A, T, Dim, Dim, i, j, k > iterA
Definition: Dg_and_Dg.hpp:48
Dg_and_Dg_02(const Dg_Expr< A, T, Dim, Dim, i, j, k > &a, const Dg_Expr< B, U, Dim, Dim, k, j, i > &b)
Definition: Dg_and_Dg.hpp:58
Dg_Expr< B, U, Dim, Dim, k, j, i > iterB
Definition: Dg_and_Dg.hpp:49
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Dg_and_Dg.hpp:18
Dg_Expr< B, U, Dim, Dim, i, k, j > iterB
Definition: Dg_and_Dg.hpp:14
Dg_Expr< A, T, Dim, Dim, i, j, k > iterA
Definition: Dg_and_Dg.hpp:13
Dg_and_Dg_12(const Dg_Expr< A, T, Dim, Dim, i, j, k > &a, const Dg_Expr< B, U, Dim, Dim, i, k, j > &b)
Definition: Dg_and_Dg.hpp:23
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
Riemann_Expr< Ddg_and_Ddg0321< A, B, T, U, Dim, i, j, k, l >, typename promote< T, U >::V, Dim, i, j, k, l > operator&&(const Ddg_Expr< A, T, Dim, Dim, i, k, j, l > &a, const Ddg_Expr< B, U, Dim, Dim, i, l, k, j > &b)
Definition: Ddg_and_Ddg.hpp:33