1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 \*---------------------------------------------------------------------------*/
40 #include "HashTable.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 /*---------------------------------------------------------------------------*\
55 Class ensightMesh Declaration
56 \*---------------------------------------------------------------------------*/
83 //- Reference to the OpenFOAM mesh
86 //- Set binary file output
89 //- The ensight part id for the first patch
90 label patchPartOffset_;
92 cellSets meshCellSets_;
94 List<faceSets> boundaryFaceSets_;
96 wordList allPatchNames_;
98 List<labelList> allPatchProcs_;
100 wordHashSet patchNames_;
102 HashTable<nFacePrimitives> nPatchPrims_;
105 // Private Member Functions
107 //- Disallow default bitwise copy construct
108 ensightMesh(const ensightMesh&);
110 //- Disallow default bitwise assignment
111 void operator=(const ensightMesh&);
115 const scalarField& pointsComponent,
116 OFstream& ensightGeometryFile
121 const cellShapeList& cellShapes,
122 const labelList& prims
127 const cellShapeList& cellShapes,
128 const labelList& hexes,
129 const labelList& wedges
134 const cellShapeList& cellShapes,
135 const label pointOffset,
136 OFstream& ensightGeometryFile
139 void writePolysNFaces
141 const labelList& polys,
142 const cellList& cellFaces,
143 OFstream& ensightGeometryFile
146 void writePolysNPointsPerFace
148 const labelList& polys,
149 const cellList& cellFaces,
150 const faceList& faces,
151 OFstream& ensightGeometryFile
154 void writePolysPoints
156 const labelList& polys,
157 const cellList& cellFaces,
158 const faceList& faces,
159 const label pointOffset,
160 OFstream& ensightGeometryFile
165 const labelList& pointOffsets,
166 OFstream& ensightGeometryFile
173 const cellShapeList& cellShapes,
174 const labelList& pointOffsets,
175 OFstream& ensightGeometryFile
180 const faceList& patchFaces,
181 const label pointOffset,
182 OFstream& ensightGeometryFile
187 const faceList& patchFaces,
188 const labelList& prims
191 void writeAllFacePrims
194 const labelList& prims,
196 const faceList& patchFaces,
197 const labelList& pointOffsets,
198 const labelList& patchProcessors,
199 OFstream& ensightGeometryFile
202 void writeNSidedNPointsPerFace
204 const faceList& patchFaces,
205 OFstream& ensightGeometryFile
208 void writeNSidedPoints
210 const faceList& patchFaces,
211 const label pointOffset,
212 OFstream& ensightGeometryFile
217 const labelList& prims,
219 const faceList& patchFaces,
220 const labelList& pointOffsets,
221 const labelList& patchProcessors,
222 OFstream& ensightGeometryFile
227 const fileName& postProcPath,
229 const label timeIndex,
230 Ostream& ensightCaseFile
235 const fileName& postProcPath,
237 const label timeIndex,
238 Ostream& ensightCaseFile
241 void writePrimsBinary
243 const cellShapeList& cellShapes,
244 const label pointOffset,
245 std::ofstream& ensightGeometryFile
248 void writeAllPrimsBinary
252 const cellShapeList& cellShapes,
253 const labelList& pointOffsets,
254 std::ofstream& ensightGeometryFile
257 void writePolysNFacesBinary
259 const labelList& polys,
260 const cellList& cellFaces,
261 std::ofstream& ensightGeometryFile
264 void writePolysNPointsPerFaceBinary
266 const labelList& polys,
267 const cellList& cellFaces,
268 const faceList& faces,
269 std::ofstream& ensightGeometryFile
272 void writePolysPointsBinary
274 const labelList& polys,
275 const cellList& cellFaces,
276 const faceList& faces,
277 const label pointOffset,
278 std::ofstream& ensightGeometryFile
281 void writeAllPolysBinary
283 const labelList& pointOffsets,
284 std::ofstream& ensightGeometryFile
287 void writeAllFacePrimsBinary
290 const labelList& prims,
292 const faceList& patchFaces,
293 const labelList& pointOffsets,
294 const labelList& patchProcessors,
295 std::ofstream& ensightGeometryFile
298 void writeFacePrimsBinary
300 const faceList& patchFaces,
301 const label pointOffset,
302 std::ofstream& ensightGeometryFile
305 void writeNSidedPointsBinary
307 const faceList& patchFaces,
308 const label pointOffset,
309 std::ofstream& ensightGeometryFile
312 void writeNSidedNPointsPerFaceBinary
314 const faceList& patchFaces,
315 std::ofstream& ensightGeometryFile
318 void writeAllNSidedBinary
320 const labelList& prims,
322 const faceList& patchFaces,
323 const labelList& pointOffsets,
324 const labelList& patchProcessors,
325 std::ofstream& ensightGeometryFile
332 //- Construct from fvMesh
333 ensightMesh(const fvMesh&, const argList& args, const bool binary);
344 const fvMesh& mesh() const
349 const cellSets& meshCellSets() const
351 return meshCellSets_;
354 const List<faceSets>& boundaryFaceSets() const
356 return boundaryFaceSets_;
359 const wordList& allPatchNames() const
361 return allPatchNames_;
364 const List<labelList>& allPatchProcs() const
366 return allPatchProcs_;
369 const wordHashSet& patchNames() const
374 const HashTable<nFacePrimitives>& nPatchPrims() const
379 //- The ensight part id for the first patch
380 label patchPartOffset() const
382 return patchPartOffset_;
390 const fileName& postProcPath,
392 const label timeIndex,
393 Ostream& ensightCaseFile
398 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
400 } // End namespace Foam
402 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
406 // ************************************************************************* //