From d70dd735d18daf4cd9e16feda74e97c5ed5f8a30 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 24 Jul 2000 07:42:00 +0000 Subject: [PATCH] Implement outer_product functions for tensors. git-svn-id: https://svn.dealii.org/trunk@3191 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/tensor.h | 99 ++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/deal.II/base/include/base/tensor.h b/deal.II/base/include/base/tensor.h index 7541b23d55..207cec5af5 100644 --- a/deal.II/base/include/base/tensor.h +++ b/deal.II/base/include/base/tensor.h @@ -587,6 +587,105 @@ void contract (Tensor<4,dim> &dest, }; + +/** + * Form the outer product of two tensors of rank 1 and 1, i.e. + * @p{dst[i][j] = src1[i] * src2[j]}. + * + * @author Wolfgang Bangerth, 2000 + */ +template +void outer_product (Tensor<2,dim> &dst, + const Tensor<1,dim> &src1, + const Tensor<1,dim> &src2) +{ + for (unsigned int i=0; i +void outer_product (Tensor<3,dim> &dst, + const Tensor<1,dim> &src1, + const Tensor<2,dim> &src2) +{ + for (unsigned int i=0; i +void outer_product (Tensor<3,dim> &dst, + const Tensor<2,dim> &src1, + const Tensor<1,dim> &src2) +{ + for (unsigned int i=0; i +void outer_product (Tensor<1,dim> &dst, + const double src1, + const Tensor<1,dim> &src2) +{ + for (unsigned int i=0; i +void outer_product (Tensor<1,dim> &dst, + const Tensor<1,dim> src1, + const double src2) +{ + for (unsigned int i=0; i