16 #ifndef dealii_tensor_deprecated_h 17 #define dealii_tensor_deprecated_h 19 #include <deal.II/base/tensor.h> 24 DEAL_II_NAMESPACE_OPEN
38 <<
"You have requested contraction of tensors over index " 40 <<
", but this is not possible for tensors of the current type.");
51 template <
int dim,
typename Number>
67 template <
int dim,
typename Number>
84 template <
int dim,
typename Number>
89 const unsigned int index1,
91 const unsigned int index3);
102 template <
int dim,
typename Number>
107 const unsigned int index1,
120 template <
int dim,
typename Number>
125 const unsigned int index1,
127 const unsigned int index2);
137 template <
int rank_1,
int rank_2,
int dim,
typename Number>
150 template <
int dim,
typename Number,
typename OtherNumber>
153 typename ProductType<Number,OtherNumber>::type
165 template <
int dim,
typename Number>
178 template <
int dim,
typename Number>
192 template <
int rank_1,
int rank_2,
int dim,
typename Number>
205 template <
int dim,
typename Number>
218 template <
int dim,
typename Number>
229 template <
int rank,
typename Number>
239 template <
typename Number>
248 template <
int dim,
typename Number>
254 for (
unsigned int i=0; i<dim; ++i)
255 res += src1[i] * src2[i];
260 template <
int dim,
typename Number>
267 for (
unsigned int i=0; i<dim; ++i)
268 for (
unsigned int j=0; j<dim; ++j)
269 for (
unsigned int k=0; k<dim; ++k)
270 for (
unsigned int l=0; l<dim; ++l)
271 dest[i][j] += src1[i][j][k][l] * src2[k][l];
274 template <
int dim,
typename Number>
288 for (
unsigned int i=0; i<dim; ++i)
289 for (
unsigned int j=0; j<dim; ++j)
290 for (
unsigned int k=0; k<dim; ++k)
291 dest[i][j] += src1[k][i] * src2[k][j];
294 for (
unsigned int i=0; i<dim; ++i)
295 for (
unsigned int j=0; j<dim; ++j)
296 for (
unsigned int k=0; k<dim; ++k)
297 dest[i][j] += src1[k][i] * src2[j][k];
308 for (
unsigned int i=0; i<dim; ++i)
309 for (
unsigned int j=0; j<dim; ++j)
310 for (
unsigned int k=0; k<dim; ++k)
311 dest[i][j] += src1[i][k] * src2[k][j];
314 for (
unsigned int i=0; i<dim; ++i)
315 for (
unsigned int j=0; j<dim; ++j)
316 for (
unsigned int k=0; k<dim; ++k)
317 dest[i][j] += src1[i][k] * src2[j][k];
330 template <
int dim,
typename Number>
341 for (
unsigned int i=0; i<dim; ++i)
342 for (
unsigned int j=0; j<dim; ++j)
343 for (
unsigned int k=0; k<dim; ++k)
344 dest[i][j] += src1[k][i][j] * src2[k];
348 for (
unsigned int i=0; i<dim; ++i)
349 for (
unsigned int j=0; j<dim; ++j)
350 for (
unsigned int k=0; k<dim; ++k)
351 dest[i][j] += src1[i][k][j] * src2[k];
355 for (
unsigned int i=0; i<dim; ++i)
356 for (
unsigned int j=0; j<dim; ++j)
357 for (
unsigned int k=0; k<dim; ++k)
358 dest[i][j] += src1[i][j][k] * src2[k];
366 template <
int dim,
typename Number>
380 for (
unsigned int i=0; i<dim; ++i)
381 for (
unsigned int j=0; j<dim; ++j)
382 for (
unsigned int k=0; k<dim; ++k)
383 for (
unsigned int l=0; l<dim; ++l)
384 dest[i][j][k] += src1[l][i][j] * src2[l][k];
387 for (
unsigned int i=0; i<dim; ++i)
388 for (
unsigned int j=0; j<dim; ++j)
389 for (
unsigned int k=0; k<dim; ++k)
390 for (
unsigned int l=0; l<dim; ++l)
391 dest[i][j][k] += src1[l][i][j] * src2[k][l];
402 for (
unsigned int i=0; i<dim; ++i)
403 for (
unsigned int j=0; j<dim; ++j)
404 for (
unsigned int k=0; k<dim; ++k)
405 for (
unsigned int l=0; l<dim; ++l)
406 dest[i][j][k] += src1[i][l][j] * src2[l][k];
409 for (
unsigned int i=0; i<dim; ++i)
410 for (
unsigned int j=0; j<dim; ++j)
411 for (
unsigned int k=0; k<dim; ++k)
412 for (
unsigned int l=0; l<dim; ++l)
413 dest[i][j][k] += src1[i][l][j] * src2[k][l];
424 for (
unsigned int i=0; i<dim; ++i)
425 for (
unsigned int j=0; j<dim; ++j)
426 for (
unsigned int k=0; k<dim; ++k)
427 for (
unsigned int l=0; l<dim; ++l)
428 dest[i][j][k] += src1[i][j][l] * src2[l][k];
431 for (
unsigned int i=0; i<dim; ++i)
432 for (
unsigned int j=0; j<dim; ++j)
433 for (
unsigned int k=0; k<dim; ++k)
434 for (
unsigned int l=0; l<dim; ++l)
435 dest[i][j][k] += src1[i][j][l] * src2[k][l];
447 template <
int rank_1,
int rank_2,
int dim,
typename Number>
453 TensorAccessors::internal::ReorderedIndexView<0, rank_2, const Tensor<rank_2, dim, Number> >
454 reordered = TensorAccessors::reordered_index_view<0, rank_2>(src2);
455 TensorAccessors::contract<1, rank_1, rank_2, dim>(dest, src1, reordered);
458 template <
int dim,
typename Number,
typename OtherNumber>
460 typename ProductType<Number,OtherNumber>::type
464 typename ProductType<Number,OtherNumber>::type res
465 =
typename ProductType<Number,OtherNumber>::type();
466 for (
unsigned int i=0; i<dim; ++i)
467 res += src1[i] * src2[i];
472 template <
int dim,
typename Number>
481 template <
int dim,
typename Number>
491 template <
int rank_1,
int rank_2,
int dim,
typename Number>
497 TensorAccessors::contract<0, rank_1, rank_2, dim>(dst, src1, src2);
500 template <
int dim,
typename Number>
506 for (
unsigned int i=0; i<dim; ++i)
507 dst[i] = src1 * src2[i];
510 template <
int dim,
typename Number>
516 for (
unsigned int i=0; i<dim; ++i)
517 dst[i] = src1[i] * src2;
520 template <
int rank,
typename Number>
527 template <
typename Number>
534 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)