v0.14.0
Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp
Go to the documentation of this file.
1 /* Adds two Tensor3_antisymmetric's together, yielding a
2  Tensor3_antisymmetric. */
3 
4 #pragma once
5 
6 namespace FTensor
7 {
8  /* A(i,j,k) + B(i,j,k) */
9 
10  template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
11  char j, char k>
13  {
16 
17  public:
18  typename promote<T, U>::V
19  operator()(const int N1, const int N2, const int N3) const
20  {
21  return iterA(N1, N2, N3) + iterB(N1, N2, N3);
22  }
23 
27  : iterA(a), iterB(b)
28  {}
29  };
30 
31  template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
32  char j, char k>
33  Tensor3_antisymmetric_Expr<Tensor3_antisymmetric_plus_Tensor3_antisymmetric<
34  A, B, T, U, Dim0, Dim12, i, j, k>,
35  typename promote<T, U>::V, Dim0, Dim12, i, j, k>
38  {
39  using TensorExpr
41  Dim12, i, j, k>;
43  Dim0, Dim12, i, j, k>(TensorExpr(a, b));
44  }
45 
46  /* A(i,j,k) + B(i,k,j) (which simplifies to A(i,j,k) - B(i,j,k)) */
47 
48  template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
49  char j, char k>
51  {
54 
55  public:
56  typename promote<T, U>::V
57  operator()(const int N1, const int N2, const int N3) const
58  {
59  return iterA(N1, N2, N3) - iterB(N1, N2, N3);
60  }
61 
65  : iterA(a), iterB(b)
66  {}
67  };
68 
69  template <class A, class B, class T, class U, int Dim0, int Dim12, char i,
70  char j, char k>
71  Tensor3_antisymmetric_Expr<
72  Tensor3_antisymmetric_plus_Tensor3_antisymmetric_12<A, B, T, U, Dim0,
73  Dim12, i, j, k>,
74  typename promote<T, U>::V, Dim0, Dim12, i, j, k>
77  {
78  using TensorExpr
80  Dim12, i, j, k>;
82  Dim0, Dim12, i, j, k>(TensorExpr(a, b));
83  }
84 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric_12
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:50
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric::iterB
Tensor3_antisymmetric_Expr< B, U, Dim0, Dim12, i, j, k > iterB
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:15
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric_12::iterA
Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > iterA
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:52
FTensor::Tensor3_antisymmetric_Expr
Definition: Tensor3_antisymmetric_Expr.hpp:18
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:19
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric_12::Tensor3_antisymmetric_plus_Tensor3_antisymmetric_12
Tensor3_antisymmetric_plus_Tensor3_antisymmetric_12(const Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > &a, const Tensor3_antisymmetric_Expr< B, U, Dim0, Dim12, i, k, j > &b)
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:62
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric::iterA
Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > iterA
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:14
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:12
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric_12::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:57
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric_12::iterB
Tensor3_antisymmetric_Expr< B, U, Dim0, Dim12, i, k, j > iterB
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:53
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::operator+
Ddg_Expr< Ddg_plus_Ddg< A, B, T, U, Dim01_0, Dim23_0, Dim01_1, Dim23_1, i0, j0, k0, l0, i1, j1, k1, l1 >, typename promote< T, U >::V, Dim01_0, Dim23_0, i0, j0, k0, l0 > operator+(const Ddg_Expr< A, T, Dim01_0, Dim23_0, i0, j0, k0, l0 > &a, const Ddg_Expr< B, U, Dim01_1, Dim23_1, i1, j1, k1, l1 > &b)
Definition: Ddg_plus_Ddg.hpp:66
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
FTensor::Tensor3_antisymmetric_plus_Tensor3_antisymmetric::Tensor3_antisymmetric_plus_Tensor3_antisymmetric
Tensor3_antisymmetric_plus_Tensor3_antisymmetric(const Tensor3_antisymmetric_Expr< A, T, Dim0, Dim12, i, j, k > &a, const Tensor3_antisymmetric_Expr< B, U, Dim0, Dim12, i, j, k > &b)
Definition: Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp:24