v0.14.0
Ddg_minus_Ddg.hpp
Go to the documentation of this file.
1 /* Subtracts Ddg-Ddg -> Ddg */
2 
3 #pragma once
4 
5 namespace FTensor
6 {
7  /* A(i,j,k,l) - B(i,j,k,l) */
8 
9  template <class A, class B, class T, class U, int Dim01, int Dim23, char i,
10  char j, 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, N2, N3, N4) - iterB(N1, N2, N3, N4);
21  }
22 
25  : iterA(a), iterB(b)
26  {}
27  };
28 
29  template <class A, class B, class T, class U, int Dim01, int Dim23, char i,
30  char j, char k, char l>
31  Ddg_Expr<Ddg_minus_Ddg<A, B, T, U, Dim01, Dim23, i, j, k, l>,
32  typename promote<T, U>::V, Dim01, Dim23, i, j, k, l>
35  {
37  return Ddg_Expr<TensorExpr, typename promote<T, U>::V, Dim01, Dim23, i, j,
38  k, l>(TensorExpr(a, b));
39  }
40 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Ddg_minus_Ddg::iterB
Ddg_Expr< B, U, Dim01, Dim23, i, j, k, l > iterB
Definition: Ddg_minus_Ddg.hpp:14
FTensor::Ddg_Expr
Definition: Ddg_Expr.hpp:28
FTensor::Ddg_minus_Ddg::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Ddg_minus_Ddg.hpp:18
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Ddg_minus_Ddg
Definition: Ddg_minus_Ddg.hpp:11
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Ddg_minus_Ddg::iterA
Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > iterA
Definition: Ddg_minus_Ddg.hpp:13
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::Ddg_minus_Ddg::Ddg_minus_Ddg
Ddg_minus_Ddg(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:23
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21