ensightPTraits.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2015 OpenFOAM Foundation
9  Copyright (C) 2019-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::ensightPTraits
29 
30 Description
31  Ensight names and component order for base types.
32 
33  For the purpose of traits, integers (label) are treated like
34  floating point (scalar). Spherical tensors are mapped as a scalar.
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_ensightPTraits_H
39 #define Foam_ensightPTraits_H
40 
41 #include "fieldTypes.H"
42 #include "direction.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class ensightPTraits Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Type>
54 struct ensightPTraits
55 {
56  //- The type name used in ensight case files
57  static const char* const typeName;
58 
59  //- Ordering table: return OpenFOAM component given Ensight component
60  // Primarily used for remapping of symmTensor.
61  // OpenFOAM uses (XX, XY, XZ, YY, YZ, ZZ) order,
62  // Ensight uses (XX, YY, ZZ, XY, YZ, XZ) order (like VTK).
63  static const direction componentOrder[];
64 };
65 
66 
67 // Specializations
68 
69 template<> const char* const ensightPTraits<label>::typeName;
71 
72 template<> const char* const ensightPTraits<float>::typeName;
74 
75 template<> const char* const ensightPTraits<double>::typeName;
77 
78 template<> const char* const ensightPTraits<vector>::typeName;
80 
81 template<> const char* const ensightPTraits<sphericalTensor>::typeName;
83 
84 template<> const char* const ensightPTraits<symmTensor>::typeName;
86 
87 template<> const char* const ensightPTraits<tensor>::typeName;
89 
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 } // End namespace Foam
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 #endif
98 
99 // ************************************************************************* //
uint8_t direction
Definition: direction.H:46
Ensight names and component order for base types.
const char *const typeName
Direction is an 8-bit unsigned integer type used to represent Cartesian directions, components etc.
const Foam::direction componentOrder[]
Namespace for OpenFOAM.