From 205219968b746d21ffd2bfd8760b2a4352b525de Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 18 May 2004 07:51:20 +0000 Subject: [PATCH] more complex contraction git-svn-id: https://svn.dealii.org/trunk@9250 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/tensor.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/deal.II/base/include/base/tensor.h b/deal.II/base/include/base/tensor.h index be4266a21b..8317d89ceb 100644 --- a/deal.II/base/include/base/tensor.h +++ b/deal.II/base/include/base/tensor.h @@ -721,6 +721,28 @@ void contract (Tensor<4,dim> &dest, +/** + * Contract three tensors, corresponding to the matrix vector product + * uT A v. + * + * @relates Tensor + * @author Guido Kanschat, 2004 + */ +template +inline +double contract3 (const Tensor<1,dim>& u, + const Tensor<2,dim>& A, + const Tensor<1,dim>& v) +{ + double result = 0.; + + for (unsigned int i=0; idst[i][j] = src1[i] * src2[j]. @@ -1069,7 +1091,7 @@ transpose (const Tensor<2,dim> &t) return tt; } - +/// @if NoDoc /** * Return the transpose of the given tensor. This is the @@ -1123,7 +1145,7 @@ transpose (const Tensor<2,3> &t) return Tensor<2,3>(x); } - +/// @endif /** -- 2.39.5