v0.14.0
Ddg_carat_Tensor2_symmetric.hpp
Go to the documentation of this file.
1 /* This file has all of the declarations for expressions like
2  Ddg^Tensor2_symmetric and Tensor2_symmetric^Ddg,
3  yielding a Tensor2_symmetric. */
4 
5 #pragma once
6 
7 namespace FTensor
8 {
9  /* A(i,j,k,l)*B(j,l) */
10 
11  template <class A, class B, class T, class U, int Dim, char i, char j,
12  char k, char l>
14  {
17 
18  template <int Current_Dim0, int Current_Dim1>
19  typename promote<T, U>::V
20  eval(const int N1, const int N2, const Number<Current_Dim0> &,
21  const Number<Current_Dim1> &) const
22  {
23  return iterA(Current_Dim0 - 1, N1, Current_Dim1 - 1, N2)
24  * iterB(Current_Dim0 - 1, Current_Dim1 - 1)
25  + eval(N1, N2, Number<Current_Dim0 - 1>(),
27  }
28  template <int Current_Dim1>
29  typename promote<T, U>::V
30  eval(const int N1, const int N2, const Number<1> &,
31  const Number<Current_Dim1> &) const
32  {
33  return iterA(0, N1, Current_Dim1 - 1, N2) * iterB(0, Current_Dim1 - 1)
35  }
36  typename promote<T, U>::V eval(const int N1, const int N2,
37  const Number<1> &, const Number<1> &) const
38  {
39  return iterA(0, N1, 0, N2) * iterB(0, 0);
40  }
41 
42  public:
46  : iterA(a), iterB(b)
47  {}
48  typename promote<T, U>::V operator()(const int N1, const int N2) const
49  {
50  return eval(N1, N2, Number<Dim>(), Number<Dim>());
51  }
52  };
53 
54  template <class A, class B, class T, class U, int Dim, char i, char j,
55  char k, char l>
56  Tensor2_symmetric_Expr<
57  Ddg_carat_Tensor2_symmetric_13<A, B, T, U, Dim, i, j, k, l>,
58  typename promote<T, U>::V, Dim, i, k>
61  {
62  using TensorExpr
65  i, k>(TensorExpr(a, b));
66  }
67 
68  /* B(j,l)*A(i,j,k,l) */
69 
70  template <class A, class B, class T, class U, int Dim, char i, char j,
71  char k, char l>
72  Tensor2_symmetric_Expr<
73  Ddg_carat_Tensor2_symmetric_13<A, B, T, U, Dim, i, j, k, l>,
74  typename promote<T, U>::V, Dim, i, k>
77  {
78  using TensorExpr
81  i, k>(TensorExpr(a, b));
82  }
83 }
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::Ddg_carat_Tensor2_symmetric_13::iterA
Ddg_Expr< A, T, Dim, Dim, i, j, k, l > iterA
Definition: Ddg_carat_Tensor2_symmetric.hpp:15
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor2_symmetric_Expr< B, U, Dim, j, l >
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Ddg_Expr< A, T, Dim, Dim, i, j, k, l >
FTensor::Number
Definition: Number.hpp:11
FTensor::Ddg_carat_Tensor2_symmetric_13::eval
promote< T, U >::V eval(const int N1, const int N2, const Number< 1 > &, const Number< 1 > &) const
Definition: Ddg_carat_Tensor2_symmetric.hpp:36
FTensor::Ddg_carat_Tensor2_symmetric_13::eval
promote< T, U >::V eval(const int N1, const int N2, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &) const
Definition: Ddg_carat_Tensor2_symmetric.hpp:20
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::Ddg_carat_Tensor2_symmetric_13::iterB
Tensor2_symmetric_Expr< B, U, Dim, j, l > iterB
Definition: Ddg_carat_Tensor2_symmetric.hpp:16
FTensor::Ddg_carat_Tensor2_symmetric_13::eval
promote< T, U >::V eval(const int N1, const int N2, const Number< 1 > &, const Number< Current_Dim1 > &) const
Definition: Ddg_carat_Tensor2_symmetric.hpp:30
FTensor::Ddg_carat_Tensor2_symmetric_13
Definition: Ddg_carat_Tensor2_symmetric.hpp:13
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Ddg_carat_Tensor2_symmetric_13::operator()
promote< T, U >::V operator()(const int N1, const int N2) const
Definition: Ddg_carat_Tensor2_symmetric.hpp:48
FTensor::Ddg_carat_Tensor2_symmetric_13::Ddg_carat_Tensor2_symmetric_13
Ddg_carat_Tensor2_symmetric_13(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Tensor2_symmetric_Expr< B, U, Dim, j, l > &b)
Definition: Ddg_carat_Tensor2_symmetric.hpp:43
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