v0.14.0
Dg_minus_Dg.hpp
Go to the documentation of this file.
1 /* Subtracts a Dg from a Dg, yielding a Dg or
2  Tensor3. */
3 
4 #pragma once
5 
6 namespace FTensor
7 {
8  /* A(i,j,k)-B(i,j,k)->Dg */
9 
10  template <class A, class B, class T, class U, int Dim01, int Dim2, 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 
26  : iterA(a), iterB(b)
27  {}
28  };
29 
30  template <class A, class B, class T, class U, int Dim01, int Dim2, char i,
31  char j, char k>
32  Dg_Expr<Dg_minus_Dg<A, B, T, U, Dim01, Dim2, i, j, k>,
33  typename promote<T, U>::V, Dim01, Dim2, i, j, k>
36  {
38  return Dg_Expr<TensorExpr, typename promote<T, U>::V, Dim01, Dim2, i, j, k>(
39  TensorExpr(a, b));
40  }
41 
42  /* A(i,j,k)-B(k,j,i)->Tensor3 */
43 
44  template <class A, class B, class T, class U, int Dim, char i, char j, char k>
46  {
49 
50  public:
51  typename promote<T, U>::V
52  operator()(const int N1, const int N2, const int N3) const
53  {
54  return iterA(N1, N2, N3) - iterB(N3, N2, N1);
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, char k>
64  Tensor3_Expr<Dg_minus_Dg_02<A, B, T, U, Dim, i, j, k>,
65  typename promote<T, U>::V, Dim, Dim, Dim, i, j, k>
68  {
71  i, j, k>(TensorExpr(a, b));
72  }
73 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Dg_minus_Dg_02::Dg_minus_Dg_02
Dg_minus_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_minus_Dg.hpp:57
FTensor::Dg_minus_Dg::iterA
Dg_Expr< A, T, Dim01, Dim2, i, j, k > iterA
Definition: Dg_minus_Dg.hpp:14
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Dg_minus_Dg_02
Definition: Dg_minus_Dg.hpp:45
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Dg_minus_Dg::Dg_minus_Dg
Dg_minus_Dg(const Dg_Expr< A, T, Dim01, Dim2, i, j, k > &a, const Dg_Expr< B, U, Dim01, Dim2, i, j, k > &b)
Definition: Dg_minus_Dg.hpp:24
FTensor::Tensor3_Expr
Definition: Tensor3_Expr.hpp:24
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Dg_Expr
Definition: Dg_Expr.hpp:25
FTensor::operator-
Ddg_Expr< Ddg_minus_Ddg< A, B, T, U, Dim01, Dim23, i, j, k, l >, typename promote< T, U >::V, Dim01, Dim23, i, j, k, l > operator-(const Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > &a, const Ddg_Expr< B, U, Dim01, Dim23, i, j, k, l > &b)
Definition: Ddg_minus_Ddg.hpp:33
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Dg_minus_Dg::iterB
Dg_Expr< B, U, Dim01, Dim2, i, j, k > iterB
Definition: Dg_minus_Dg.hpp:15
FTensor::Dg_minus_Dg_02::iterB
Dg_Expr< B, U, Dim, Dim, k, j, i > iterB
Definition: Dg_minus_Dg.hpp:48
FTensor::Dg_minus_Dg_02::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Dg_minus_Dg.hpp:52
FTensor::Dg_minus_Dg::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Dg_minus_Dg.hpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
FTensor::Dg_minus_Dg_02::iterA
Dg_Expr< A, T, Dim, Dim, i, j, k > iterA
Definition: Dg_minus_Dg.hpp:47
FTensor::Dg_minus_Dg
Definition: Dg_minus_Dg.hpp:12