ensightPartFaces.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-2020 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::ensightPartFaces
26 
27 Description
28  An implementation of ensightPart to hold volume mesh faces.
29 
30 SourceFiles
31  ensightPartFaces.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef ensightPartFaces_H
36 #define ensightPartFaces_H
37 
38 #include "ensightPart.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class ensightPartFaces Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class ensightPartFaces
50 :
51  public ensightPart
52 {
53  // Private Member Functions
54 
55  //- Track points used
56  virtual localPoints calcLocalPoints() const;
57 
58  //- Element connectivity
59  virtual void writeConnectivity
60  (
62  const word& key,
63  const labelUList& idList,
64  const labelUList& pointMap
65  ) const;
66 
67 
68 protected:
69 
70  //- Addressable ensight element types
71  enum elemType
72  {
76  };
77 
78 
79  // Static Data Members
80 
81  static const List<word> elemTypes_;
82 
83 
84  // Protected data
85 
86  //- Faces referenced
87  const faceList& faces_;
88 
89  //- Can skip local point renumbering when points are contiguous
90  const bool contiguousPoints_;
91 
92 
93  // Protected Member Functions
94 
95  //- Classify the face shapes, set elemLists.
96  void classify(const faceList&);
97 
98  //- Helper: write connectivity
99  void writeConnectivity
100  (
102  const word& key,
103  const faceList&,
104  const labelUList& idList,
105  const labelUList& pointMap
106  ) const;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("ensightFaces");
113 
114  // Constructors
115 
116  //- Construct empty part with number and description
117  ensightPartFaces(label partNumber, const string& partDescription);
118 
119  //- Construct part with number, description, points and faces
120  // Can skip local point renumbering when points are contiguous
122  (
123  label partNumber,
124  const string& partDescription,
125  const pointField&,
126  const faceList&,
127  const bool contiguousPoints = false
128  );
129 
130  //- Construct from polyMesh and polyPatch
132  (
133  label partNumber,
134  const polyMesh&,
135  const polyPatch&
136  );
137 
138  //- Copy constructor
140 
141  //- Reconstruct part characteristics (eg, element types) from Istream
142  // A part reconstructed in this manner can be used when writing fields,
143  // but cannot be used to write a new geometry
144  // \sa Foam::ensightPart::reconstruct
146 
147  //- Reconstruct part characteristics on freestore from Istream
149  {
151  }
152 
153 
154  //- Destructor
155  virtual ~ensightPartFaces();
156 
157 
158  // Member Functions
159 
160  //- Write geometry
161  virtual void writeGeometry(ensightGeoFile&) const;
162 
163  //- Static listing of the element types
164  virtual const List<word>& elementTypes() const
165  {
166  return elemTypes_;
167  }
168 
169 
170  // Member Operators
171 
172  //- Disallow default bitwise assignment
173  void operator=(const ensightPartFaces&) = delete;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
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< ensightPartFaces > New(Istream &is)
Reconstruct part characteristics on freestore from Istream.
virtual ~ensightPartFaces()
Destructor.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Specialised Ensight output with extra geometry file header.
virtual void writeGeometry(ensightGeoFile &) const
Write geometry.
Track the points used by the part and map global to local indices.
Definition: ensightPart.H:105
static const List< word > elemTypes_
virtual const List< word > & elementTypes() const
Static listing of the element types.
const bool contiguousPoints_
Can skip local point renumbering when points are contiguous.
elemType
Addressable ensight element types.
A class for handling words, derived from string.
Definition: word.H:59
ensightPartFaces(label partNumber, const string &partDescription)
Construct empty part with number and description.
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
Base class for ensightPartCells and ensightPartFaces.
Definition: ensightPart.H:65
TypeName("ensightFaces")
Runtime type information.
An implementation of ensightPart to hold volume mesh faces.
void operator=(const ensightPartFaces &)=delete
Disallow default bitwise assignment.
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
void classify(const faceList &)
Classify the face shapes, set elemLists.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
const faceList & faces_
Faces referenced.
Namespace for OpenFOAM.