From 5759501af5215abfc197f4ccbf5b9c04c1c4cca7 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 1 Jun 2005 00:21:08 +0000 Subject: [PATCH] Add outer_product function. git-svn-id: https://svn.dealii.org/trunk@10798 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/symmetric_tensor.h | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/deal.II/base/include/base/symmetric_tensor.h b/deal.II/base/include/base/symmetric_tensor.h index 4a1f3eb20a..d2dc48d252 100644 --- a/deal.II/base/include/base/symmetric_tensor.h +++ b/deal.II/base/include/base/symmetric_tensor.h @@ -2125,6 +2125,34 @@ identity_tensor () +/** + * Return the tensor of rank 4 that is the outer product of the two tensors + * given as arguments, i.e. the result T=t1 \otimes t2 satisfies + * T phi = t1 (t2 : phi) for all symmetric tensors phi. + * + * @relates SymmetricTensor + * @author Wolfgang Bangerth, 2005 + */ +template +inline +SymmetricTensor<4,dim> +outer_product (const SymmetricTensor<2,dim> &t1, + const SymmetricTensor<2,dim> &t2) +{ + SymmetricTensor<4,dim> tmp; + + // fill only the elements really needed + for (unsigned int i=0; i