v0.14.0
Ddg_or_Ddg.hpp
Go to the documentation of this file.
1 /* Declares expressions of Ddg || Ddg. This adds them in
2  a different way, but still ending up with a Ddg. */
3 
4 #pragma once
5 
6 namespace FTensor
7 {
8  /* A(i,j,k,l)+B(i,l,k,j) -> Ddg */
9 
10  template <class A, class B, class T, class U, int Dim, char i, char j,
11  char k, char l>
12  class Ddg_or_Ddg
13  {
16 
17  public:
18  typename promote<T, U>::V
19  operator()(const int N1, const int N2, const int N3, const int N4) const
20  {
21  return iterA(N1, N3, N2, N4) + iterB(N1, N4, N2, N3);
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  Ddg_Expr<Ddg_or_Ddg<A, B, T, U, Dim, i, j, k, l>, typename promote<T, U>::V,
32  Dim, Dim, i, k, j, l>
35  {
36  using TensorExpr = Ddg_or_Ddg<A, B, T, U, Dim, i, j, k, l>;
38  l>(TensorExpr(a, b));
39  }
40 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Ddg_or_Ddg::iterA
Ddg_Expr< A, T, Dim, Dim, i, j, k, l > iterA
Definition: Ddg_or_Ddg.hpp:14
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Ddg_Expr< A, T, Dim, Dim, i, j, k, l >
FTensor::operator||
Ddg_Expr< Ddg_or_Ddg< A, B, T, U, Dim, i, j, k, l >, typename promote< T, U >::V, Dim, Dim, i, k, j, l > operator||(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Ddg_Expr< B, U, Dim, Dim, i, l, k, j > &b)
Definition: Ddg_or_Ddg.hpp:33
FTensor::Ddg_or_Ddg::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Ddg_or_Ddg.hpp:19
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Ddg_or_Ddg::Ddg_or_Ddg
Ddg_or_Ddg(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Ddg_Expr< B, U, Dim, Dim, i, l, k, j > &b)
Definition: Ddg_or_Ddg.hpp:23
FTensor::Ddg_or_Ddg::iterB
Ddg_Expr< B, U, Dim, Dim, i, l, k, j > iterB
Definition: Ddg_or_Ddg.hpp:15
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Ddg_or_Ddg
Definition: Ddg_or_Ddg.hpp:12
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
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