v0.14.0
Dg_times_generic.hpp
Go to the documentation of this file.
1 /* Multiplies a Dg with a generic, yielding a Dg. */
2 
3 #pragma once
4 
5 namespace FTensor
6 {
7  template <class A, class T, class U, int Dim01, int Dim2, char i, char j,
8  char k>
10  {
12  U d;
13 
14  public:
15  typename promote<T, U>::V
16  operator()(const int N1, const int N2, const int N3) const
17  {
18  return iterA(N1, N2, N3) * d;
19  }
20 
22  : iterA(a), d(d0)
23  {}
24  };
25 
26  /* A(i,j,k)*d0->Dg */
27 
28  template <class A, class T, class U, int Dim01, int Dim2, char i, char j,
29  char k>
30  Dg_Expr<Dg_times_generic<A, T, U, Dim01, Dim2, i, j, k>,
31  typename promote<T, U>::V, Dim01, Dim2, i, j, k>
33  {
35  return Dg_Expr<TensorExpr, typename promote<T, U>::V, Dim01, Dim2, i, j, k>(
36  TensorExpr(a, d0));
37  }
38 
39  /* d0*A(i,j,k)->Dg */
40 
41  template <class A, class T, class U, int Dim01, int Dim2, char i, char j,
42  char k>
43  Dg_Expr<Dg_times_generic<A, T, U, Dim01, Dim2, i, j, k>,
44  typename promote<T, U>::V, Dim01, Dim2, i, j, k>
46  {
48  return Dg_Expr<TensorExpr, typename promote<T, U>::V, Dim01, Dim2, i, j, k>(
49  TensorExpr(a, d0));
50  }
51 }
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
FTensor::Dg_times_generic::d
U d
Definition: Dg_times_generic.hpp:12
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Dg_times_generic::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Dg_times_generic.hpp:16
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::Dg_Expr
Definition: Dg_Expr.hpp:25
FTensor::Dg_times_generic
Definition: Dg_times_generic.hpp:9
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Dg_times_generic::Dg_times_generic
Dg_times_generic(const Dg_Expr< A, T, Dim01, Dim2, i, j, k > &a, const U &d0)
Definition: Dg_times_generic.hpp:21
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197
FTensor::Dg_times_generic::iterA
Dg_Expr< A, T, Dim01, Dim2, i, j, k > iterA
Definition: Dg_times_generic.hpp:11