v0.14.0
src
ftensor
src
FTensor
Tensor2_symmetric
Tensor2_symmetric_Expr.hpp
Go to the documentation of this file.
1
/* Declares a wrapper class for symmetric rank 2 Tensor expressions.
2
It is specialized for Tensor3_number_rhs_2. Note that
3
Tensor2_symmetric_Expr_equals.hpp is included at the end, because it
4
needs the definition of Tensor2_symmetric_Expr. */
5
6
#pragma once
7
8
#include "
Tensor2_symmetric_and_Tensor2_symmetric.hpp
"
9
#include "
Tensor2_symmetric_carat_Tensor2.hpp
"
10
#include "
Tensor2_symmetric_divide_generic.hpp
"
11
#include "
Tensor2_symmetric_minus_Tensor2.hpp
"
12
#include "
Tensor2_symmetric_minus_Tensor2_symmetric.hpp
"
13
#include "
Tensor2_symmetric_minus_generic.hpp
"
14
#include "
Tensor2_symmetric_mod_Tensor2_symmetric.hpp
"
15
#include "
Tensor2_symmetric_plus_Tensor2.hpp
"
16
#include "
Tensor2_symmetric_plus_Tensor2_symmetric.hpp
"
17
#include "
Tensor2_symmetric_plus_generic.hpp
"
18
#include "
Tensor2_symmetric_times_Tensor1.hpp
"
19
#include "
Tensor2_symmetric_times_Tensor2.hpp
"
20
#include "
Tensor2_symmetric_times_Tensor2_symmetric.hpp
"
21
#include "
Tensor2_symmetric_carat_Tensor2_symmetric.hpp
"
22
#include "
Tensor2_symmetric_times_generic.hpp
"
23
#include "
dTensor2_symmetric.hpp
"
24
#include "
d_boundary_Tensor2_symmetric.hpp
"
25
#include "
d_one_sided_Tensor2_symmetric.hpp
"
26
#include "
ddTensor2_symmetric.hpp
"
27
#include "
dd_boundary_Tensor2_symmetric.hpp
"
28
#include "
diffusion_Tensor2_symmetric.hpp
"
29
#include "
generic_minus_Tensor2_symmetric.hpp
"
30
#include "
interpolate_Tensor2_symmetric.hpp
"
31
#include "
minus_Tensor2_symmetric.hpp
"
32
33
namespace
FTensor
34
{
35
template
<
class
A,
class
T,
int
Dim,
char
i,
char
j>
36
class
Tensor2_symmetric_Expr
37
{
38
A
iter
;
39
40
public
:
41
Tensor2_symmetric_Expr
(
const
A
&
a
) :
iter
(
a
) {}
42
T
operator()
(
const
int
N1,
const
int
N2)
const
{
return
iter
(N1, N2); }
43
};
44
45
template
<
class
A,
class
T,
int
Tensor_Dim,
int
Dim,
char
i,
char
j>
46
class
Tensor2_symmetric_Expr
<
Tensor2_symmetric
<
A
, Tensor_Dim>, T, Dim,
i
,
j
>
47
{
48
Tensor2_symmetric<A, Tensor_Dim>
&
iter
;
49
50
public
:
51
Tensor2_symmetric_Expr
(
Tensor2_symmetric<A, Tensor_Dim>
&
a
) :
iter
(
a
) {}
52
T &
operator()
(
const
int
N1,
const
int
N2) {
return
iter
(N1, N2); }
53
T
operator()
(
const
int
N1,
const
int
N2)
const
{
return
iter
(N1, N2); }
54
55
/* Various assignment operators. I have to explicitly declare the
56
second operator= because otherwise the compiler will generate its
57
own and not use the template code. */
58
59
template
<
class
B,
class
U>
60
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
61
j
> &
62
operator=(
const
Tensor2_symmetric_Expr<B, U, Dim, i, j>
&result);
63
64
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
65
j
> &
66
operator=(
const
Tensor2_symmetric_Expr
<
Tensor2_symmetric<A, Tensor_Dim>
, T,
67
Dim,
i
,
j
> &result);
68
69
template
<
class
B,
class
U>
70
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
71
j
> &
72
operator+=(
const
Tensor2_symmetric_Expr<B, U, Dim, i, j>
&result);
73
74
template
<
class
B,
class
U>
75
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
76
j
> &
77
operator-=(
const
Tensor2_symmetric_Expr<B, U, Dim, i, j>
&result);
78
79
template
<
class
B,
class
U>
80
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
81
j
> &
82
operator&=(
const
Tensor2_symmetric_Expr<B, U, Dim, i, j>
&result);
83
84
/* This is for when the indices are switched (i,j) -> (j,i). */
85
86
template
<
class
B,
class
U>
87
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
88
j
> &
89
operator=(
const
Tensor2_symmetric_Expr<B, U, Dim, j, i>
&result);
90
91
template
<
class
B,
class
U>
92
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
93
j
> &
94
operator+=(
const
Tensor2_symmetric_Expr<B, U, Dim, j, i>
&result);
95
96
template
<
class
B,
class
U>
97
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
98
j
> &
99
operator-=(
const
Tensor2_symmetric_Expr<B, U, Dim, j, i>
&result);
100
101
/* Operations with just generics. */
102
103
template
<
class
U>
104
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
105
j
> &
106
operator=(
const
U
&
d
);
107
template
<
class
U>
108
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
109
j
> &
110
operator+=(
const
U
&
d
);
111
template
<
class
U>
112
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
113
j
> &
114
operator-=(
const
U
&
d
);
115
template
<
class
U>
116
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
117
j
> &
118
operator*=(
const
U
&
d
);
119
template
<
class
U>
120
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
121
j
> &
122
operator/=(
const
U
&
d
);
123
/* ADOL-C operators. */
124
125
template
<
class
B,
class
U>
126
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
127
j
> &
128
operator<<=(
const
Tensor2_symmetric_Expr<B, U, Dim, i, j>
&result);
129
130
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T, Dim,
i
,
131
j
> &
132
operator<<=(
const
Tensor2_symmetric_Expr
<
Tensor2_symmetric<A, Tensor_Dim>
,
133
T, Dim,
i
,
j
> &result);
134
135
template
<
class
B,
class
U>
136
inline
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T,
137
Dim,
i
,
j
> &
138
operator<<=(
const
Tensor2_symmetric_Expr<B, U, Dim, j, i>
&result);
139
140
template
<
class
U>
141
inline
const
Tensor2_symmetric_Expr<Tensor2_symmetric<A, Tensor_Dim>
, T,
142
Dim,
i
,
j
> &
143
operator<<=(
const
U
&
d
);
144
};
145
146
/* Specialized for Dg_number_rhs_2 (Dg with the
147
second index explicitly given). */
148
149
template
<
class
A,
class
T,
int
Dim,
char
i,
char
j,
int
N>
150
class
Tensor2_symmetric_Expr
<
Dg_number_rhs_2
<
A
, T,
N
>, T, Dim,
i
,
j
>
151
{
152
A
&
iter
;
153
154
public
:
155
Tensor2_symmetric_Expr
(
A
&
a
) :
iter
(
a
) {}
156
T &
operator()
(
const
int
N1,
const
int
N2) {
return
iter
(N1, N2,
N
); }
157
T
operator()
(
const
int
N1,
const
int
N2)
const
{
return
iter
(N1, N2,
N
); }
158
159
/* Various assignment operators. I have to explicitly declare the
160
second operator= because otherwise the compiler will generate its
161
own and not use the template code. */
162
163
template
<
class
B,
class
U>
164
const
Tensor2_symmetric_Expr<Dg_number_rhs_2<A, T, N>
, T, Dim,
i
,
j
> &
165
operator=(
const
Tensor2_symmetric_Expr<B, U, Dim, i, j>
&result);
166
167
const
Tensor2_symmetric_Expr<Dg_number_rhs_2<A, T, N>
, T, Dim,
i
,
j
> &
168
operator=(
const
Tensor2_symmetric_Expr
<
Dg_number_rhs_2<A, T, N>
, T, Dim,
i
,
169
j
> &result);
170
};
171
172
/* Specialized for Ddg_number_rhs_01 (Ddg with the
173
first and second index explicitly given). */
174
175
template
<
class
A,
class
T,
int
Dim,
char
i,
char
j,
int
N0,
int
N1>
176
class
Tensor2_symmetric_Expr
<
Ddg_number_rhs_01
<
A
, T, N0, N1>, T, Dim,
i
,
j
>
177
{
178
A
&
iter
;
179
180
public
:
181
Tensor2_symmetric_Expr
(
A
&
a
) :
iter
(
a
) {}
182
T &
operator()
(
const
int
N2,
const
int
N3) {
return
iter
(N0, N1, N2, N3); }
183
T
operator()
(
const
int
N2,
const
int
N3)
const
184
{
185
return
iter
(N0, N1, N2, N3);
186
}
187
188
/* Various assignment operators. I have to explicitly declare the
189
second operator= because otherwise the compiler will generate its
190
own and not use the template code. */
191
192
template
<
class
B,
class
U>
193
const
Tensor2_symmetric_Expr<Ddg_number_rhs_01<A, T, N0, N1>
, T, Dim,
i
,
j
>
194
&operator=(
const
Tensor2_symmetric_Expr<B, U, Dim, i, j>
&result);
195
196
const
Tensor2_symmetric_Expr<Ddg_number_rhs_01<A, T, N0, N1>
, T, Dim,
i
,
j
>
197
&operator=(
const
Tensor2_symmetric_Expr
<
Ddg_number_rhs_01<A, T, N0, N1>
,
198
T, Dim,
i
,
j
> &result);
199
};
200
}
201
202
#include "
Tensor2_symmetric_Expr_equals.hpp
"
FTensor::Tensor2_symmetric_Expr< Dg_number_rhs_2< A, T, N >, T, Dim, i, j >::operator()
T & operator()(const int N1, const int N2)
Definition:
Tensor2_symmetric_Expr.hpp:156
Tensor2_symmetric_carat_Tensor2_symmetric.hpp
diffusion_Tensor2_symmetric.hpp
FTensor
JSON compatible output.
Definition:
Christof_constructor.hpp:6
Tensor2_symmetric_plus_Tensor2_symmetric.hpp
FTensor::Tensor2_symmetric_Expr
Definition:
Tensor2_symmetric_Expr.hpp:36
FTensor::Tensor2_symmetric_Expr::Tensor2_symmetric_Expr
Tensor2_symmetric_Expr(const A &a)
Definition:
Tensor2_symmetric_Expr.hpp:41
Tensor2_symmetric_plus_generic.hpp
FTensor::Tensor2_symmetric_Expr< Ddg_number_rhs_01< A, T, N0, N1 >, T, Dim, i, j >::iter
A & iter
Definition:
Tensor2_symmetric_Expr.hpp:178
d_boundary_Tensor2_symmetric.hpp
Tensor2_symmetric_times_Tensor2_symmetric.hpp
FTensor::d
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition:
dTensor0.hpp:27
FTensor::Tensor2_symmetric_Expr< Ddg_number_rhs_01< A, T, N0, N1 >, T, Dim, i, j >::Tensor2_symmetric_Expr
Tensor2_symmetric_Expr(A &a)
Definition:
Tensor2_symmetric_Expr.hpp:181
A
constexpr AssemblyType A
Definition:
operators_tests.cpp:30
dd_boundary_Tensor2_symmetric.hpp
interpolate_Tensor2_symmetric.hpp
Tensor2_symmetric_Expr_equals.hpp
FTensor::Tensor2_symmetric
Definition:
Tensor2_symmetric_value.hpp:13
Tensor2_symmetric_divide_generic.hpp
FTensor::Tensor2_symmetric_Expr< Tensor2_symmetric< A, Tensor_Dim >, T, Dim, i, j >::operator()
T operator()(const int N1, const int N2) const
Definition:
Tensor2_symmetric_Expr.hpp:53
Tensor2_symmetric_times_generic.hpp
generic_minus_Tensor2_symmetric.hpp
Tensor2_symmetric_times_Tensor2.hpp
Tensor2_symmetric_carat_Tensor2.hpp
d_one_sided_Tensor2_symmetric.hpp
FTensor::Tensor2_symmetric_Expr< Tensor2_symmetric< A, Tensor_Dim >, T, Dim, i, j >::Tensor2_symmetric_Expr
Tensor2_symmetric_Expr(Tensor2_symmetric< A, Tensor_Dim > &a)
Definition:
Tensor2_symmetric_Expr.hpp:51
a
constexpr double a
Definition:
approx_sphere.cpp:30
Tensor2_symmetric_minus_Tensor2.hpp
FTensor::Tensor2_symmetric_Expr< Dg_number_rhs_2< A, T, N >, T, Dim, i, j >::Tensor2_symmetric_Expr
Tensor2_symmetric_Expr(A &a)
Definition:
Tensor2_symmetric_Expr.hpp:155
Tensor2_symmetric_plus_Tensor2.hpp
dTensor2_symmetric.hpp
Tensor2_symmetric_minus_generic.hpp
FTensor::Tensor2_symmetric_Expr< Tensor2_symmetric< A, Tensor_Dim >, T, Dim, i, j >::operator()
T & operator()(const int N1, const int N2)
Definition:
Tensor2_symmetric_Expr.hpp:52
FTensor::Tensor2_symmetric_Expr< Dg_number_rhs_2< A, T, N >, T, Dim, i, j >::operator()
T operator()(const int N1, const int N2) const
Definition:
Tensor2_symmetric_Expr.hpp:157
FTensor::Dg_number_rhs_2
Definition:
Dg_number.hpp:34
Tensor2_symmetric_minus_Tensor2_symmetric.hpp
FTensor::Tensor2_symmetric_Expr< Ddg_number_rhs_01< A, T, N0, N1 >, T, Dim, i, j >::operator()
T operator()(const int N2, const int N3) const
Definition:
Tensor2_symmetric_Expr.hpp:183
Tensor2_symmetric_and_Tensor2_symmetric.hpp
FTensor::Tensor2_symmetric_Expr< Dg_number_rhs_2< A, T, N >, T, Dim, i, j >::iter
A & iter
Definition:
Tensor2_symmetric_Expr.hpp:152
i
FTensor::Index< 'i', SPACE_DIM > i
Definition:
hcurl_divergence_operator_2d.cpp:27
Tensor2_symmetric_times_Tensor1.hpp
FTensor::Tensor2_symmetric_Expr< Ddg_number_rhs_01< A, T, N0, N1 >, T, Dim, i, j >::operator()
T & operator()(const int N2, const int N3)
Definition:
Tensor2_symmetric_Expr.hpp:182
FTensor::Tensor2_symmetric_Expr::operator()
T operator()(const int N1, const int N2) const
Definition:
Tensor2_symmetric_Expr.hpp:42
FTensor::Ddg_number_rhs_01
Definition:
Ddg_number.hpp:23
ddTensor2_symmetric.hpp
N
const int N
Definition:
speed_test.cpp:3
Tensor2_symmetric_mod_Tensor2_symmetric.hpp
minus_Tensor2_symmetric.hpp
FTensor::Tensor2_symmetric_Expr< Tensor2_symmetric< A, Tensor_Dim >, T, Dim, i, j >::iter
Tensor2_symmetric< A, Tensor_Dim > & iter
Definition:
Tensor2_symmetric_Expr.hpp:48
j
FTensor::Index< 'j', 3 > j
Definition:
matrix_function.cpp:19
FTensor::Tensor2_symmetric_Expr::iter
A iter
Definition:
Tensor2_symmetric_Expr.hpp:38
EshelbianPlasticity::U
@ U
Definition:
EshelbianContact.cpp:197
Generated by
Doxygen
1.8.17 and hosted at