diff --git a/src/fileFormats/ensight/type/ensightPTraits.C b/src/fileFormats/ensight/type/ensightPTraits.C index f1a8894077..9eaf9d30f6 100644 --- a/src/fileFormats/ensight/type/ensightPTraits.C +++ b/src/fileFormats/ensight/type/ensightPTraits.C @@ -62,16 +62,15 @@ template<> const char* const Foam::ensightPTraits::typeName = "scalar"; - template<> const Foam::direction Foam::ensightPTraits::componentOrder[] = {0}; + template<> const char* const Foam::ensightPTraits::typeName = "tensor symm"; - template<> const Foam::direction Foam::ensightPTraits::componentOrder[] = {0, 3, 5, 1, 2, 4}; diff --git a/src/fileFormats/ensight/type/ensightPTraits.H b/src/fileFormats/ensight/type/ensightPTraits.H index 2aed592598..63a86e0ee0 100644 --- a/src/fileFormats/ensight/type/ensightPTraits.H +++ b/src/fileFormats/ensight/type/ensightPTraits.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2015 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,7 +28,7 @@ Class Foam::ensightPTraits Description - Conversion of OpenFOAM pTraits into the Ensight equivalent + Ensight names and component order for base types. For the purpose of traits, integers (label) are treated like floating point (scalar). Spherical tensors are mapped as a scalar. @@ -38,7 +38,6 @@ Description #ifndef ensightPTraits_H #define ensightPTraits_H -#include "pTraits.H" #include "fieldTypes.H" #include "direction.H" @@ -51,21 +50,21 @@ namespace Foam Class ensightPTraits Declaration \*---------------------------------------------------------------------------*/ -template -class ensightPTraits +template +struct ensightPTraits { -public: + //- The type name used in ensight case files + static const char* const typeName; - // Static data members - - static const char* const typeName; - - //- Ordering table: return OpenFOAM component given Ensight component - // This is used for the symmTensor ordering: Ensight requires - // xx yy zz xy xz yz - static const direction componentOrder[]; + //- Ordering table: return OpenFOAM component given Ensight component + // This is used for the symmTensor ordering: Ensight requires + // xx yy zz xy xz yz + static const direction componentOrder[]; }; + +// Specializations + template<> const char* const ensightPTraits