v0.14.0
Tensor2_symmetric_carat_Tensor2_symmetric.hpp
Go to the documentation of this file.
1 /* Multiply a Tensor2_symmetric cart a Tensor2_symmetric together and yieald DDg
2  * tensor. */
3 
4 /* A(i,j) ^ B(i,j) -> Ddg */
5 
6 #pragma once
7 
8 namespace FTensor {
9 
10 template <class A, class B, class T, class U, int Dim, char i, char j, char k,
11  char l>
15 
16  inline typename promote<T, U>::V eval(const int N1, const int N2,
17  const int N3, const int N4) const {
18  auto small_eval = [&](auto n1, auto n2, auto n3, auto n4) {
19  return iterA(n1, n3) * iterB(n2, n4);
20  };
21  return small_eval(N1, N2, N3, N4) + small_eval(N2, N1, N3, N4) +
22  small_eval(N1, N2, N4, N3) + small_eval(N2, N1, N4, N3);
23  }
24 
25 public:
29  : iterA(a), iterB(b) {}
30  typename promote<T, U>::V operator()(const int N1, const int N2, const int N3,
31  const int N4) const {
32  return eval(N1, N2, N3, N4);
33  }
34 };
35 
36 template <class A, class B, class T, class U, int Dim, char i, char j, char k,
37  char l>
38 Ddg_Expr<Tensor2_symmetric_carat_Tensor2_symmetric<A, B, T, U, Dim, i, j, k, l>,
39  typename promote<T, U>::V, Dim, Dim, i, j, k, l>
42  using TensorExpr =
45  TensorExpr(a, b));
46 }
47 
48 } // namespace FTensor
FTensor::operator^
Ddg_Expr< Ddg_carat_Ddg_13< A, B, T, U, Dim, Dim23, i, j, k, l, m, n >, typename promote< T, U >::V, Dim, Dim23, i, k, m, n > operator^(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Ddg_Expr< B, U, Dim, Dim23, j, l, m, n > &b)
Definition: Ddg_carat_Ddg.hpp:59
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor2_symmetric_carat_Tensor2_symmetric::eval
promote< T, U >::V eval(const int N1, const int N2, const int N3, const int N4) const
Definition: Tensor2_symmetric_carat_Tensor2_symmetric.hpp:16
FTensor::Tensor2_symmetric_carat_Tensor2_symmetric::Tensor2_symmetric_carat_Tensor2_symmetric
Tensor2_symmetric_carat_Tensor2_symmetric(const Tensor2_symmetric_Expr< A, T, Dim, i, k > &a, const Tensor2_symmetric_Expr< B, U, Dim, j, l > &b)
Definition: Tensor2_symmetric_carat_Tensor2_symmetric.hpp:26
FTensor::Tensor2_symmetric_Expr< A, T, Dim, i, k >
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Ddg_Expr
Definition: Ddg_Expr.hpp:28
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Tensor2_symmetric_carat_Tensor2_symmetric::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Tensor2_symmetric_carat_Tensor2_symmetric.hpp:30
FTensor::Tensor2_symmetric_carat_Tensor2_symmetric::iterB
const Tensor2_symmetric_Expr< B, T, Dim, j, l > iterB
Definition: Tensor2_symmetric_carat_Tensor2_symmetric.hpp:14
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::Tensor2_symmetric_carat_Tensor2_symmetric
Definition: Tensor2_symmetric_carat_Tensor2_symmetric.hpp:12
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
FTensor::Tensor2_symmetric_carat_Tensor2_symmetric::iterA
const Tensor2_symmetric_Expr< A, T, Dim, i, k > iterA
Definition: Tensor2_symmetric_carat_Tensor2_symmetric.hpp:13
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21