diff --git a/src/OpenFOAM/primitives/SphericalTensor/Identity.H b/src/OpenFOAM/primitives/SphericalTensor/Identity.H index e175edfe32..014adae6a2 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(1) + {} + //- The identity type in the dual space + class dual + : + public SphericalTensor + { //- Construct initializing the SphericalTensor to 1 - Identity() + dual() : SphericalTensor(1) {} + }; + + //- Return the identity in the dual space + inline dual operator*() + { + return dual(); + } };