From: guido Date: Tue, 18 May 2004 07:51:20 +0000 (+0000) Subject: more complex contraction X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98d0aaff09191d8b23480e11b166e410a35c9117;p=dealii-svn.git more complex contraction git-svn-id: https://svn.dealii.org/trunk@9250 0785d39b-7218-0410-832d-ea1e28bc413d --- 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 /**