vtkTopo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::vtkTopo
26 
27 Description
28  Polyhedral cell decomposition for VTK.
29 
30 SourceFiles
31  vtkTopo.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef vtkTopo_H
36 #define vtkTopo_H
37 
38 #include "labelList.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward declaration of classes
46 class polyMesh;
47 
48 /*---------------------------------------------------------------------------*\
49  Class vtkTopo Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class vtkTopo
53 {
54 public:
55 
56  // Public Enumerations
57 
58  //- Groups of cell types retain as polyhedra
59  enum class vtkPolyhedra
60  {
61  none,
62  polyhedra,
63  all
64  };
65 
66  //- Names of groups of cell types retain as polyhedra
68 
69  //- Equivalent to enumeration in "vtkCellType.h"
70  enum vtkTypes
71  {
74  VTK_QUAD = 9,
75  VTK_TETRA = 10,
77  VTK_WEDGE = 13,
78  VTK_PYRAMID = 14,
80  };
81 
82 
83 private:
84 
85  // Private Data
86 
87  //- Reference to the mesh
88  const polyMesh& mesh_;
89 
90  //- Cell types to retain as polyhedra
91  const vtkPolyhedra polyhedra_;
92 
93  //- Vertices per cell (including added cells) in vtk ordering
94  labelListList vertLabels_;
95 
96  //- Cell types (including added cells) in vtk numbering
97  labelList cellTypes_;
98 
99  //- ...
100  labelList addPointCellLabels_;
101 
102  //- ...
103  labelList superCells_;
104 
105 
106 public:
107 
108  // Constructors
109 
110  //- Construct from components
111  vtkTopo(const polyMesh& mesh, const vtkPolyhedra& polyhedra);
112 
113  //- Disallow default bitwise copy construction
114  vtkTopo(const vtkTopo&) = delete;
115 
116 
117  // Member Functions
118 
119  // Access
120 
121  const labelListList& vertLabels() const
122  {
123  return vertLabels_;
124  }
125 
126  const labelList& cellTypes() const
127  {
128  return cellTypes_;
129  }
130 
131  const labelList& addPointCellLabels() const
132  {
133  return addPointCellLabels_;
134  }
135 
136  const labelList& superCells() const
137  {
138  return superCells_;
139  }
140 
141 
142  // Member Operators
143 
144  //- Disallow default bitwise assignment
145  void operator=(const vtkTopo&) = delete;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Polyhedral cell decomposition for VTK.
Definition: vtkTopo.H:52
const labelList & cellTypes() const
Definition: vtkTopo.H:125
void operator=(const vtkTopo &)=delete
Disallow default bitwise assignment.
vtkTopo(const polyMesh &mesh, const vtkPolyhedra &polyhedra)
Construct from components.
static const NamedEnum< vtkPolyhedra, 3 > vtkPolyhedraNames_
Names of groups of cell types retain as polyhedra.
Definition: vtkTopo.H:66
const labelList & addPointCellLabels() const
Definition: vtkTopo.H:130
vtkTypes
Equivalent to enumeration in "vtkCellType.h".
Definition: vtkTopo.H:70
@ VTK_TRIANGLE
Definition: vtkTopo.H:71
@ VTK_POLYHEDRON
Definition: vtkTopo.H:78
@ VTK_HEXAHEDRON
Definition: vtkTopo.H:75
const labelListList & vertLabels() const
Definition: vtkTopo.H:120
vtkPolyhedra
Groups of cell types retain as polyhedra.
Definition: vtkTopo.H:59
const labelList & superCells() const
Definition: vtkTopo.H:135
Namespace for OpenFOAM.