From 9a0c4190e44788944f6af6d68fd76096337561ef Mon Sep 17 00:00:00 2001
From: Michael Wild <themiwi@users.sourceforge.net>
Date: Tue, 2 Jul 2013 17:31:52 +0200
Subject: [PATCH] FIX: innerProduct::type of SymmTensor's should be Tensor, not
 SymmTensor

As already partially fixed in issue #348, the dot (inner) product of two
symmetric tensors is not symmetric in general. Here, the partial
specialization of the innerProduct meta-function for two SymmTensor
arguments was still returning a SymmTensor, which resulted in
Foam::dot() failing to compile.

Fixes http://www.openfoam.com/mantisbt/view.php?id=348.

Signed-off-by: Michael Wild <themiwi@users.sourceforge.net>
---
 applications/test/tensor/Test-tensor.C           | 1 +
 src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/applications/test/tensor/Test-tensor.C b/applications/test/tensor/Test-tensor.C
index 6da37d3..b0c1b65 100644
--- a/applications/test/tensor/Test-tensor.C
+++ b/applications/test/tensor/Test-tensor.C
@@ -57,6 +57,7 @@ int main()
 
     Info<< "Check for dot product of symmetric tensors "
         << (st1 & st2) << endl;
+    Info<< dot(st1, st2) << endl;
 
     vector v1(1, 2, 3);
 
diff --git a/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H b/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H
index dce7984..19bcfb3 100644
--- a/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H
+++ b/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H
@@ -529,7 +529,7 @@ class innerProduct<SymmTensor<Cmpt>, SymmTensor<Cmpt> >
 {
 public:
 
-    typedef SymmTensor<Cmpt> type;
+    typedef Tensor<Cmpt> type;
 };
 
 template<class Cmpt>
-- 
1.8.1.2

