From: Guido Kanschat Date: Thu, 18 Jan 2001 13:02:16 +0000 (+0000) Subject: new contract for Tensors of order 1 and 2 X-Git-Tag: v8.0.0~19811 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=722666fc5c4a7c50f78c3692c69586146a482c77;p=dealii.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