v0.14.0
Ddg_and_Ddg.hpp
Go to the documentation of this file.
1 /* Subtracts Ddg-Ddg -> Riemann */
2 
3 #pragma once
4 
5 namespace FTensor
6 {
7  /* A(i,j,k,l) - B(i,l,k,j) */
8 
9  template <class A, class B, class T, class U, int Dim, char i, char j,
10  char k, char l>
12  {
15 
16  public:
17  typename promote<T, U>::V
18  operator()(const int N1, const int N2, const int N3, const int N4) const
19  {
20  return iterA(N1, N3, N2, N4) - iterB(N1, N4, 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,
30  char k, char l>
31  Riemann_Expr<Ddg_and_Ddg0321<A, B, T, U, Dim, i, j, k, l>,
32  typename promote<T, U>::V, Dim, i, j, k, l>
35  {
38  TensorExpr(a, b));
39  }
40 
41  /* A(i,k,l,j) - B(i,l,k,j) */
42 
43  template <class A, class B, class T, class U, int Dim, char i, char j,
44  char k, char l>
46  {
49 
50  public:
51  typename promote<T, U>::V
52  operator()(const int N1, const int N2, const int N3, const int N4) const
53  {
54  return iterA(N1, N3, N4, N2) - iterB(N1, N4, N3, N2);
55  }
56 
59  : iterA(a), iterB(b)
60  {}
61  };
62 
63  template <class A, class B, class T, class U, int Dim, char i, char j,
64  char k, char l>
65  Riemann_Expr<Ddg_and_Ddg0213<A, B, T, U, Dim, i, j, k, l>,
66  typename promote<T, U>::V, Dim, i, j, k, l>
69  {
72  TensorExpr(a, b));
73  }
74 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Ddg_and_Ddg0213::Ddg_and_Ddg0213
Ddg_and_Ddg0213(const Ddg_Expr< A, T, Dim, Dim, i, k, l, j > &a, const Ddg_Expr< B, U, Dim, Dim, i, l, k, j > &b)
Definition: Ddg_and_Ddg.hpp:57
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Ddg_Expr< A, T, Dim, Dim, i, k, j, l >
FTensor::Ddg_and_Ddg0213::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Ddg_and_Ddg.hpp:52
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Riemann_Expr
Definition: Riemann_Expr.hpp:15
FTensor::operator&&
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
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Ddg_and_Ddg0321::Ddg_and_Ddg0321
Ddg_and_Ddg0321(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:23
FTensor::Ddg_and_Ddg0321::iterA
Ddg_Expr< A, T, Dim, Dim, i, k, j, l > iterA
Definition: Ddg_and_Ddg.hpp:13
FTensor::Ddg_and_Ddg0213::iterA
Ddg_Expr< A, T, Dim, Dim, i, k, l, j > iterA
Definition: Ddg_and_Ddg.hpp:47
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Ddg_and_Ddg0321::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Ddg_and_Ddg.hpp:18
FTensor::Ddg_and_Ddg0321
Definition: Ddg_and_Ddg.hpp:11
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
FTensor::Ddg_and_Ddg0213::iterB
Ddg_Expr< B, U, Dim, Dim, i, l, k, j > iterB
Definition: Ddg_and_Ddg.hpp:48
FTensor::Ddg_and_Ddg0321::iterB
Ddg_Expr< B, U, Dim, Dim, i, l, k, j > iterB
Definition: Ddg_and_Ddg.hpp:14
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
FTensor::Ddg_and_Ddg0213
Definition: Ddg_and_Ddg.hpp:45