From e95a6955b917193a95991a1bec24cef8f219ca9b Mon Sep 17 00:00:00 2001
From: henry <Henry Weller h.weller@opencfd.co.uk>
Date: Tue, 10 Jun 2008 14:59:49 +0100
Subject: [PATCH] Added labelSphericalTensor to handle labelI correctly.

---
 src/OpenFOAM/Make/files                       |  5 +-
 .../labelSphericalTensor.C                    | 56 ++++++++++++++++
 .../labelSphericalTensor.H                    | 67 +++++++++++++++++++
 .../labelSymmTensor/labelSymmTensor.H         | 10 +--
 .../primitives/labelTensor/labelTensor.H      | 11 +--
 .../sphericalTensor/sphericalTensor.H         |  2 +-
 src/OpenFOAM/primitives/tensor/tensor.H       |  2 +-
 7 files changed, 130 insertions(+), 23 deletions(-)
 create mode 100644 src/OpenFOAM/primitives/labelSphericalTensor/labelSphericalTensor.C
 create mode 100644 src/OpenFOAM/primitives/labelSphericalTensor/labelSphericalTensor.H

diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files
index 3a49df4e218..c9be7642ba5 100644
--- a/src/OpenFOAM/Make/files
+++ b/src/OpenFOAM/Make/files
@@ -18,14 +18,15 @@ primitives/Scalar/scalar/scalar.C
 primitives/labelVector/labelVector.C
 primitives/vector/vector.C
 primitives/vector2D/vector2D.C
-primitives/labelTensor/labelTensor.C
 primitives/sphericalTensor/sphericalTensor.C
 primitives/sphericalTensor2D/sphericalTensor2D.C
 primitives/diagTensor/diagTensor.C
 primitives/symmTensor/symmTensor.C
-primitives/labelSymmTensor/labelSymmTensor.C
 primitives/tensor/tensor.C
 primitives/tensor2D/tensor2D.C
+primitives/labelSphericalTensor/labelSphericalTensor.C
+primitives/labelSymmTensor/labelSymmTensor.C
+primitives/labelTensor/labelTensor.C
 primitives/complex/complex.C
 primitives/complexVector/complexVector.C
 primitives/quaternion/quaternion.C
diff --git a/src/OpenFOAM/primitives/labelSphericalTensor/labelSphericalTensor.C b/src/OpenFOAM/primitives/labelSphericalTensor/labelSphericalTensor.C
new file mode 100644
index 00000000000..6b650cec64d
--- /dev/null
+++ b/src/OpenFOAM/primitives/labelSphericalTensor/labelSphericalTensor.C
@@ -0,0 +1,56 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "labelSphericalTensor.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+template<>
+const char* const labelSphericalTensor::typeName = "labelSphericalTensor";
+
+template<>
+const char* labelSphericalTensor::componentNames[] = {"ii"};
+
+template<>
+const labelSphericalTensor labelSphericalTensor::zero(0);
+
+template<>
+const labelSphericalTensor labelSphericalTensor::one(1);
+
+template<>
+const labelSphericalTensor labelSphericalTensor::I(1);
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/labelSphericalTensor/labelSphericalTensor.H b/src/OpenFOAM/primitives/labelSphericalTensor/labelSphericalTensor.H
new file mode 100644
index 00000000000..81d05a3c1f9
--- /dev/null
+++ b/src/OpenFOAM/primitives/labelSphericalTensor/labelSphericalTensor.H
@@ -0,0 +1,67 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Type
+    Foam::labelSphericalTensor
+
+Description
+    SphericalTensor of labels.
+
+SourceFiles
+    labelSphericalTensor.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef labelSphericalTensor_H
+#define labelSphericalTensor_H
+
+#include "SphericalTensor.H"
+#include "contiguous.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+typedef SphericalTensor<label> labelSphericalTensor;
+
+// Identity labelTensor
+static const labelSphericalTensor I(1);
+
+//- Specify data associated with labelSphericalTensor type is contiguous
+template<>
+inline bool contiguous<labelSphericalTensor>() {return true;}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/labelSymmTensor/labelSymmTensor.H b/src/OpenFOAM/primitives/labelSymmTensor/labelSymmTensor.H
index 68d5e49c052..f4a437335c7 100644
--- a/src/OpenFOAM/primitives/labelSymmTensor/labelSymmTensor.H
+++ b/src/OpenFOAM/primitives/labelSymmTensor/labelSymmTensor.H
@@ -23,7 +23,7 @@ License
     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Type
-    labelSymmTensor
+    Foam::labelSymmTensor
 
 Description
     SymmTensor or labels.
@@ -48,14 +48,6 @@ namespace Foam
 
 typedef SymmTensor<label> labelSymmTensor;
 
-// Identity labelSymmTensor
-static const labelSymmTensor labelI
-(
-    1, 0, 0,
-       1, 0,
-          1
-);
-
 //- Specify data associated with labelSymmTensor type is contiguous
 template<>
 inline bool contiguous<labelSymmTensor>() {return true;}
diff --git a/src/OpenFOAM/primitives/labelTensor/labelTensor.H b/src/OpenFOAM/primitives/labelTensor/labelTensor.H
index e9695bb8a1f..dd20fde6d1f 100644
--- a/src/OpenFOAM/primitives/labelTensor/labelTensor.H
+++ b/src/OpenFOAM/primitives/labelTensor/labelTensor.H
@@ -23,7 +23,7 @@ License
     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Type
-    labelTensor
+    Foam::labelTensor
 
 Description
     3D labelTensor obtained from generic Tensor
@@ -48,15 +48,6 @@ namespace Foam
 
 typedef Tensor<label> labelTensor;
 
-// Identity labelTensor
-static const labelTensor labelI
-(
-    1, 0, 0,
-    0, 1, 0,
-    0, 0, 1
-);
-
-
 //- Specify data associated with labelTensor type is contiguous
 template<>
 inline bool contiguous<labelTensor>() {return true;}
diff --git a/src/OpenFOAM/primitives/sphericalTensor/sphericalTensor.H b/src/OpenFOAM/primitives/sphericalTensor/sphericalTensor.H
index de2b852413e..81c453ff924 100644
--- a/src/OpenFOAM/primitives/sphericalTensor/sphericalTensor.H
+++ b/src/OpenFOAM/primitives/sphericalTensor/sphericalTensor.H
@@ -23,7 +23,7 @@ License
     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Type
-    sphericalTensor
+    Foam::sphericalTensor
 
 Description
     SphericalTensor of scalars.
diff --git a/src/OpenFOAM/primitives/tensor/tensor.H b/src/OpenFOAM/primitives/tensor/tensor.H
index 7b83722d877..691afc82253 100644
--- a/src/OpenFOAM/primitives/tensor/tensor.H
+++ b/src/OpenFOAM/primitives/tensor/tensor.H
@@ -23,7 +23,7 @@ License
     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Type
-    tensor
+    Foam::tensor
 
 Description
     Tensor or scalars.
-- 
GitLab