v0.14.0
Dg_and_Tensor1.hpp
Go to the documentation of this file.
1 /* Multiply a Tensor1 and a Dg together but don't contract, yielding a
2  Dg. */
3 
4 #pragma once
5 
6 namespace FTensor
7 {
8  /* A(i,j,k) & B(k) -> Dg */
9 
10  template <class A, class B, class T, class U, int Dim01, int Dim2, char i,
11  char j, char k>
13  {
16 
17  public:
18  typename promote<T, U>::V
19  operator()(const int N1, const int N2, const int N3) const
20  {
21  return iterA(N1, N2, N3) * iterB(N3);
22  }
23 
26  : iterA(a), iterB(b)
27  {}
28  };
29 
30  template <class A, class B, class T, class U, int Dim01, int Dim2, char i,
31  char j, char k>
32  Dg_Expr<Dg_and_Tensor1<A, B, T, U, Dim01, Dim2, i, j, k>,
33  typename promote<T, U>::V, Dim01, Dim2, i, j, k>
36  {
38  return Dg_Expr<TensorExpr, typename promote<T, U>::V, Dim01, Dim2, i, j, k>(
39  TensorExpr(a, b));
40  }
41 
42  /* B(k) & A(i,j,k) -> Dg */
43 
44  template <class A, class B, class T, class U, int Dim01, int Dim2, char i,
45  char j, char k>
46  Dg_Expr<Dg_and_Tensor1<A, B, T, U, Dim01, Dim2, i, j, k>,
47  typename promote<T, U>::V, Dim01, Dim2, i, j, k>
50  {
52  return Dg_Expr<TensorExpr, typename promote<T, U>::V, Dim01, Dim2, i, j, k>(
53  TensorExpr(a, b));
54  }
55 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Dg_and_Tensor1::iterA
Dg_Expr< A, T, Dim01, Dim2, i, j, k > iterA
Definition: Dg_and_Tensor1.hpp:14
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FTensor::Tensor1_Expr< B, U, Dim2, k >
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::operator&
Ddg_Expr< Ddg_and_Tensor2_symmetric< A, B, T, U, Dim01_0, Dim23_0, Dim_1, i0, j0, k0, l0, i1, j1 >, typename promote< T, U >::V, Dim01_0, Dim23_0, i0, j0, k0, l0 > operator&(const Ddg_Expr< A, T, Dim01_0, Dim23_0, i0, j0, k0, l0 > &a, const Tensor2_symmetric_Expr< B, U, Dim_1, i1, j1 > &b)
Definition: Ddg_and_Tensor2_symmetric.hpp:69
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_and_Tensor1::iterB
Tensor1_Expr< B, U, Dim2, k > iterB
Definition: Dg_and_Tensor1.hpp:15
FTensor::Dg_Expr
Definition: Dg_Expr.hpp:25
FTensor::Dg_and_Tensor1::operator()
promote< T, U >::V operator()(const int N1, const int N2, const int N3) const
Definition: Dg_and_Tensor1.hpp:19
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Dg_and_Tensor1
Definition: Dg_and_Tensor1.hpp:12
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
FTensor::Dg_and_Tensor1::Dg_and_Tensor1
Dg_and_Tensor1(const Dg_Expr< A, T, Dim01, Dim2, i, j, k > &a, const Tensor1_Expr< B, U, Dim2, k > &b)
Definition: Dg_and_Tensor1.hpp:24
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:197