v0.14.0
src
ftensor
src
FTensor
Ddg
Ddg_times_generic.hpp
Go to the documentation of this file.
1
/* Multiplies a Ddg with a generic, yielding a
2
Ddg. */
3
4
#pragma once
5
6
namespace
FTensor
7
{
8
template
<
class
A
,
class
T,
class
U
,
int
Dim01,
int
Dim23,
char
i
,
char
j
,
9
char
k
,
char
l
>
10
auto
11
operator*
(
const
Ddg_Expr<A, T, Dim01, Dim23, i, j, k, l>
&
a
,
const
U
&d0)
12
{
13
auto
TensorExpr
14
= [&
a
, &d0](
const
int
N1,
const
int
N2,
const
int
N3,
const
int
N4) {
15
return
a
(N1, N2, N3, N4) * d0;
16
};
17
return
Ddg_Expr
<decltype(TensorExpr),
typename
promote<T, U>::V
, Dim01,
18
Dim23,
i
,
j
,
k
,
l
>(TensorExpr);
19
}
20
21
template
<
class
A
,
class
T,
class
U
,
int
Dim01,
int
Dim23,
char
i
,
char
j
,
22
char
k
,
char
l
>
23
auto
24
operator*
(
const
U
&d0,
const
Ddg_Expr<A, T, Dim01, Dim23, i, j, k, l>
&
a
)
25
{
26
auto
TensorExpr
27
= [&
a
, &d0](
const
int
N1,
const
int
N2,
const
int
N3,
const
int
N4) {
28
return
d0 *
a
(N1, N2, N3, N4);
29
};
30
return
Ddg_Expr
<decltype(TensorExpr),
typename
promote<T, U>::V
, Dim01,
31
Dim23,
i
,
j
,
k
,
l
>(TensorExpr);
32
}
33
34
template
<
class
A
,
class
T,
class
U
,
int
Dim01,
int
Dim23,
char
i
,
char
j
,
35
char
k
,
char
l
>
36
auto
operator/
(
const
Ddg_Expr<A, T, Dim01, Dim23, i, j, k, l>
&
a
,
37
const
U
&d0) {
38
auto
TensorExpr
39
= [&
a
, &d0](
const
int
N1,
const
int
N2,
const
int
N3,
const
int
N4) {
40
return
a
(N1, N2, N3, N4) / d0;
41
};
42
return
Ddg_Expr
<decltype(TensorExpr),
typename
promote<T, U>::V
, Dim01,
43
Dim23,
i
,
j
,
k
,
l
>(TensorExpr);
44
}
45
46
}
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::Ddg_Expr
Definition:
Ddg_Expr.hpp:28
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
Generated by
Doxygen
1.8.17 and hosted at