From: Wolfgang Bangerth Date: Tue, 29 Mar 2005 21:50:41 +0000 (+0000) Subject: Add a double_contract function. X-Git-Tag: v8.0.0~14242 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39f5c90e607f084caa04b125eac75a7baeca7336;p=dealii.git Add a double_contract function. git-svn-id: https://svn.dealii.org/trunk@10305 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/tensor.h b/deal.II/base/include/base/tensor.h index 742d0fc7a6..c8eb359225 100644 --- a/deal.II/base/include/base/tensor.h +++ b/deal.II/base/include/base/tensor.h @@ -724,6 +724,29 @@ void contract (Tensor<4,dim> &dest, } +/** + * Contract the last two indices of src1 with the two indices + * src2, creating a rank-2 tensor. This is the matrix-vector + * product analog operation between tensors of rank 4 and rank 2. + * + * @relates Tensor + * @author Wolfgang Bangerth, 2005 + */ +template +inline +void double_contract (Tensor<2,dim> &dest, + const Tensor<4,dim> &src1, + const Tensor<2,dim> &src2) +{ + dest.clear (); + for (unsigned int i=0; ibase
    +
  1. + New: The new function double_contract contracts two tensors of + rank 4 and 2 into a tensor of rank 2, by contracting over two + indices at the same time. +
    + (WB, 2005/03/29) +

    +
  2. New: The new function TableIndicesBase::sort allows to sort the indices