From 39f5c90e607f084caa04b125eac75a7baeca7336 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 29 Mar 2005 21:50:41 +0000 Subject: [PATCH] Add a double_contract function. git-svn-id: https://svn.dealii.org/trunk@10305 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/tensor.h | 23 +++++++++++++++++++++++ deal.II/doc/news/changes.html | 9 +++++++++ 2 files changed, 32 insertions(+) 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 -- 2.39.5