foamVtkCore.C
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) 2017-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "foamVtkCore.H"
29
30// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31
32const Foam::Enum
33<
35>
37({
38 { fileTag::POLY_DATA, "vtp" },
39 { fileTag::UNSTRUCTURED_GRID, "vtu" },
40 { fileTag::MULTI_BLOCK, "vtm" },
41 // { fileTag::COLLECTION, "pvd" },
42});
43
44
45const Foam::Enum
46<
48>
50({
51 { fileTag::POLY_DATA, "0.1" },
52 { fileTag::UNSTRUCTURED_GRID, "0.1" },
53 { fileTag::MULTI_BLOCK, "1.0" },
54 // { fileTag::COLLECTION, "0.1" },
55});
56
57
58const Foam::Enum
59<
61>
63({
64 { fileTag::VTK_FILE, "VTKFile" },
65 { fileTag::DATA_ARRAY, "DataArray" },
66 { fileTag::BLOCK, "Block" },
67 { fileTag::PIECE, "Piece" },
68 { fileTag::DATA_SET, "DataSet" },
69 { fileTag::POINTS, "Points" },
70 { fileTag::CELLS, "Cells" },
71 { fileTag::POLYS, "Polys" },
72 { fileTag::VERTS, "Verts" },
73 { fileTag::LINES, "Lines" },
74 { fileTag::CELL_DATA, "CellData" },
75 { fileTag::POINT_DATA, "PointData" },
76 { fileTag::FIELD_DATA, "FieldData" },
77 { fileTag::POLY_DATA, "PolyData" },
78 { fileTag::UNSTRUCTURED_GRID, "UnstructuredGrid" },
79 { fileTag::MULTI_BLOCK, "vtkMultiBlockDataSet" },
80 // { fileTag::COLLECTION, "Collection" },
81});
82
83
84const Foam::Enum
85<
87>
89({
90 { fileAttr::OFFSET, "offset" },
91 { fileAttr::NUMBER_OF_COMPONENTS, "NumberOfComponents" },
92 { fileAttr::NUMBER_OF_TUPLES, "NumberOfTuples" },
93 { fileAttr::NUMBER_OF_POINTS, "NumberOfPoints" },
94 { fileAttr::NUMBER_OF_CELLS, "NumberOfCells" },
95 { fileAttr::NUMBER_OF_POLYS, "NumberOfPolys" },
96 { fileAttr::NUMBER_OF_VERTS, "NumberOfVerts" },
97 { fileAttr::NUMBER_OF_LINES, "NumberOfLines" },
98});
99
100
101const Foam::Enum
102<
104>
106({
107 { dataArrayAttr::POINTS, "Points" },
108 { dataArrayAttr::OFFSETS, "offsets" },
109 { dataArrayAttr::CONNECTIVITY, "connectivity" },
110 { dataArrayAttr::TYPES, "types" },
111 { dataArrayAttr::FACES, "faces" },
112 { dataArrayAttr::FACEOFFSETS, "faceoffsets" },
113});
114
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118// Legacy
119
121
122const Foam::Enum
123<
125>
127({
128 { vtk::fileTag::POLY_DATA, "POLYDATA" },
129 { vtk::fileTag::UNSTRUCTURED_GRID, "UNSTRUCTURED_GRID" },
130});
131
132
133const Foam::Enum
134<
136>
138({
139 { vtk::fileTag::POINTS, "POINTS" },
140 { vtk::fileTag::CELLS, "CELLS" },
141 { vtk::fileTag::POLYS, "POLYGONS" },
142 { vtk::fileTag::VERTS, "VERTICES" },
143 { vtk::fileTag::LINES, "LINES" },
144 { vtk::fileTag::CELL_DATA, "CELL_DATA" },
145 { vtk::fileTag::POINT_DATA, "POINT_DATA" },
146});
147
148
149const Foam::Enum
150<
152>
154({
155 { vtk::dataArrayAttr::OFFSETS, "OFFSETS" },
156 { vtk::dataArrayAttr::CONNECTIVITY, "CONNECTIVITY" },
157});
158
159
160// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
A class for handling words, derived from Foam::string.
Definition: word.H:68
const Foam::Enum< dataArrayAttr > dataArrayAttrNames
Legacy attributes (eg, OFFSETS)
const word fileExtension
Legacy file extension ("vtk")
const Foam::Enum< vtk::fileTag > fileTagNames
Legacy file tags (eg, LINES, CELL_DATA, POINT_DATA, ...)
const Foam::Enum< vtk::fileTag > contentNames
Legacy content names (POLYDATA, UNSTRUCTURED_GRID)
const Foam::Enum< dataArrayAttr > dataArrayAttrNames
Strings corresponding to the vtk XML DataArray attributes.
const Foam::Enum< fileAttr > fileAttrNames
Strings corresponding to the vtk XML attributes.
fileAttr
Some common XML attributes for vtk files.
Definition: foamVtkCore.H:144
dataArrayAttr
Some common names for XML DataArray entries.
Definition: foamVtkCore.H:160
fileTag
Some common XML tags for vtk files.
Definition: foamVtkCore.H:114
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
const Foam::Enum< fileTag > fileTagNames
Strings corresponding to the vtk XML tags.
const Foam::Enum< fileTag > fileContentVersions
Version string for some vtk XML file content types.