16 #ifndef dealii_tensor_deprecated_h 17 #define dealii_tensor_deprecated_h 19 #include <deal.II/base/tensor.h> 24 DEAL_II_NAMESPACE_OPEN
39 <<
"You have requested contraction of tensors over index " << arg1
40 <<
", but this is not possible for tensors of the current type.");
51 template <
int dim,
typename Number>
52 DEAL_II_DEPRECATED
inline Number
66 template <
int dim,
typename Number>
67 DEAL_II_DEPRECATED
inline void 82 template <
int dim,
typename Number>
85 const unsigned int index1,
87 const unsigned int index3);
98 template <
int dim,
typename Number>
101 const unsigned int index1,
114 template <
int dim,
typename Number>
117 const unsigned int index1,
119 const unsigned int index2);
129 template <
int rank_1,
int rank_2,
int dim,
typename Number>
130 DEAL_II_DEPRECATED
inline void 141 template <
int dim,
typename Number,
typename OtherNumber>
142 DEAL_II_DEPRECATED
inline typename ProductType<Number, OtherNumber>::type
154 template <
int dim,
typename Number>
164 template <
int dim,
typename Number>
165 DEAL_II_DEPRECATED
inline void 176 template <
int rank_1,
int rank_2,
int dim,
typename Number>
177 DEAL_II_DEPRECATED
inline void 188 template <
int dim,
typename Number>
189 DEAL_II_DEPRECATED
inline void 200 template <
int dim,
typename Number>
209 template <
int rank,
typename Number>
210 DEAL_II_DEPRECATED
inline Number
218 template <
typename Number>
219 DEAL_II_DEPRECATED
inline Number
226 template <
int dim,
typename Number>
232 for (
unsigned int i = 0; i < dim; ++i)
233 res += src1[i] * src2[i];
238 template <
int dim,
typename Number>
244 for (
unsigned int i = 0; i < dim; ++i)
245 for (
unsigned int j = 0; j < dim; ++j)
246 for (
unsigned int k = 0; k < dim; ++k)
247 for (
unsigned int l = 0; l < dim; ++l)
248 dest[i][j] += src1[i][j][k][l] * src2[k][l];
251 template <
int dim,
typename Number>
254 const unsigned int index1,
256 const unsigned int index2)
266 for (
unsigned int i = 0; i < dim; ++i)
267 for (
unsigned int j = 0; j < dim; ++j)
268 for (
unsigned int k = 0; k < dim; ++k)
269 dest[i][j] += src1[k][i] * src2[k][j];
272 for (
unsigned int i = 0; i < dim; ++i)
273 for (
unsigned int j = 0; j < dim; ++j)
274 for (
unsigned int k = 0; k < dim; ++k)
275 dest[i][j] += src1[k][i] * src2[j][k];
286 for (
unsigned int i = 0; i < dim; ++i)
287 for (
unsigned int j = 0; j < dim; ++j)
288 for (
unsigned int k = 0; k < dim; ++k)
289 dest[i][j] += src1[i][k] * src2[k][j];
292 for (
unsigned int i = 0; i < dim; ++i)
293 for (
unsigned int j = 0; j < dim; ++j)
294 for (
unsigned int k = 0; k < dim; ++k)
295 dest[i][j] += src1[i][k] * src2[j][k];
308 template <
int dim,
typename Number>
311 const unsigned int index1,
319 for (
unsigned int i = 0; i < dim; ++i)
320 for (
unsigned int j = 0; j < dim; ++j)
321 for (
unsigned int k = 0; k < dim; ++k)
322 dest[i][j] += src1[k][i][j] * src2[k];
326 for (
unsigned int i = 0; i < dim; ++i)
327 for (
unsigned int j = 0; j < dim; ++j)
328 for (
unsigned int k = 0; k < dim; ++k)
329 dest[i][j] += src1[i][k][j] * src2[k];
333 for (
unsigned int i = 0; i < dim; ++i)
334 for (
unsigned int j = 0; j < dim; ++j)
335 for (
unsigned int k = 0; k < dim; ++k)
336 dest[i][j] += src1[i][j][k] * src2[k];
344 template <
int dim,
typename Number>
347 const unsigned int index1,
349 const unsigned int index2)
359 for (
unsigned int i = 0; i < dim; ++i)
360 for (
unsigned int j = 0; j < dim; ++j)
361 for (
unsigned int k = 0; k < dim; ++k)
362 for (
unsigned int l = 0; l < dim; ++l)
363 dest[i][j][k] += src1[l][i][j] * src2[l][k];
366 for (
unsigned int i = 0; i < dim; ++i)
367 for (
unsigned int j = 0; j < dim; ++j)
368 for (
unsigned int k = 0; k < dim; ++k)
369 for (
unsigned int l = 0; l < dim; ++l)
370 dest[i][j][k] += src1[l][i][j] * src2[k][l];
381 for (
unsigned int i = 0; i < dim; ++i)
382 for (
unsigned int j = 0; j < dim; ++j)
383 for (
unsigned int k = 0; k < dim; ++k)
384 for (
unsigned int l = 0; l < dim; ++l)
385 dest[i][j][k] += src1[i][l][j] * src2[l][k];
388 for (
unsigned int i = 0; i < dim; ++i)
389 for (
unsigned int j = 0; j < dim; ++j)
390 for (
unsigned int k = 0; k < dim; ++k)
391 for (
unsigned int l = 0; l < dim; ++l)
392 dest[i][j][k] += src1[i][l][j] * src2[k][l];
403 for (
unsigned int i = 0; i < dim; ++i)
404 for (
unsigned int j = 0; j < dim; ++j)
405 for (
unsigned int k = 0; k < dim; ++k)
406 for (
unsigned int l = 0; l < dim; ++l)
407 dest[i][j][k] += src1[i][j][l] * src2[l][k];
410 for (
unsigned int i = 0; i < dim; ++i)
411 for (
unsigned int j = 0; j < dim; ++j)
412 for (
unsigned int k = 0; k < dim; ++k)
413 for (
unsigned int l = 0; l < dim; ++l)
414 dest[i][j][k] += src1[i][j][l] * src2[k][l];
426 template <
int rank_1,
int rank_2,
int dim,
typename Number>
431 TensorAccessors::internal::
432 ReorderedIndexView<0, rank_2, const Tensor<rank_2, dim, Number>>
433 reordered = TensorAccessors::reordered_index_view<0, rank_2>(src2);
434 TensorAccessors::contract<1, rank_1, rank_2, dim>(dest, src1, reordered);
437 template <
int dim,
typename Number,
typename OtherNumber>
438 inline typename ProductType<Number, OtherNumber>::type
442 typename ProductType<Number, OtherNumber>::type res =
443 typename ProductType<Number, OtherNumber>::type();
444 for (
unsigned int i = 0; i < dim; ++i)
445 res += src1[i] * src2[i];
450 template <
int dim,
typename Number>
457 template <
int dim,
typename Number>
465 template <
int rank_1,
int rank_2,
int dim,
typename Number>
471 TensorAccessors::contract<0, rank_1, rank_2, dim>(dst, src1, src2);
474 template <
int dim,
typename Number>
479 for (
unsigned int i = 0; i < dim; ++i)
480 dst[i] = src1 * src2[i];
483 template <
int dim,
typename Number>
488 for (
unsigned int i = 0; i < dim; ++i)
489 dst[i] = src1[i] * src2;
492 template <
int rank,
typename Number>
499 template <
typename Number>
506 DEAL_II_NAMESPACE_CLOSE
void double_contract(SymmetricTensor< 2, 1, typename ProductType< Number, OtherNumber >::type > &tmp, const SymmetricTensor< 4, 1, Number > &t, const SymmetricTensor< 2, 1, OtherNumber > &s)
void cross_product(Tensor< 1, dim, Number > &dst, const Tensor< 1, dim, Number > &src)
#define DeclException1(Exception1, type1, outsequence)
Tensor< 1, dim, Number > cross_product_2d(const Tensor< 1, dim, Number > &src)
#define Assert(cond, exc)
SymmetricTensor< 4, dim, Number > outer_product(const SymmetricTensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Number > &t2)
Tensor< 1, dim, Number > cross_product_3d(const Tensor< 1, dim, Number > &src1, const Tensor< 1, dim, Number > &src2)
Number determinant(const SymmetricTensor< 2, dim, Number > &t)
Tensor< rank_1+rank_2 - 2, dim, typename ProductType< Number, OtherNumber >::type >::tensor_type contract(const Tensor< rank_1, dim, Number > &src1, const Tensor< rank_2, dim, OtherNumber > &src2)
static ::ExceptionBase & ExcInvalidTensorContractionIndex(int arg1)