From: guido Date: Thu, 18 Jan 2001 13:02:16 +0000 (+0000) Subject: new contract for Tensors of order 1 and 2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fc78ca8b318667eeea9ae063f2adc76f8498d13;p=dealii-svn.git new contract for Tensors of order 1 and 2 git-svn-id: https://svn.dealii.org/trunk@3721 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/tensor.h b/deal.II/base/include/base/tensor.h index 760b360aaa..af950a21c1 100644 --- a/deal.II/base/include/base/tensor.h +++ b/deal.II/base/include/base/tensor.h @@ -436,6 +436,26 @@ void contract (Tensor<1,dim> &dest, +/** + * Contract a tensor of rank 1 with a tensor of rank 2. The result is + * @p{dest[i] = sum_j src1[j] src2[j][i]}. + * + * @author Guido Kanschat, 2001 + */ +template +inline +void contract (Tensor<1,dim> &dest, + const Tensor<1,dim> &src1, + const Tensor<2,dim> &src2) +{ + dest.clear (); + for (unsigned int i=0; i