v0.14.0
Ddg_mod_Tensor2_symmetric.hpp
Go to the documentation of this file.
1 /* Divide a Ddg by a Tensor2_symmetric without contracting, yielding a
2  Ddg. */
3 
4 #pragma once
5 
6 namespace FTensor
7 {
8  /* Base Template */
9  template <class A, class B, class T, class U, int Dim01_0, int Dim23_0,
10  int Dim_1, char i0, char j0, char k0, char l0, char i1, char j1>
12  {};
13 
14  /* A(i,j,k,l) % B(i,j) -> Ddg */
15 
16  template <class A, class B, class T, class U, int Dim01, int Dim23, char i,
17  char j, char k, char l>
18  class Ddg_mod_Tensor2_symmetric<A, B, T, U, Dim01, Dim23, Dim01, i, j, k, l,
19  i, j>
20  {
23 
24  public:
25  typename promote<T, U>::V
26  operator()(const int N1, const int N2, const int N3, const int N4) const
27  {
28  return iterA(N1, N2, N3, N4) / iterB(N1, N2);
29  }
30 
34  : iterA(a), iterB(b)
35  {}
36  };
37 
38  /* B(i,j) % A(i,j,k,l) -> Ddg */
39 
40  /* A(i,j,k,l) % B(k,l) -> Ddg */
41 
42  template <class A, class B, class T, class U, int Dim01, int Dim23, char i,
43  char j, char k, char l>
44  class Ddg_mod_Tensor2_symmetric<A, B, T, U, Dim01, Dim23, Dim23, i, j, k, l,
45  k, l>
46  {
49 
50  public:
51  typename promote<T, U>::V
52  operator()(const int N1, const int N2, const int N3, const int N4) const
53  {
54  return iterA(N1, N2, N3, N4) / iterB(N3, N4);
55  }
56 
60  : iterA(a), iterB(b)
61  {}
62  };
63 
64  template <class A, class B, class T, class U, int Dim01_0, int Dim23_0,
65  int Dim_1, char i0, char j0, char k0, char l0, char i1, char j1>
66  Ddg_Expr<Ddg_mod_Tensor2_symmetric<A, B, T, U, Dim01_0, Dim23_0, Dim_1, i0,
67  j0, k0, l0, i1, j1>,
68  typename promote<T, U>::V, Dim01_0, Dim23_0, i0, j0, k0, l0>
71  {
72  using TensorExpr
73  = Ddg_mod_Tensor2_symmetric<A, B, T, U, Dim01_0, Dim23_0, Dim_1, i0, j0,
74  k0, l0, i1, j1>;
75  static_assert(
76  !std::is_empty<TensorExpr>::value,
77  "Indexes or Dimensions are not compatible with the % operator");
78  return Ddg_Expr<TensorExpr, typename promote<T, U>::V, Dim01_0, Dim23_0,
79  i0, j0, k0, l0>(TensorExpr(a, b));
80  }
81 
82  /* B(k,l) % A(i,j,k,l) -> Ddg */
83 
84  template <class A, class B, class T, class U, int Dim01_0, int Dim23_0,
85  int Dim_1, char i0, char j0, char k0, char l0, char i1, char j1>
86  Ddg_Expr<Ddg_mod_Tensor2_symmetric<A, B, T, U, Dim01_0, Dim23_0, Dim_1, i0,
87  j0, k0, l0, i1, j1>,
88  typename promote<T, U>::V, Dim01_0, Dim23_0, i0, j0, k0, l0>
91  {
92  using TensorExpr
93  = Ddg_mod_Tensor2_symmetric<A, B, T, U, Dim01_0, Dim23_0, Dim_1, i0, j0,
94  k0, l0, i1, j1>;
95  static_assert(
96  !std::is_empty<TensorExpr>::value,
97  "Indexes or Dimensions are not compatible with the % operator");
98  return Ddg_Expr<TensorExpr, typename promote<T, U>::V, Dim01_0, Dim23_0,
99  i0, j0, k0, l0>(TensorExpr(a, b));
100  }
101 }
FTensor::Ddg_mod_Tensor2_symmetric< A, B, T, U, Dim01, Dim23, Dim01, i, j, k, l, i, j >::Ddg_mod_Tensor2_symmetric
Ddg_mod_Tensor2_symmetric(const Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > &a, const Tensor2_symmetric_Expr< B, U, Dim01, i, j > &b)
Definition: Ddg_mod_Tensor2_symmetric.hpp:31
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::operator%
Riemann_Expr< Ddg_mod_Ddg< A, B, T, U, Dim, i, j, k, l >, typename promote< T, U >::V, Dim, i, j, k, 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_mod_Ddg.hpp:33
FTensor::Tensor2_symmetric_Expr< B, U, Dim01, i, j >
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Ddg_Expr
Definition: Ddg_Expr.hpp:28
FTensor::Ddg_mod_Tensor2_symmetric< A, B, T, U, Dim01, Dim23, Dim23, i, j, k, l, k, l >::iterB
Tensor2_symmetric_Expr< B, U, Dim23, k, l > iterB
Definition: Ddg_mod_Tensor2_symmetric.hpp:48
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Ddg_mod_Tensor2_symmetric< A, B, T, U, Dim01, Dim23, Dim01, i, j, k, l, i, j >::iterB
Tensor2_symmetric_Expr< B, U, Dim01, i, j > iterB
Definition: Ddg_mod_Tensor2_symmetric.hpp:22
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Ddg_mod_Tensor2_symmetric< A, B, T, U, Dim01, Dim23, Dim23, i, j, k, l, k, l >::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Ddg_mod_Tensor2_symmetric.hpp:52
FTensor::Ddg_mod_Tensor2_symmetric< A, B, T, U, Dim01, Dim23, Dim01, i, j, k, l, i, j >::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3, const int N4) const
Definition: Ddg_mod_Tensor2_symmetric.hpp:26
FTensor::Ddg_mod_Tensor2_symmetric
Definition: Ddg_mod_Tensor2_symmetric.hpp:11
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Ddg_mod_Tensor2_symmetric< A, B, T, U, Dim01, Dim23, Dim23, i, j, k, l, k, l >::iterA
Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > iterA
Definition: Ddg_mod_Tensor2_symmetric.hpp:47
FTensor::Ddg_mod_Tensor2_symmetric< A, B, T, U, Dim01, Dim23, Dim23, i, j, k, l, k, l >::Ddg_mod_Tensor2_symmetric
Ddg_mod_Tensor2_symmetric(const Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > &a, const Tensor2_symmetric_Expr< B, U, Dim23, k, l > &b)
Definition: Ddg_mod_Tensor2_symmetric.hpp:57
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
FTensor::Ddg_mod_Tensor2_symmetric< A, B, T, U, Dim01, Dim23, Dim01, i, j, k, l, i, j >::iterA
Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > iterA
Definition: Ddg_mod_Tensor2_symmetric.hpp:21
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21