From d042f49fc089efb344a6b98bba082e3eb1a4bbda Mon Sep 17 00:00:00 2001
From: Henry Weller <http://openfoam.org>
Date: Tue, 31 Oct 2017 10:06:19 +0000
Subject: [PATCH] BUG: CompactSpatialTensor: Corrected constructor from
 components

---
 .../CompactSpatialTensor.H                    |  3 +-
 .../CompactSpatialTensorI.H                   | 32 +++++++++----------
 .../CompactSpatialTensorTI.H                  | 32 +++++++++----------
 3 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/CompactSpatialTensor.H b/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/CompactSpatialTensor.H
index 1f051d919f4..25911601599 100644
--- a/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/CompactSpatialTensor.H
+++ b/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/CompactSpatialTensor.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2016-2017 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -130,6 +130,7 @@ public:
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 // Include inline implementations
+#include "CompactSpatialTensorT.H"
 #include "CompactSpatialTensorI.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/CompactSpatialTensorI.H b/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/CompactSpatialTensorI.H
index 742faf5716e..2750b6768b6 100644
--- a/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/CompactSpatialTensorI.H
+++ b/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensor/CompactSpatialTensorI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2016-2017 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -65,25 +65,25 @@ inline Foam::CompactSpatialTensor<Cmpt>::CompactSpatialTensor
     this->v_[1] = t01;
     this->v_[2] = t02;
 
-    this->v_[6 + 0] = t10;
-    this->v_[6 + 1] = t11;
-    this->v_[6 + 2] = t12;
+    this->v_[3 + 0] = t10;
+    this->v_[3 + 1] = t11;
+    this->v_[3 + 2] = t12;
 
-    this->v_[12 + 0] = t20;
-    this->v_[12 + 1] = t21;
-    this->v_[12 + 2] = t22;
+    this->v_[6 + 0] = t20;
+    this->v_[6 + 1] = t21;
+    this->v_[6 + 2] = t22;
 
-    this->v_[18 + 0] = t30;
-    this->v_[18 + 1] = t31;
-    this->v_[18 + 2] = t32;
+    this->v_[9 + 0] = t30;
+    this->v_[9 + 1] = t31;
+    this->v_[9 + 2] = t32;
 
-    this->v_[24 + 0] = t40;
-    this->v_[24 + 1] = t41;
-    this->v_[24 + 2] = t42;
+    this->v_[12 + 0] = t40;
+    this->v_[12 + 1] = t41;
+    this->v_[12 + 2] = t42;
 
-    this->v_[30 + 0] = t50;
-    this->v_[30 + 1] = t51;
-    this->v_[30 + 2] = t52;
+    this->v_[15 + 0] = t50;
+    this->v_[15 + 1] = t51;
+    this->v_[15 + 2] = t52;
 }
 
 
diff --git a/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensorT/CompactSpatialTensorTI.H b/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensorT/CompactSpatialTensorTI.H
index 284a3b3d0f7..ef133d1bac6 100644
--- a/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensorT/CompactSpatialTensorTI.H
+++ b/src/OpenFOAM/primitives/spatialVectorAlgebra/CompactSpatialTensorT/CompactSpatialTensorTI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2016-2017 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -65,25 +65,25 @@ inline Foam::CompactSpatialTensorT<Cmpt>::CompactSpatialTensorT
     this->v_[1] = t01;
     this->v_[2] = t02;
 
-    this->v_[6 + 0] = t10;
-    this->v_[6 + 1] = t11;
-    this->v_[6 + 2] = t12;
+    this->v_[3 + 0] = t10;
+    this->v_[3 + 1] = t11;
+    this->v_[3 + 2] = t12;
 
-    this->v_[12 + 0] = t20;
-    this->v_[12 + 1] = t21;
-    this->v_[12 + 2] = t22;
+    this->v_[6 + 0] = t20;
+    this->v_[6 + 1] = t21;
+    this->v_[6 + 2] = t22;
 
-    this->v_[18 + 0] = t30;
-    this->v_[18 + 1] = t31;
-    this->v_[18 + 2] = t32;
+    this->v_[9 + 0] = t30;
+    this->v_[9 + 1] = t31;
+    this->v_[9 + 2] = t32;
 
-    this->v_[24 + 0] = t40;
-    this->v_[24 + 1] = t41;
-    this->v_[24 + 2] = t42;
+    this->v_[12 + 0] = t40;
+    this->v_[12 + 1] = t41;
+    this->v_[12 + 2] = t42;
 
-    this->v_[30 + 0] = t50;
-    this->v_[30 + 1] = t51;
-    this->v_[30 + 2] = t52;
+    this->v_[15 + 0] = t50;
+    this->v_[15 + 1] = t51;
+    this->v_[15 + 2] = t52;
 }
 
 
-- 
GitLab