Go to the documentation of this file.
29 #include "Fastor/Fastor.h"
31 #include <autodiff/forward/dual/dual.hpp>
35 namespace FastorStandardTensors {
42 template <
typename T >
44 template <
typename T >
46 template <
typename T >
48 template <
typename T >
58 Fastor::ColumnMajor );
61 Fastor::ColumnMajor );
64 Fastor::ColumnMajor );
67 Fastor::ColumnMajor );
70 Fastor::ColumnMajor );
73 Fastor::ColumnMajor );
77 Fastor::ColumnMajor );
89 namespace FastorIndices {
90 enum {
i_,
j_,
k_,
l_,
m_,
n_,
A_,
B_,
I_,
J_,
K_,
L_,
M_,
N_,
P_ };
92 using A = Fastor::Index< A_ >;
93 using Ai = Fastor::Index< A_, i_ >;
94 using AB = Fastor::Index< A_, B_ >;
95 using B = Fastor::Index< B_ >;
96 using IJ = Fastor::Index< I_, J_ >;
97 using IJKL = Fastor::Index< I_, J_, K_, L_ >;
98 using IJML = Fastor::Index< I_, J_, M_, L_ >;
99 using IK = Fastor::Index< I_, K_ >;
100 using Ii = Fastor::Index< I_, i_ >;
101 using IikK = Fastor::Index< I_, i_, k_, K_ >;
102 using Ik = Fastor::Index< I_, k_ >;
103 using IL = Fastor::Index< I_, L_ >;
104 using Im = Fastor::Index< I_, m_ >;
105 using JI = Fastor::Index< J_, I_ >;
106 using JK = Fastor::Index< J_, K_ >;
107 using JL = Fastor::Index< J_, L_ >;
108 using Jk = Fastor::Index< J_, k_ >;
109 using KI = Fastor::Index< K_, I_ >;
110 using KJ = Fastor::Index< K_, J_ >;
111 using KJN = Fastor::Index< K_, J_, N_ >;
112 using KL = Fastor::Index< K_, L_ >;
113 using KLMN = Fastor::Index< K_, L_, M_, N_ >;
114 using KLMP = Fastor::Index< K_, L_, M_, P_ >;
115 using KLNM = Fastor::Index< K_, L_, N_, M_ >;
116 using KLPM = Fastor::Index< K_, L_, P_, M_ >;
117 using KLm = Fastor::Index< K_, L_, m_ >;
118 using KMJ = Fastor::Index< K_, M_, J_ >;
119 using KMN = Fastor::Index< K_, M_, N_ >;
120 using Ki = Fastor::Index< K_, i_ >;
121 using Kk = Fastor::Index< K_, k_ >;
122 using L = Fastor::Index< L_ >;
123 using LI = Fastor::Index< L_, I_ >;
124 using LK = Fastor::Index< L_, K_ >;
125 using LN = Fastor::Index< L_, N_ >;
126 using Lm = Fastor::Index< L_, m_ >;
127 using LmN = Fastor::Index< L_, m_, N_ >;
128 using MJKL = Fastor::Index< M_, J_, K_, L_ >;
129 using MK = Fastor::Index< M_, K_ >;
130 using ML = Fastor::Index< M_, L_ >;
131 using MNL = Fastor::Index< M_, N_, L_ >;
132 using MPm = Fastor::Index< M_, P_, m_ >;
133 using Mi = Fastor::Index< M_, i_ >;
134 using NLJl = Fastor::Index< N_, L_, J_, l_ >;
135 using Nm = Fastor::Index< N_, m_ >;
136 using Pm = Fastor::Index< P_, m_ >;
137 using i = Fastor::Index< i_ >;
138 using iA = Fastor::Index< i_, A_ >;
139 using iAkB = Fastor::Index< i_, A_, k_, B_ >;
140 using iB = Fastor::Index< i_, B_ >;
141 using iI = Fastor::Index< i_, I_ >;
142 using iIKL = Fastor::Index< i_, I_, K_, L_ >;
143 using iIjJ = Fastor::Index< i_, I_, j_, J_ >;
144 using iIkK = Fastor::Index< i_, I_, k_, K_ >;
145 using iIkL = Fastor::Index< i_, I_, k_, L_ >;
146 using iImn = Fastor::Index< i_, I_, m_, n_ >;
147 using iJ = Fastor::Index< i_, J_ >;
148 using iJKL = Fastor::Index< i_, J_, K_, L_ >;
149 using iJLl = Fastor::Index< i_, J_, L_, l_ >;
150 using iJkL = Fastor::Index< i_, J_, k_, L_ >;
151 using iJl = Fastor::Index< i_, J_, l_ >;
152 using iK = Fastor::Index< i_, K_ >;
153 using iKjL = Fastor::Index< i_, K_, j_, L_ >;
154 using iL = Fastor::Index< i_, L_ >;
155 using iM = Fastor::Index< i_, M_ >;
156 using iN = Fastor::Index< i_, N_ >;
157 using iNL = Fastor::Index< i_, N_, L_ >;
158 using ij = Fastor::Index< i_, j_ >;
159 using ijB = Fastor::Index< i_, j_, B_ >;
160 using ijKJ = Fastor::Index< i_, j_, K_, J_ >;
161 using ijKL = Fastor::Index< i_, j_, K_, L_ >;
162 using ijL = Fastor::Index< i_, j_, L_ >;
163 using ijLm = Fastor::Index< i_, j_, L_, m_ >;
164 using ijk = Fastor::Index< i_, j_, k_ >;
165 using ijkB = Fastor::Index< i_, j_, k_, B_ >;
166 using ijkK = Fastor::Index< i_, j_, k_, K_ >;
167 using ijkl = Fastor::Index< i_, j_, k_, l_ >;
168 using ijl = Fastor::Index< i_, j_, l_ >;
169 using ijm = Fastor::Index< i_, j_, m_ >;
170 using ijmn = Fastor::Index< i_, j_, m_, n_ >;
171 using ijnk = Fastor::Index< i_, j_, n_, k_ >;
172 using ijnm = Fastor::Index< i_, j_, n_, m_ >;
173 using ik = Fastor::Index< i_, k_ >;
174 using im = Fastor::Index< i_, m_ >;
175 using imk = Fastor::Index< i_, m_, k_ >;
176 using imkl = Fastor::Index< i_, m_, k_, l_ >;
177 using imL = Fastor::Index< i_, m_, L_ >;
178 using imLk = Fastor::Index< i_, m_, L_, k_ >;
179 using in = Fastor::Index< i_, n_ >;
180 using inB = Fastor::Index< i_, n_, B_ >;
181 using inkB = Fastor::Index< i_, n_, k_, B_ >;
182 using j = Fastor::Index< j_ >;
183 using jA = Fastor::Index< j_, A_ >;
184 using jB = Fastor::Index< j_, B_ >;
185 using jJ = Fastor::Index< j_, J_ >;
186 using jL = Fastor::Index< j_, L_ >;
187 using jLm = Fastor::Index< j_, L_, m_ >;
188 using ji = Fastor::Index< j_, i_ >;
189 using jin = Fastor::Index< j_, i_, n_ >;
190 using jk = Fastor::Index< j_, k_ >;
191 using jK = Fastor::Index< j_, K_ >;
192 using jkB = Fastor::Index< j_, k_, B_ >;
193 using jkl = Fastor::Index< j_, k_, l_ >;
194 using jl = Fastor::Index< j_, l_ >;
195 using k = Fastor::Index< k_ >;
196 using kA = Fastor::Index< k_, A_ >;
197 using kB = Fastor::Index< k_, B_ >;
198 using kI = Fastor::Index< k_, I_ >;
199 using kK = Fastor::Index< k_, K_ >;
200 using kL = Fastor::Index< k_, L_ >;
201 using kM = Fastor::Index< k_, M_ >;
202 using kNL = Fastor::Index< k_, N_, L_ >;
203 using kj = Fastor::Index< k_, j_ >;
204 using kJ = Fastor::Index< k_, J_ >;
205 using kl = Fastor::Index< k_, l_ >;
206 using km = Fastor::Index< k_, m_ >;
207 using l = Fastor::Index< l_ >;
208 using lB = Fastor::Index< l_, B_ >;
209 using lm = Fastor::Index< l_, m_ >;
210 using m = Fastor::Index< m_ >;
211 using mK = Fastor::Index< m_, K_ >;
212 using mLl = Fastor::Index< m_, L_, l_ >;
213 using mj = Fastor::Index< m_, j_ >;
214 using mjL = Fastor::Index< m_, j_, L_ >;
215 using mn = Fastor::Index< m_, n_ >;
216 using mnKL = Fastor::Index< m_, n_, K_, L_ >;
217 using mnij = Fastor::Index< m_, n_, i_, j_ >;
218 using mnkB = Fastor::Index< m_, n_, k_, B_ >;
219 using mnkL = Fastor::Index< m_, n_, k_, L_ >;
220 using nB = Fastor::Index< n_, B_ >;
222 using to_IJKL = Fastor::OIndex< I_, J_, K_, L_ >;
223 using to_IJkK = Fastor::OIndex< I_, J_, k_, K_ >;
224 using to_IJkL = Fastor::OIndex< I_, J_, k_, L_ >;
225 using to_IikK = Fastor::OIndex< I_, i_, k_, K_ >;
226 using to_IjkK = Fastor::OIndex< I_, j_, k_, K_ >;
227 using to_Ii = Fastor::OIndex< I_, i_ >;
228 using to_NLJl = Fastor::OIndex< N_, L_, J_, l_ >;
229 using to_iIKL = Fastor::OIndex< i_, I_, K_, L_ >;
230 using to_iIjJ = Fastor::OIndex< i_, I_, j_, J_ >;
231 using to_iImn = Fastor::OIndex< i_, I_, m_, n_ >;
232 using to_ij = Fastor::OIndex< i_, j_ >;
233 using to_ijIJ = Fastor::OIndex< i_, j_, I_, J_ >;
234 using to_ijKL = Fastor::OIndex< i_, j_, K_, L_ >;
235 using to_ijL = Fastor::OIndex< i_, j_, L_ >;
236 using to_ijLk = Fastor::OIndex< i_, j_, L_, k_ >;
237 using to_ijLm = Fastor::OIndex< i_, j_, L_, m_ >;
238 using to_ijk = Fastor::OIndex< i_, j_, k_ >;
239 using to_ijkK = Fastor::OIndex< i_, j_, k_, K_ >;
240 using to_ijkL = Fastor::OIndex< i_, j_, k_, L_ >;
241 using to_ijKl = Fastor::OIndex< i_, j_, K_, l_ >;
242 using to_ijkl = Fastor::OIndex< i_, j_, k_, l_ >;
243 using to_ijm = Fastor::OIndex< i_, j_, m_ >;
244 using to_ijmM = Fastor::OIndex< i_, j_, m_, M_ >;
245 using to_jAB = Fastor::OIndex< j_, A_, B_ >;
246 using to_jAkB = Fastor::OIndex< j_, A_, k_, B_ >;
247 using to_ji = Fastor::OIndex< j_, i_ >;
248 using to_jikL = Fastor::OIndex< j_, i_, k_, L_ >;
249 using to_jikl = Fastor::OIndex< j_, i_, k_, l_ >;
250 using to_jkiB = Fastor::OIndex< j_, k_, i_, B_ >;
251 using to_kK = Fastor::OIndex< k_, K_ >;
252 using to_kL = Fastor::OIndex< k_, L_ >;
255 template <
typename T,
258 typename = std::enable_if< !std::is_const< std::remove_reference< T > >::value > >
261 return Eigen::Map< const Eigen::Matrix< T, nRows, nCols, Eigen::RowMajor > >( fastor.data() );
264 template <
typename T,
size_t nRows,
size_t nCols,
typename =
void >
267 return Eigen::Map< Eigen::Matrix< T, nRows, nCols, Eigen::RowMajor > >( fastor.data() );
270 template <
typename T,
size_t nRows,
typename =
void >
273 return Eigen::Map< Eigen::Matrix< T, nRows, 1 > >( fastor.data() );
276 template <
typename T,
size_t nRows,
typename =
void >
279 return Eigen::Map< Eigen::Matrix< T, nRows, 1 > >( fastor.data() );
282 template <
typename T,
size_t nRows,
size_t nCols,
typename =
void >
285 return Eigen::Map< Eigen::Matrix< T, nRows, nCols, Eigen::RowMajor > >( fastor.data() );
288 template <
template <
typename,
size_t... >
class TensorType, typename T, size_t... Rest >
291 ( Fastor::TensorMap< T, Rest... >( target ) ) = Fastor::torowmajor( source );
295 template <
DimensionType... dims,
typename T,
size_t... dims3D >
296 auto inline reduceTo2D(
const Fastor::Tensor< T, dims3D... >& theTensor3D )
299 static_assert(
sizeof...( dims ) ==
sizeof...( dims3D ),
300 "CONVERSION PACK (1) AND TENSOR-ORDER PACK (2) MUST HAVE SAME LENGTH" );
302 return theTensor3D( Fastor::fseq < dims == U ? 0 : 2, dims == U ? 2 : 3 > ()... );
305 template <
typename Derived,
size_t order >
306 auto inline reduceTo2D(
const Fastor::AbstractTensor< Derived, order >& theTensor3D )
308 using result_type =
typename Derived::result_type;
309 return reduceTo2D( result_type( theTensor3D ) );
317 template <
typename T,
size_t... dims2D >
318 auto inline expandTo3D(
const Fastor::Tensor< T, dims2D... >& theTensor2D )
320 static_assert( ( ( ( dims2D > 0 ) && ( dims2D < 3 ) ) && ... ),
321 "INPUT TENSOR IS NOT A VALID 2D MIXED DISPLACEMENT/ROTATION TENSOR" );
323 Fastor::Tensor< double,
const3( dims2D )... > theTensor3D( 0.0 );
325 theTensor3D( Fastor::fseq < dims2D == 2 ? 0 : 2, dims2D == 2 ? 2 : 3 > ()... ) = theTensor2D;
330 template <
typename Derived,
size_t order >
331 auto inline expandTo3D(
const Fastor::AbstractTensor< Derived, order >& theTensor2D )
333 using result_type =
typename Derived::result_type;
334 return expandTo3D( result_type( theTensor2D ) );
337 template <
typename T,
size_t... Rest >
341 Fastor::Tensor< T, Rest... > out;
342 T* out_data = out.data();
343 T* in_data = tensor.data();
345 for ( Fastor::FASTOR_INDEX
i = 0;
i < tensor.size(); ++
i ) {
346 out_data[out.get_mem_index(
i )] = in_data[tensor.get_mem_index(
i )] * scalar;
351 template <
typename T >
357 for (
int i = 0;
i < 3;
i++ ) {
358 for (
int j = 0;
j < 3;
j++ ) {
359 result +=
A(
i,
j ) *
B(
i,
j );
366 template <
typename T,
size_t... Rest >
372 Fastor::Tensor< T, Rest... > out;
373 T* out_data = out.data();
374 double* in_data =
in.data();
376 for ( Fastor::FASTOR_INDEX
i = 0;
i <
in.size(); ++
i ) {
377 out_data[out.get_mem_index(
i )] =
static_cast< T
>( in_data[
in.get_mem_index(
i )] );
382 template <
typename T,
size_t... Rest >
388 Fastor::Tensor< T, Rest... > out;
389 T* out_data = out.data();
390 double* in_data =
in.data();
392 for ( Fastor::FASTOR_INDEX
i = 0;
i <
in.size(); ++
i ) {
393 out_data[out.get_mem_index(
i )] =
static_cast< T
>( in_data[
in.get_mem_index(
i )] );
398 template <
typename T,
size_t... Rest >
399 Fastor::Tensor< double, Rest... >
makeReal(
const Fastor::Tensor< T, Rest... >&
in )
402 Fastor::Tensor< double, Rest... > out;
403 double* out_data = out.data();
404 T* in_data =
in.data();
406 for ( Fastor::FASTOR_INDEX
i = 0;
i <
in.size(); ++
i ) {
407 out_data[out.get_mem_index(
i )] =
static_cast< double >( in_data[
in.get_mem_index(
i )] );
412 template <
typename T,
size_t... Rest >
413 Fastor::Tensor< autodiff::dual, Rest... >
makeDual(
const Fastor::Tensor< T, Rest... >&
in )
416 Fastor::Tensor< autodiff::dual, Rest... > out;
417 autodiff::dual* out_data = out.data();
418 T* in_data =
in.data();
420 for ( Fastor::FASTOR_INDEX
i = 0;
i <
in.size(); ++
i ) {
421 out_data[out.get_mem_index(
i )] = autodiff::dual( in_data[
in.get_mem_index(
i )] );
426 template <
size_t order,
size_t... Rest >
428 const Fastor::Tensor< double, Rest... >&
in )
431 Fastor::Tensor< autodiff::HigherOrderDual< order, double >, Rest... > out;
432 autodiff::HigherOrderDual< order, double >* out_data = out.data();
433 double* in_data =
in.data();
435 for ( Fastor::FASTOR_INDEX
i = 0;
i <
in.size(); ++
i ) {
436 out_data[out.get_mem_index(
i )] = autodiff::HigherOrderDual< order, double >( in_data[
in.get_mem_index(
i )] );
441 template <
typename T >
448 template <
typename T >
451 Eigen::Matrix< T, 3, 3 > dummy = Eigen::Matrix< T, 3, 3 >::Identity();
453 Fastor::ColumnMajor );
Fastor::Index< K_, k_ > Kk
Definition: MarmotFastorTensorBasics.h:121
Fastor::Index< i_ > i
Definition: MarmotFastorTensorBasics.h:137
Fastor::Index< k_, l_ > kl
Definition: MarmotFastorTensorBasics.h:205
DimensionType
Definition: MarmotFastorTensorBasics.h:294
Fastor::Index< i_, j_, K_, J_ > ijKJ
Definition: MarmotFastorTensorBasics.h:160
Fastor::OIndex< I_, J_, k_, L_ > to_IJkL
Definition: MarmotFastorTensorBasics.h:224
Fastor::Index< m_, n_, k_, B_ > mnkB
Definition: MarmotFastorTensorBasics.h:218
Fastor::OIndex< I_, i_, k_, K_ > to_IikK
Definition: MarmotFastorTensorBasics.h:225
Fastor::Index< m_, L_, l_ > mLl
Definition: MarmotFastorTensorBasics.h:212
Fastor::Index< k_, K_ > kK
Definition: MarmotFastorTensorBasics.h:199
Fastor::Index< k_, L_ > kL
Definition: MarmotFastorTensorBasics.h:200
Fastor::Index< i_, I_, k_, K_ > iIkK
Definition: MarmotFastorTensorBasics.h:144
Fastor::OIndex< j_, A_, k_, B_ > to_jAkB
Definition: MarmotFastorTensorBasics.h:246
Fastor::TensorMap< double, 3, 3 > TensorMap33d
Definition: MarmotFastorTensorBasics.h:52
Fastor::Index< L_, m_, N_ > LmN
Definition: MarmotFastorTensorBasics.h:127
Fastor::Index< i_, j_, k_, l_ > ijkl
Definition: MarmotFastorTensorBasics.h:167
Fastor::Index< i_, I_, m_, n_ > iImn
Definition: MarmotFastorTensorBasics.h:146
Fastor::Index< M_, L_ > ML
Definition: MarmotFastorTensorBasics.h:130
Fastor::OIndex< I_, j_, k_, K_ > to_IjkK
Definition: MarmotFastorTensorBasics.h:226
Fastor::OIndex< i_, j_, K_, l_ > to_ijKl
Definition: MarmotFastorTensorBasics.h:241
@ j_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Index< i_, K_, j_, L_ > iKjL
Definition: MarmotFastorTensorBasics.h:153
Fastor::Index< j_, i_, n_ > jin
Definition: MarmotFastorTensorBasics.h:189
@ N_
Definition: MarmotFastorTensorBasics.h:90
Fastor::OIndex< j_, i_, k_, l_ > to_jikl
Definition: MarmotFastorTensorBasics.h:249
Fastor::OIndex< i_, j_, I_, J_ > to_ijIJ
Definition: MarmotFastorTensorBasics.h:233
Fastor::Index< j_, J_ > jJ
Definition: MarmotFastorTensorBasics.h:185
Fastor::Index< M_, K_ > MK
Definition: MarmotFastorTensorBasics.h:129
@ P_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Tensor< T, Rest... > multiplyFastorTensorWithScalar(Fastor::Tensor< T, Rest... > tensor, T scalar)
Definition: MarmotFastorTensorBasics.h:338
Fastor::Index< i_, N_, L_ > iNL
Definition: MarmotFastorTensorBasics.h:157
Fastor::Index< i_, J_, k_, L_ > iJkL
Definition: MarmotFastorTensorBasics.h:150
Fastor::Index< L_, N_ > LN
Definition: MarmotFastorTensorBasics.h:125
@ I_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Index< l_ > l
Definition: MarmotFastorTensorBasics.h:207
Fastor::Index< i_, B_ > iB
Definition: MarmotFastorTensorBasics.h:140
const EigenTensors::Tensor3333d I2xI2
Definition: MarmotTensor.h:38
const EigenTensors::Tensor3333d IFourthOrder
Definition: MarmotTensor.h:47
const Tensor3333d DeviatoricTranspose
Definition: MarmotFastorTensorBasics.h:81
@ B_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Tensor< T, 3, 3, 3, 3 > Tensor3333t
Definition: MarmotFastorTensorBasics.h:49
const Tensor3333d I4
Definition: MarmotFastorTensorBasics.h:72
Fastor::OIndex< i_, j_ > to_ij
Definition: MarmotFastorTensorBasics.h:232
const EigenTensors::Tensor3333d IFourthOrderTranspose
Definition: MarmotTensor.h:50
Fastor::Index< k_, m_ > km
Definition: MarmotFastorTensorBasics.h:206
Fastor::Index< i_, J_, L_, l_ > iJLl
Definition: MarmotFastorTensorBasics.h:149
Fastor::OIndex< i_, j_, k_, L_ > to_ijkL
Definition: MarmotFastorTensorBasics.h:240
const Tensor33d I
Definition: MarmotFastorTensorBasics.h:57
Fastor::Index< K_, L_ > KL
Definition: MarmotFastorTensorBasics.h:112
Fastor::Tensor< double, 3, 3 > Tensor33d
Definition: MarmotFastorTensorBasics.h:38
Fastor::OIndex< i_, j_, L_ > to_ijL
Definition: MarmotFastorTensorBasics.h:235
const EigenTensors::Tensor3333d Isym
Definition: MarmotTensor.h:41
@ K_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Index< i_, I_, K_, L_ > iIKL
Definition: MarmotFastorTensorBasics.h:142
Fastor::Index< i_, A_, k_, B_ > iAkB
Definition: MarmotFastorTensorBasics.h:139
Fastor::Index< J_, I_ > JI
Definition: MarmotFastorTensorBasics.h:105
Fastor::OIndex< k_, K_ > to_kK
Definition: MarmotFastorTensorBasics.h:251
Fastor::Index< I_, m_ > Im
Definition: MarmotFastorTensorBasics.h:104
Fastor::Index< K_, M_, J_ > KMJ
Definition: MarmotFastorTensorBasics.h:118
Fastor::OIndex< j_, A_, B_ > to_jAB
Definition: MarmotFastorTensorBasics.h:245
Fastor::Index< i_, A_ > iA
Definition: MarmotFastorTensorBasics.h:138
Fastor::Index< k_, I_ > kI
Definition: MarmotFastorTensorBasics.h:198
Fastor::Tensor< autodiff::HigherOrderDual< order, double >, Rest... > makeHigherOrderDual(const Fastor::Tensor< double, Rest... > &in)
Definition: MarmotFastorTensorBasics.h:427
Fastor::Index< i_, j_, k_ > ijk
Definition: MarmotFastorTensorBasics.h:164
Fastor::OIndex< j_, i_, k_, L_ > to_jikL
Definition: MarmotFastorTensorBasics.h:248
Fastor::Index< j_, k_, B_ > jkB
Definition: MarmotFastorTensorBasics.h:192
Fastor::OIndex< i_, I_, m_, n_ > to_iImn
Definition: MarmotFastorTensorBasics.h:231
Fastor::Index< L_ > L
Definition: MarmotFastorTensorBasics.h:122
Fastor::Index< m_, j_ > mj
Definition: MarmotFastorTensorBasics.h:213
@ U
Definition: MarmotFastorTensorBasics.h:294
Fastor::Index< i_, m_, k_ > imk
Definition: MarmotFastorTensorBasics.h:175
Fastor::Index< i_, L_ > iL
Definition: MarmotFastorTensorBasics.h:154
Fastor::Index< j_, A_ > jA
Definition: MarmotFastorTensorBasics.h:183
Fastor::OIndex< k_, L_ > to_kL
Definition: MarmotFastorTensorBasics.h:252
Fastor::Index< K_, L_, N_, M_ > KLNM
Definition: MarmotFastorTensorBasics.h:115
Fastor::Tensor< double, Rest... > makeReal(const Fastor::Tensor< T, Rest... > &in)
Definition: MarmotFastorTensorBasics.h:399
Fastor::Index< l_, B_ > lB
Definition: MarmotFastorTensorBasics.h:208
Fastor::Index< K_, J_ > KJ
Definition: MarmotFastorTensorBasics.h:110
Fastor::TensorMap< double, 3, 3, 3 > TensorMap333d
Definition: MarmotFastorTensorBasics.h:53
Fastor::OIndex< i_, j_, L_, m_ > to_ijLm
Definition: MarmotFastorTensorBasics.h:237
Fastor::Index< i_, j_, L_ > ijL
Definition: MarmotFastorTensorBasics.h:162
Fastor::Index< k_, A_ > kA
Definition: MarmotFastorTensorBasics.h:196
Fastor::Index< j_, K_ > jK
Definition: MarmotFastorTensorBasics.h:191
auto mapEigenToFastor(const Fastor::Tensor< T, nRows, nCols > &fastor)
Definition: MarmotFastorTensorBasics.h:259
@ M_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Index< J_, K_ > JK
Definition: MarmotFastorTensorBasics.h:106
Fastor::Index< M_, P_, m_ > MPm
Definition: MarmotFastorTensorBasics.h:132
FastorStandardTensors::Tensor33t< T > symmetric(const FastorStandardTensors::Tensor33t< T > &t)
Definition: MarmotFastorTensorBasics.h:442
Fastor::Index< i_, j_, K_, L_ > ijKL
Definition: MarmotFastorTensorBasics.h:161
Fastor::Index< i_, J_, l_ > iJl
Definition: MarmotFastorTensorBasics.h:151
@ W
Definition: MarmotFastorTensorBasics.h:294
Fastor::Index< P_, m_ > Pm
Definition: MarmotFastorTensorBasics.h:136
Fastor::Index< i_, n_ > in
Definition: MarmotFastorTensorBasics.h:179
Fastor::OIndex< i_, j_, k_, K_ > to_ijkK
Definition: MarmotFastorTensorBasics.h:239
Fastor::OIndex< i_, j_, k_, l_ > to_ijkl
Definition: MarmotFastorTensorBasics.h:242
Fastor::Tensor< T, 3, 3, 3 > Tensor333t
Definition: MarmotFastorTensorBasics.h:47
Fastor::Index< I_, i_, k_, K_ > IikK
Definition: MarmotFastorTensorBasics.h:101
Fastor::OIndex< i_, I_, K_, L_ > to_iIKL
Definition: MarmotFastorTensorBasics.h:229
constexpr int const3(size_t x)
Definition: MarmotFastorTensorBasics.h:312
Fastor::Index< m_, n_, k_, L_ > mnkL
Definition: MarmotFastorTensorBasics.h:219
Fastor::OIndex< i_, I_, j_, J_ > to_iIjJ
Definition: MarmotFastorTensorBasics.h:230
@ k_
Definition: MarmotFastorTensorBasics.h:90
Eigen::Matrix< double, 3, 3 > Matrix3d
Definition: MarmotTypedefs.h:40
Fastor::OIndex< i_, j_, m_, M_ > to_ijmM
Definition: MarmotFastorTensorBasics.h:244
Fastor::Index< m_, n_, K_, L_ > mnKL
Definition: MarmotFastorTensorBasics.h:216
Fastor::Index< j_, k_, l_ > jkl
Definition: MarmotFastorTensorBasics.h:193
Fastor::Index< j_ > j
Definition: MarmotFastorTensorBasics.h:182
@ l_
Definition: MarmotFastorTensorBasics.h:90
This file includes functions needed for calculations with stress and strain tensors written in voigt ...
Definition: MarmotTesting.h:37
Fastor::Index< i_, j_, m_, n_ > ijmn
Definition: MarmotFastorTensorBasics.h:170
Fastor::Index< K_, i_ > Ki
Definition: MarmotFastorTensorBasics.h:120
Fastor::Index< I_, K_ > IK
Definition: MarmotFastorTensorBasics.h:99
const Tensor3333d ITranspose
Definition: MarmotFastorTensorBasics.h:76
Fastor::Index< i_, K_ > iK
Definition: MarmotFastorTensorBasics.h:152
Fastor::OIndex< i_, j_, m_ > to_ijm
Definition: MarmotFastorTensorBasics.h:243
Fastor::Index< m_, n_ > mn
Definition: MarmotFastorTensorBasics.h:215
Fastor::Index< I_, J_ > IJ
Definition: MarmotFastorTensorBasics.h:96
Fastor::Index< K_, L_, P_, M_ > KLPM
Definition: MarmotFastorTensorBasics.h:116
const Tensor3333d DeviatoricSymmetric
Definition: MarmotFastorTensorBasics.h:83
Fastor::Index< J_, L_ > JL
Definition: MarmotFastorTensorBasics.h:107
Fastor::Index< j_, B_ > jB
Definition: MarmotFastorTensorBasics.h:184
Fastor::Index< i_, j_, l_ > ijl
Definition: MarmotFastorTensorBasics.h:168
Fastor::Tensor< double, 3, 3, 3, 3 > Tensor3333d
Definition: MarmotFastorTensorBasics.h:40
Fastor::Tensor< autodiff::dual, Rest... > makeDual(const Fastor::Tensor< T, Rest... > &in)
Definition: MarmotFastorTensorBasics.h:413
Fastor::Index< i_, m_, k_, l_ > imkl
Definition: MarmotFastorTensorBasics.h:176
Fastor::Index< I_, L_ > IL
Definition: MarmotFastorTensorBasics.h:103
Fastor::OIndex< I_, J_, K_, L_ > to_IJKL
Definition: MarmotFastorTensorBasics.h:222
Fastor::Tensor< T, Rest... > fastorTensorFromDoubleTensorMap(const Fastor::TensorMap< double, Rest... > &in)
Definition: MarmotFastorTensorBasics.h:383
const EigenTensors::Tensor333d LeviCivita3D
Definition: MarmotTensor.h:57
Fastor::Index< L_, K_ > LK
Definition: MarmotFastorTensorBasics.h:124
Fastor::Index< i_, j_, L_, m_ > ijLm
Definition: MarmotFastorTensorBasics.h:163
Fastor::Index< i_, m_, L_, k_ > imLk
Definition: MarmotFastorTensorBasics.h:178
Fastor::Index< I_, J_, M_, L_ > IJML
Definition: MarmotFastorTensorBasics.h:98
Fastor::Index< j_, L_, m_ > jLm
Definition: MarmotFastorTensorBasics.h:187
Fastor::Index< j_, i_ > ji
Definition: MarmotFastorTensorBasics.h:188
Fastor::Index< I_, i_ > Ii
Definition: MarmotFastorTensorBasics.h:100
Fastor::Index< K_, M_, N_ > KMN
Definition: MarmotFastorTensorBasics.h:119
Fastor::Index< i_, I_, j_, J_ > iIjJ
Definition: MarmotFastorTensorBasics.h:143
Fastor::Index< L_, I_ > LI
Definition: MarmotFastorTensorBasics.h:123
Fastor::Index< N_, m_ > Nm
Definition: MarmotFastorTensorBasics.h:135
Fastor::Index< k_, M_ > kM
Definition: MarmotFastorTensorBasics.h:201
Fastor::Index< i_, M_ > iM
Definition: MarmotFastorTensorBasics.h:155
Fastor::Index< i_, n_, B_ > inB
Definition: MarmotFastorTensorBasics.h:180
Fastor::Index< M_, J_, K_, L_ > MJKL
Definition: MarmotFastorTensorBasics.h:128
Fastor::Index< i_, N_ > iN
Definition: MarmotFastorTensorBasics.h:156
Fastor::Index< i_, j_, n_, k_ > ijnk
Definition: MarmotFastorTensorBasics.h:171
Fastor::Index< i_, I_ > iI
Definition: MarmotFastorTensorBasics.h:141
Fastor::Index< j_, k_ > jk
Definition: MarmotFastorTensorBasics.h:190
Fastor::OIndex< N_, L_, J_, l_ > to_NLJl
Definition: MarmotFastorTensorBasics.h:228
Fastor::Index< m_, n_, i_, j_ > mnij
Definition: MarmotFastorTensorBasics.h:217
Fastor::Tensor< double, 3, 3, 3 > Tensor333d
Definition: MarmotFastorTensorBasics.h:39
const EigenTensors::Tensor3333d Iskew
Definition: MarmotTensor.h:44
Fastor::Index< i_, j_, k_, K_ > ijkK
Definition: MarmotFastorTensorBasics.h:166
Fastor::Index< A_, B_ > AB
Definition: MarmotFastorTensorBasics.h:94
@ L_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Index< K_, L_, M_, N_ > KLMN
Definition: MarmotFastorTensorBasics.h:113
Fastor::Index< i_, j_, m_ > ijm
Definition: MarmotFastorTensorBasics.h:169
Fastor::Index< i_, J_ > iJ
Definition: MarmotFastorTensorBasics.h:147
auto expandTo3D(const Fastor::Tensor< T, dims2D... > &theTensor2D)
Definition: MarmotFastorTensorBasics.h:318
const Tensor3333d Deviatoric
Definition: MarmotFastorTensorBasics.h:79
Fastor::Index< k_, B_ > kB
Definition: MarmotFastorTensorBasics.h:197
Fastor::Index< i_, j_, n_, m_ > ijnm
Definition: MarmotFastorTensorBasics.h:172
Fastor::OIndex< I_, i_ > to_Ii
Definition: MarmotFastorTensorBasics.h:227
Fastor::Index< i_, j_ > ij
Definition: MarmotFastorTensorBasics.h:158
Fastor::Index< i_, j_, k_, B_ > ijkB
Definition: MarmotFastorTensorBasics.h:165
@ n_
Definition: MarmotFastorTensorBasics.h:90
FastorStandardTensors::Tensor33t< T > deviatoric(const FastorStandardTensors::Tensor33t< T > &t)
Definition: MarmotFastorTensorBasics.h:449
Fastor::Index< N_, L_, J_, l_ > NLJl
Definition: MarmotFastorTensorBasics.h:134
Fastor::OIndex< i_, j_, K_, L_ > to_ijKL
Definition: MarmotFastorTensorBasics.h:234
Fastor::Index< k_ > k
Definition: MarmotFastorTensorBasics.h:195
Fastor::Index< n_, B_ > nB
Definition: MarmotFastorTensorBasics.h:220
@ i_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Index< m_, K_ > mK
Definition: MarmotFastorTensorBasics.h:211
@ J_
Definition: MarmotFastorTensorBasics.h:90
T einsum_ij_ij_hardcoded(const FastorStandardTensors::Tensor33t< T > &A, const FastorStandardTensors::Tensor33t< T > &B)
Definition: MarmotFastorTensorBasics.h:352
const Tensor333d LeviCivita
Definition: MarmotFastorTensorBasics.h:60
Fastor::OIndex< j_, i_ > to_ji
Definition: MarmotFastorTensorBasics.h:247
Fastor::Tensor< T, 3 > Tensor3t
Definition: MarmotFastorTensorBasics.h:43
Fastor::OIndex< i_, j_, k_ > to_ijk
Definition: MarmotFastorTensorBasics.h:238
Fastor::Index< M_, N_, L_ > MNL
Definition: MarmotFastorTensorBasics.h:131
Fastor::Index< K_, I_ > KI
Definition: MarmotFastorTensorBasics.h:109
@ m_
Definition: MarmotFastorTensorBasics.h:90
const Tensor3333d ISymm
Definition: MarmotFastorTensorBasics.h:66
Fastor::Index< m_ > m
Definition: MarmotFastorTensorBasics.h:210
Fastor::Index< L_, m_ > Lm
Definition: MarmotFastorTensorBasics.h:126
Fastor::Index< i_, m_, L_ > imL
Definition: MarmotFastorTensorBasics.h:177
Fastor::Index< i_, j_, B_ > ijB
Definition: MarmotFastorTensorBasics.h:159
Fastor::Index< j_, L_ > jL
Definition: MarmotFastorTensorBasics.h:186
Fastor::Index< K_, L_, M_, P_ > KLMP
Definition: MarmotFastorTensorBasics.h:114
Fastor::TensorMap< double, 3 > TensorMap3d
Definition: MarmotFastorTensorBasics.h:51
Fastor::Index< k_, J_ > kJ
Definition: MarmotFastorTensorBasics.h:204
Fastor::OIndex< i_, j_, L_, k_ > to_ijLk
Definition: MarmotFastorTensorBasics.h:236
Fastor::Index< i_, k_ > ik
Definition: MarmotFastorTensorBasics.h:173
Fastor::Index< i_, I_, k_, L_ > iIkL
Definition: MarmotFastorTensorBasics.h:145
Fastor::Index< A_, i_ > Ai
Definition: MarmotFastorTensorBasics.h:93
Fastor::Index< A_ > A
Definition: MarmotFastorTensorBasics.h:92
Fastor::Tensor< T, 3, 3 > Tensor33t
Definition: MarmotFastorTensorBasics.h:45
Fastor::Tensor< T, Rest... > fastorTensorFromDoubleTensor(const Fastor::Tensor< double, Rest... > &in)
Definition: MarmotFastorTensorBasics.h:367
Fastor::Index< i_, m_ > im
Definition: MarmotFastorTensorBasics.h:174
auto reduceTo2D(const Fastor::Tensor< T, dims3D... > &theTensor3D)
Definition: MarmotFastorTensorBasics.h:296
Fastor::Index< i_, J_, K_, L_ > iJKL
Definition: MarmotFastorTensorBasics.h:148
Fastor::Index< l_, m_ > lm
Definition: MarmotFastorTensorBasics.h:209
Fastor::Index< m_, j_, L_ > mjL
Definition: MarmotFastorTensorBasics.h:214
Fastor::Index< j_, l_ > jl
Definition: MarmotFastorTensorBasics.h:194
const Tensor3333d IHyd
Definition: MarmotFastorTensorBasics.h:63
Fastor::Index< M_, i_ > Mi
Definition: MarmotFastorTensorBasics.h:133
void copyFastorToColumnMajor(T *target, const TensorType< T, Rest... > &source)
Definition: MarmotFastorTensorBasics.h:289
Fastor::Index< I_, k_ > Ik
Definition: MarmotFastorTensorBasics.h:102
Fastor::Index< K_, J_, N_ > KJN
Definition: MarmotFastorTensorBasics.h:111
Fastor::TensorMap< double, 3, 3, 3, 3 > TensorMap3333d
Definition: MarmotFastorTensorBasics.h:54
@ A_
Definition: MarmotFastorTensorBasics.h:90
Fastor::Index< B_ > B
Definition: MarmotFastorTensorBasics.h:95
Fastor::OIndex< j_, k_, i_, B_ > to_jkiB
Definition: MarmotFastorTensorBasics.h:250
Fastor::OIndex< I_, J_, k_, K_ > to_IJkK
Definition: MarmotFastorTensorBasics.h:223
Fastor::Index< K_, L_, m_ > KLm
Definition: MarmotFastorTensorBasics.h:117
Fastor::Index< k_, N_, L_ > kNL
Definition: MarmotFastorTensorBasics.h:202
Fastor::Tensor< double, 3 > Tensor3d
Definition: MarmotFastorTensorBasics.h:37
Fastor::Index< i_, n_, k_, B_ > inkB
Definition: MarmotFastorTensorBasics.h:181
const Tensor3333d ISkew
Definition: MarmotFastorTensorBasics.h:69
Fastor::Index< I_, J_, K_, L_ > IJKL
Definition: MarmotFastorTensorBasics.h:97
Fastor::Index< k_, j_ > kj
Definition: MarmotFastorTensorBasics.h:203
Fastor::Index< J_, k_ > Jk
Definition: MarmotFastorTensorBasics.h:108