Identity: special type derived from SphericalTensor to provide the concept of identity (I)

Allows efficient operators to be defined for the interaction between
types and the equivalent identity.
This commit is contained in:
Henry Weller
2016-03-18 11:45:45 +00:00
parent 9c0c6c5f00
commit 6ab92370fb
2 changed files with 74 additions and 1 deletions

View File

@ -36,6 +36,7 @@ SourceFiles
#define sphericalTensor_H
#include "SphericalTensor.H"
#include "Identity.H"
#include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +49,7 @@ namespace Foam
typedef SphericalTensor<scalar> sphericalTensor;
// Identity tensor
static const sphericalTensor I(1);
static const Identity<scalar> I;
static const sphericalTensor oneThirdI(1.0/3.0);
static const sphericalTensor twoThirdsI(2.0/3.0);