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>
66 template <
int dim,
typename Number>
82 template <
int dim,
typename Number>
86 const unsigned int index1,
88 const unsigned int index3) DEAL_II_DEPRECATED;
99 template <
int dim,
typename Number>
103 const unsigned int index1,
116 template <
int dim,
typename Number>
120 const unsigned int index1,
122 const unsigned int index2) DEAL_II_DEPRECATED;
132 template <
int rank_1,
int rank_2,
int dim,
typename Number>
144 template <
int dim,
typename Number,
typename OtherNumber>
158 template <
int dim,
typename Number>
170 template <
int dim,
typename Number>
183 template <
int rank_1,
int rank_2,
int dim,
typename Number>
195 template <
int dim,
typename Number>
207 template <
int dim,
typename Number>
211 const Number src2) DEAL_II_DEPRECATED;
217 template <
int rank,
typename Number>
226 template <
typename Number>
234 template <
int dim,
typename Number>
240 for (
unsigned int i=0; i<dim; ++i)
241 res += src1[i] * src2[i];
246 template <
int dim,
typename Number>
253 for (
unsigned int i=0; i<dim; ++i)
254 for (
unsigned int j=0; j<dim; ++j)
255 for (
unsigned int k=0; k<dim; ++k)
256 for (
unsigned int l=0; l<dim; ++l)
257 dest[i][j] += src1[i][j][k][l] * src2[k][l];
260 template <
int dim,
typename Number>
274 for (
unsigned int i=0; i<dim; ++i)
275 for (
unsigned int j=0; j<dim; ++j)
276 for (
unsigned int k=0; k<dim; ++k)
277 dest[i][j] += src1[k][i] * src2[k][j];
280 for (
unsigned int i=0; i<dim; ++i)
281 for (
unsigned int j=0; j<dim; ++j)
282 for (
unsigned int k=0; k<dim; ++k)
283 dest[i][j] += src1[k][i] * src2[j][k];
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[i][k] * src2[k][j];
300 for (
unsigned int i=0; i<dim; ++i)
301 for (
unsigned int j=0; j<dim; ++j)
302 for (
unsigned int k=0; k<dim; ++k)
303 dest[i][j] += src1[i][k] * src2[j][k];
316 template <
int dim,
typename Number>
327 for (
unsigned int i=0; i<dim; ++i)
328 for (
unsigned int j=0; j<dim; ++j)
329 for (
unsigned int k=0; k<dim; ++k)
330 dest[i][j] += src1[k][i][j] * src2[k];
334 for (
unsigned int i=0; i<dim; ++i)
335 for (
unsigned int j=0; j<dim; ++j)
336 for (
unsigned int k=0; k<dim; ++k)
337 dest[i][j] += src1[i][k][j] * src2[k];
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[i][j][k] * src2[k];
352 template <
int dim,
typename Number>
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[l][k];
373 for (
unsigned int i=0; i<dim; ++i)
374 for (
unsigned int j=0; j<dim; ++j)
375 for (
unsigned int k=0; k<dim; ++k)
376 for (
unsigned int l=0; l<dim; ++l)
377 dest[i][j][k] += src1[l][i][j] * src2[k][l];
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[l][k];
395 for (
unsigned int i=0; i<dim; ++i)
396 for (
unsigned int j=0; j<dim; ++j)
397 for (
unsigned int k=0; k<dim; ++k)
398 for (
unsigned int l=0; l<dim; ++l)
399 dest[i][j][k] += src1[i][l][j] * src2[k][l];
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[l][k];
417 for (
unsigned int i=0; i<dim; ++i)
418 for (
unsigned int j=0; j<dim; ++j)
419 for (
unsigned int k=0; k<dim; ++k)
420 for (
unsigned int l=0; l<dim; ++l)
421 dest[i][j][k] += src1[i][j][l] * src2[k][l];
433 template <
int rank_1,
int rank_2,
int dim,
typename Number>
439 TensorAccessors::internal::ReorderedIndexView<0, rank_2, const Tensor<rank_2, dim, Number> >
440 reordered = TensorAccessors::reordered_index_view<0, rank_2>(src2);
441 TensorAccessors::contract<1, rank_1, rank_2, dim>(dest, src1, reordered);
444 template <
int dim,
typename Number,
typename OtherNumber>
452 for (
unsigned int i=0; i<dim; ++i)
453 res += src1[i] * src2[i];
458 template <
int dim,
typename Number>
467 template <
int dim,
typename Number>
477 template <
int rank_1,
int rank_2,
int dim,
typename Number>
483 TensorAccessors::contract<0, rank_1, rank_2, dim>(dst, src1, src2);
486 template <
int dim,
typename Number>
492 for (
unsigned int i=0; i<dim; ++i)
493 dst[i] = src1 * src2[i];
496 template <
int dim,
typename Number>
502 for (
unsigned int i=0; i<dim; ++i)
503 dst[i] = src1[i] * src2;
506 template <
int rank,
typename Number>
513 template <
typename Number>
520 DEAL_II_NAMESPACE_CLOSE
void double_contract(SymmetricTensor< 2, 1, Number > &tmp, const SymmetricTensor< 4, 1, Number > &t, const SymmetricTensor< 2, 1, Number > &s)
#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)
void cross_product(Tensor< 1, dim, Number > &dst, const Tensor< 1, dim, Number > &src) 1
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)