v0.14.0
Ddg_carat_Ddg.hpp
Go to the documentation of this file.
1 /* This file has all of the declarations for expressions like
2  Ddg^Ddg, yielding a Ddg. */
3 
4 #pragma once
5 
6 namespace FTensor
7 {
8  /* A(i,j,k,l)*B(j,l,m,n) */
9 
10  template <class A, class B, class T, class U, int Dim, int Dim23, char i,
11  char j, char k, char l, char m, char n>
13  {
16 
17  template <int Current_Dim0, int Current_Dim1>
18  typename promote<T, U>::V
19  eval(const int N1, const int N2, const int N3, const int N4,
20  const Number<Current_Dim0> &, const Number<Current_Dim1> &) const
21  {
22  return iterA(Current_Dim0 - 1, N1, Current_Dim1 - 1, N2)
23  * iterB(Current_Dim0 - 1, Current_Dim1 - 1, N3, N4)
24  + eval(N1, N2, N3, N4, Number<Current_Dim0 - 1>(),
26  }
27  template <int Current_Dim1>
28  typename promote<T, U>::V
29  eval(const int N1, const int N2, const int N3, const int N4,
30  const Number<1> &, const Number<Current_Dim1> &) const
31  {
32  return iterA(0, N1, Current_Dim1 - 1, N2)
33  * iterB(0, Current_Dim1 - 1, N3, N4)
34  + eval(N1, N2, N3, N4, Number<Dim>(), Number<Current_Dim1 - 1>());
35  }
36  typename promote<T, U>::V
37  eval(const int N1, const int N2, const int N3, const int N4,
38  const Number<1> &, const Number<1> &) const
39  {
40  return iterA(0, N1, 0, N2) * iterB(0, 0, N3, N4);
41  }
42 
43  public:
46  : iterA(a), iterB(b)
47  {}
48  typename promote<T, U>::V
49  operator()(const int N1, const int N2, const int N3, const int N4) const
50  {
51  return eval(N1, N2, N3, N4, Number<Dim>(), Number<Dim>());
52  }
53  };
54 
55  template <class A, class B, class T, class U, int Dim, int Dim23, char i,
56  char j, char k, char l, char m, char n>
57  Ddg_Expr<Ddg_carat_Ddg_13<A, B, T, U, Dim, Dim23, i, j, k, l, m, n>,
58  typename promote<T, U>::V, Dim, Dim23, i, k, m, n>
61  {
62  using TensorExpr
65  n>(TensorExpr(a, b));
66  }
67 }
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::Ddg_carat_Ddg_13::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Ddg_carat_Ddg.hpp:49
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
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Ddg_carat_Ddg_13::Ddg_carat_Ddg_13
Ddg_carat_Ddg_13(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:44
FTensor::Ddg_carat_Ddg_13::iterB
Ddg_Expr< B, U, Dim, Dim23, j, l, m, n > iterB
Definition: Ddg_carat_Ddg.hpp:15
FTensor::Ddg_carat_Ddg_13::iterA
Ddg_Expr< A, T, Dim, Dim, i, j, k, l > iterA
Definition: Ddg_carat_Ddg.hpp:14
FTensor::Ddg_carat_Ddg_13
Definition: Ddg_carat_Ddg.hpp:12
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
convert.n
n
Definition: convert.py:82
FTensor::Ddg_carat_Ddg_13::eval
promote< T, U >::V eval(const int N1, const int N2, const int N3, const int N4, const Number< 1 > &, const Number< Current_Dim1 > &) const
Definition: Ddg_carat_Ddg.hpp:29
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Ddg_carat_Ddg_13::eval
promote< T, U >::V eval(const int N1, const int N2, const int N3, const int N4, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &) const
Definition: Ddg_carat_Ddg.hpp:19
FTensor::Ddg_carat_Ddg_13::eval
promote< T, U >::V eval(const int N1, const int N2, const int N3, const int N4, const Number< 1 > &, const Number< 1 > &) const
Definition: Ddg_carat_Ddg.hpp:37
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
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