v0.14.0
Tensor4_times_generic.hpp
Go to the documentation of this file.
1 namespace FTensor {
2 /* A(i,j,k,l)*generic */
3 
4 template <class A, class T, class U, int Dim0, int Dim1, int Dim2, int Dim3,
5  char i, char j, char k, char l>
7  const U &d0) {
8  auto TensorExpr = [&a, &d0](const int N1, const int N2, const int N3,
9  const int N4) {
10  return a.operator()(N1, N2, N3, N4) * d0;
11  };
12  return Tensor4_Expr<decltype(TensorExpr), typename promote<T, U>::V, Dim0,
13  Dim1, Dim2, Dim3, i, j, k, l>(TensorExpr);
14 }
15 
16 /* generic*A(i,j,k,l) */
17 
18 template <class A, class T, class U, int Dim0, int Dim1, int Dim2, int Dim3,
19  char i, char j, char k, char l>
20 auto operator*(
21  const U &d0,
23  auto TensorExpr = [&a, &d0](const int N1, const int N2, const int N3,
24  const int N4) {
25  return d0 * a.operator()(N1, N2, N3, N4);
26  };
27  return Tensor4_Expr<decltype(TensorExpr), typename promote<T, U>::V, Dim0,
28  Dim1, Dim2, Dim3, i, j, k, l>(TensorExpr);
29 }
30 
31 /* A(i,j,k,l)/generic */
32 
33 template <class A, class T, class U, int Dim0, int Dim1, int Dim2, int Dim3,
34  char i, char j, char k, char l>
36  const U &d0) {
37  auto TensorExpr = [&a, &d0](const int N1, const int N2, const int N3,
38  const int N4) {
39  return a.operator()(N1, N2, N3) / d0;
40  };
41  return Tensor4_Expr<decltype(TensorExpr), typename promote<T, U>::V, Dim0,
42  Dim1, Dim2, Dim3, i, j, k, l>(TensorExpr);
43 }
44 
45 /* generic/A(i,j,k,l) */
46 
47 template <class A, class T, class U, int Dim0, int Dim1, int Dim2, int Dim3,
48  char i, char j, char k, char l>
49 auto operator/(
50  const U &d0,
52  auto TensorExpr = [&a, &d0](const int N1, const int N2, const int N3,
53  const int N4) {
54  return d0 / a.operator()(N1, N2, N3, N4);
55  };
56  return Tensor4_Expr<decltype(TensorExpr), typename promote<T, U>::V, Dim0,
57  Dim1, Dim2, Dim3, i, j, k, l>(TensorExpr);
58 }
59 
60 } // namespace FTensor
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::operator*
promote< T, U >::V operator*(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Ddg_Expr< B, U, Dim, Dim, i, k, j, l > &b)
Definition: Ddg_times_Ddg.hpp:79
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Tensor4_Expr
Definition: Tensor4_Expr.hpp:25
FTensor::operator/
auto operator/(const Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > &a, const U &d0)
Definition: Ddg_times_generic.hpp:36
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
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