From 1346cc9c9d815e9b993f0e00caa00e8d48ebaa19 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Fri, 18 Mar 2016 21:52:00 +0000
Subject: [PATCH] SphericalTensor/Identity: Added dual form

---
 .../primitives/SphericalTensor/Identity.H     | 25 ++++++++++++++++---
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/OpenFOAM/primitives/SphericalTensor/Identity.H b/src/OpenFOAM/primitives/SphericalTensor/Identity.H
index e175edfe322..014adae6a28 100644
--- a/src/OpenFOAM/primitives/SphericalTensor/Identity.H
+++ b/src/OpenFOAM/primitives/SphericalTensor/Identity.H
@@ -25,7 +25,8 @@ Class
     Foam::Identity
 
 Description
-    Templated Identity tensor derived from SphericalTensor.
+    Templated identity and dual space identity tensors
+    derived from SphericalTensor.
 
 \*---------------------------------------------------------------------------*/
 
@@ -51,13 +52,29 @@ class Identity
 
 public:
 
-    // Constructors
-
+    //- Construct initializing the SphericalTensor to 1
+    Identity()
+    :
+        SphericalTensor<Cmpt>(1)
+    {}
+
+    //- The identity type in the dual space
+    class dual
+    :
+        public SphericalTensor<Cmpt>
+    {
         //- Construct initializing the SphericalTensor to 1
-        Identity()
+        dual()
         :
             SphericalTensor<Cmpt>(1)
         {}
+    };
+
+    //- Return the identity in the dual space
+    inline dual operator*()
+    {
+        return dual();
+    }
 };
 
 
-- 
GitLab