1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
32 \*---------------------------------------------------------------------------*/
39 #include "HashTable.H"
41 #include "PackedBoolList.H"
42 #include "wordReList.H"
43 #include "scalarField.H"
44 #include "cellShapeList.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 /*---------------------------------------------------------------------------*\
60 Class ensightMesh Declaration
61 \*---------------------------------------------------------------------------*/
86 //- Reference to the OpenFOAM mesh
90 const bool noPatches_;
92 //- Output selected patches only
94 const wordReList patchPatterns_;
96 //- Output selected faceZones
97 const bool faceZones_;
98 const wordReList faceZonePatterns_;
100 //- Set binary file output
103 //- The ensight part id for the first patch
104 label patchPartOffset_;
106 cellSets meshCellSets_;
108 List<faceSets> boundaryFaceSets_;
110 wordList allPatchNames_;
112 wordHashSet patchNames_;
114 HashTable<nFacePrimitives> nPatchPrims_;
116 // faceZone - related variables
117 List<faceSets> faceZoneFaceSets_;
119 wordHashSet faceZoneNames_;
121 HashTable<nFacePrimitives> nFaceZonePrims_;
123 //- Per boundary face whether to include or not
124 PackedBoolList boundaryFaceToBeIncluded_;
127 // Parallel merged points
129 //- Global numbering for merged points
130 autoPtr<globalIndex> globalPointsPtr_;
132 //- From mesh point to global merged point
133 labelList pointToGlobal_;
135 //- Local points that are unique
136 labelList uniquePointMap_;
140 // Private Member Functions
142 //- Disallow default bitwise copy construct
143 ensightMesh(const ensightMesh&);
145 //- Disallow default bitwise assignment
146 void operator=(const ensightMesh&);
150 const scalarField& pointsComponent,
151 ensightStream& ensightGeometryFile
156 const cellShapeList& cellShapes,
157 const labelList& prims,
158 const labelList& pointToGlobal
163 const cellShapeList& cellShapes,
164 const labelList& hexes,
165 const labelList& wedges,
166 const labelList& pointToGlobal
171 const cellShapeList& cellShapes,
172 ensightStream& ensightGeometryFile
175 void writePolysNFaces
177 const labelList& polys,
178 const cellList& cellFaces,
179 ensightStream& ensightGeometryFile
182 void writePolysNPointsPerFace
184 const labelList& polys,
185 const cellList& cellFaces,
186 const faceList& faces,
187 ensightStream& ensightGeometryFile
190 void writePolysPoints
192 const labelList& polys,
193 const cellList& cellFaces,
194 const faceList& faces,
195 ensightStream& ensightGeometryFile
200 const labelList& pointToGlobal,
201 ensightStream& ensightGeometryFile
208 const cellShapeList& cellShapes,
209 ensightStream& ensightGeometryFile
214 const faceList& patchFaces,
215 ensightStream& ensightGeometryFile
218 void writeAllFacePrims
221 const labelList& prims,
223 const faceList& patchFaces,
224 ensightStream& ensightGeometryFile
227 void writeNSidedNPointsPerFace
229 const faceList& patchFaces,
230 ensightStream& ensightGeometryFile
233 void writeNSidedPoints
235 const faceList& patchFaces,
236 ensightStream& ensightGeometryFile
241 const labelList& prims,
243 const faceList& patchFaces,
244 ensightStream& ensightGeometryFile
247 void writeAllInternalPoints
249 const pointField& uniquePoints,
251 ensightStream& ensightGeometryFile
254 void writeAllPatchPoints
257 const word& patchName,
258 const pointField& uniquePoints,
260 ensightStream& ensightGeometryFile
267 //- Construct from fvMesh
271 const bool noPatches,
273 const wordReList& patchPatterns,
274 const bool faceZones,
275 const wordReList& faceZonePatterns,
288 const fvMesh& mesh() const
293 const cellSets& meshCellSets() const
295 return meshCellSets_;
298 const List<faceSets>& boundaryFaceSets() const
300 return boundaryFaceSets_;
303 const wordList& allPatchNames() const
305 return allPatchNames_;
308 const wordHashSet& patchNames() const
313 const HashTable<nFacePrimitives>& nPatchPrims() const
318 const List<faceSets>& faceZoneFaceSets() const
320 return faceZoneFaceSets_;
323 const wordHashSet& faceZoneNames() const
325 return faceZoneNames_;
328 const HashTable<nFacePrimitives>& nFaceZonePrims() const
330 return nFaceZonePrims_;
333 //- The ensight part id for the first patch
334 label patchPartOffset() const
336 return patchPartOffset_;
340 // Parallel point merging
342 //- Global numbering for merged points
343 const globalIndex& globalPoints() const
345 return globalPointsPtr_();
348 //- From mesh point to global merged point
349 const labelList& pointToGlobal() const
351 return pointToGlobal_;
354 //- Local points that are unique
355 const labelList& uniquePointMap() const
357 return uniquePointMap_;
365 //- Update for new mesh
368 //- When exporting faceZones, check if a given face has to be included
369 // or not (i.e. faces on processor boundaries)
370 bool faceToBeIncluded(const label faceI) const;
372 //- Helper to cause barrier. Necessary on Quadrics.
373 static void barrier();
380 const fileName& postProcPath,
382 const label timeIndex,
383 Ostream& ensightCaseFile
389 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
391 } // End namespace Foam
393 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
397 // ************************************************************************* //