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-2021 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 ensightPTraits_H
39 #define 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  // This is used for the symmTensor ordering: Ensight requires
61  // xx yy zz xy xz yz
62  static const direction componentOrder[];
63 };
64 
65 
66 // Specializations
67 
68 template<>
69 const char* const ensightPTraits<label>::typeName;
70 
71 template<>
73 
74 template<>
75 const char* const ensightPTraits<scalar>::typeName;
76 
77 template<>
79 
80 template<>
81 const char* const ensightPTraits<vector>::typeName;
82 
83 template<>
85 
86 template<>
88 
89 template<>
91 
92 template<>
93 const char* const ensightPTraits<symmTensor>::typeName;
94 
95 template<>
97 
98 template<>
99 const char* const ensightPTraits<tensor>::typeName;
100 
101 template<>
103 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 } // End namespace Foam
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 #endif
112 
113 // ************************************************************************* //
Foam::ensightPTraits::componentOrder
const Foam::direction componentOrder[]
Definition: ensightPTraits.C:39
Foam::ensightPTraits
Ensight names and component order for base types.
Definition: ensightPTraits.H:53
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
direction.H
Direction is an 8-bit unsigned integer type used to represent Cartesian directions,...
Foam::ensightPTraits::typeName
const char *const typeName
Definition: ensightPTraits.C:35
Foam::ensightPTraits::typeName
static const char *const typeName
The type name used in ensight case files.
Definition: ensightPTraits.H:56
Foam::direction
uint8_t direction
Definition: direction.H:52
fieldTypes.H
Header files for all the primitive types that Fields are instantiated for.