ensightPartCells.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-2019 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::ensightPartCells
26 
27 Description
28  An implementation of ensightPart to hold volume mesh cells.
29 
30 SourceFiles
31  ensightPartCells.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef ensightPartCells_H
36 #define ensightPartCells_H
37 
38 #include "ensightPart.H"
39 #include "typeInfo.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class ensightPartCells Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class ensightPartCells
51 :
52  public ensightPart
53 {
54  // Private Member Functions
55 
56  //- Classify the cell types, set elemLists.
57  void classify
58  (
59  const polyMesh&,
60  const labelUList& idLabels = labelUList::null()
61  );
62 
63  //- Track points used
64  virtual localPoints calcLocalPoints() const;
65 
66  //- Track the points used
67  // virtual void makeLocalPointMap();
68 
69  //- Element connectivity
70  virtual void writeConnectivity
71  (
73  const word& key,
74  const labelUList& idList,
75  const labelUList& pointMap
76  ) const;
77 
78 
79 protected:
80 
81  //- Addressable ensight element types
82  enum elemType
83  {
89  };
90 
91 
92  // Static Data Members
93 
94  static const polyMesh* const polyMeshNullPtr_;
95 
96  static const List<word> elemTypes_;
97 
98 
99  // Protected data
100 
101  //- Mesh referenced
102  const polyMesh& mesh_;
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("ensightCells");
109 
110  // Constructors
111 
112  //- Construct empty part with number and description
113  ensightPartCells(label partNumber, const string& partDescription);
114 
115  //- Construct from polyMesh without zones
116  ensightPartCells(label partNumber, const polyMesh&);
117 
118  //- Construct from polyMesh and list of (non-zoned) cells
120  (
121  label partNumber,
122  const polyMesh&,
123  const labelUList&
124  );
125 
126  //- Construct from polyMesh and cellZone
128  (
129  label partNumber,
130  const polyMesh&,
131  const cellZone&
132  );
133 
134  //- Copy constructor
136 
137  //- Reconstruct part characteristics (eg, element types) from Istream
138  // A part reconstructed in this manner can be used when writing fields,
139  // but cannot be used to write a new geometry
140  // \sa Foam::ensightPart::reconstruct
142 
143  //- Reconstruct part characteristics on freestore from Istream
145  {
147  }
148 
149 
150  //- Destructor
151  virtual ~ensightPartCells();
152 
153 
154  // Member Functions
155 
156  //- Write geometry
157  virtual void writeGeometry(ensightGeoFile&) const;
158 
159  //- Static listing of the element types
160  virtual const List<word>& elementTypes() const
161  {
162  return elemTypes_;
163  }
164 
165 
166  // Member Operators
167 
168  //- Disallow default bitwise assignment
169  void operator=(const ensightPartCells&) = delete;
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
static autoPtr< ensightPartCells > New(Istream &is)
Reconstruct part characteristics on freestore from Istream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Specialized Ensight output with extra geometry file header.
Track the points used by the part and map global to local indices.
Definition: ensightPart.H:105
An implementation of ensightPart to hold volume mesh cells.
TypeName("ensightCells")
Runtime type information.
void operator=(const ensightPartCells &)=delete
Disallow default bitwise assignment.
virtual const List< word > & elementTypes() const
Static listing of the element types.
A class for handling words, derived from string.
Definition: word.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
elemType
Addressable ensight element types.
Base class for ensightPartCells and ensightPartFaces.
Definition: ensightPart.H:65
static const UList< T > & null()
Return a null UList.
Definition: UListI.H:51
A subset of mesh cells.
Definition: cellZone.H:61
static const polyMesh *const polyMeshNullPtr_
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
virtual void writeGeometry(ensightGeoFile &) const
Write geometry.
static const List< word > elemTypes_
ensightPartCells(label partNumber, const string &partDescription)
Construct empty part with number and description.
virtual ~ensightPartCells()
Destructor.
const polyMesh & mesh_
Mesh referenced.
Namespace for OpenFOAM.