ensightPartFaces.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 | Copyright (C) 2011-2015 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  //- Disallow default bitwise assignment
56  void operator=(const ensightPartFaces&);
57 
58  //- Track points used
59  virtual localPoints calcLocalPoints() const;
60 
61  //- Element connectivity
62  virtual void writeConnectivity
63  (
65  const word& key,
66  const labelUList& idList,
67  const labelUList& pointMap
68  ) const;
69 
70 
71 protected:
72 
73  //- Addressable ensight element types
74  enum elemType
75  {
79  };
80 
81 
82  // Static data members
83 
84  static const List<word> elemTypes_;
85 
86 
87  // Protected data
88 
89  //- Faces referenced
90  const faceList& faces_;
91 
92  //- Can skip local point renumbering when points are contiguous
93  const bool contiguousPoints_;
94 
95 
96  // Protected Member Functions
97 
98  //- Classify the face shapes, set elemLists.
99  void classify(const faceList&);
100 
101  //- Helper: write connectivity
102  void writeConnectivity
103  (
105  const word& key,
106  const faceList&,
107  const labelUList& idList,
108  const labelUList& pointMap
109  ) const;
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("ensightFaces");
116 
117  // Constructors
118 
119  //- Construct empty part with number and description
120  ensightPartFaces(label partNumber, const string& partDescription);
121 
122  //- Construct part with number, description, points and faces
123  // Can skip local point renumbering when points are contiguous
125  (
126  label partNumber,
127  const string& partDescription,
128  const pointField&,
129  const faceList&,
130  const bool contiguousPoints = false
131  );
132 
133  //- Construct from polyMesh and polyPatch
135  (
136  label partNumber,
137  const polyMesh&,
138  const polyPatch&
139  );
140 
141  //- Construct as copy
143 
144  //- Reconstruct part characteristics (eg, element types) from Istream
145  // A part reconstructed in this manner can be used when writing fields,
146  // but cannot be used to write a new geometry
147  // \sa Foam::ensightPart::reconstruct
149 
150  //- Reconstruct part characteristics on freestore from Istream
152  {
154  }
155 
156 
157  //- Destructor
158  virtual ~ensightPartFaces();
159 
160 
161  // Member Functions
162 
163  //- Write geometry
164  virtual void writeGeometry(ensightGeoFile&) const;
165 
166  //- Static listing of the element types
167  virtual const List<word>& elementTypes() const
168  {
169  return elemTypes_;
170  }
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
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.
virtual void writeGeometry(ensightGeoFile &) const
Write geometry.
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
static const List< word > elemTypes_
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.
virtual const List< word > & elementTypes() const
Static listing of the element types.
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.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
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.