1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
32 \*---------------------------------------------------------------------------*/
39 #include "HashTable.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class ensightMesh Declaration
55 \*---------------------------------------------------------------------------*/
82 //- Reference to the FOAM mesh
85 //- Set binary file output
88 //- The ensight part id for the first patch
89 label patchPartOffset_;
91 cellSets meshCellSets_;
93 List<faceSets> boundaryFaceSets_;
95 wordList allPatchNames_;
97 List<labelList> allPatchProcs_;
99 wordHashSet patchNames_;
101 HashTable<nFacePrimitives> nPatchPrims_;
104 // Private Member Functions
106 //- Disallow default bitwise copy construct
107 ensightMesh(const ensightMesh&);
109 //- Disallow default bitwise assignment
110 void operator=(const ensightMesh&);
114 const scalarField& pointsComponent,
115 OFstream& ensightGeometryFile
120 const cellShapeList& cellShapes,
121 const labelList& prims
126 const cellShapeList& cellShapes,
127 const labelList& hexes,
128 const labelList& wedges
133 const cellShapeList& cellShapes,
134 const label pointOffset,
135 OFstream& ensightGeometryFile
138 void writePolysNFaces
140 const labelList& polys,
141 const cellList& cellFaces,
142 OFstream& ensightGeometryFile
145 void writePolysNPointsPerFace
147 const labelList& polys,
148 const cellList& cellFaces,
149 const faceList& faces,
150 OFstream& ensightGeometryFile
153 void writePolysPoints
155 const labelList& polys,
156 const cellList& cellFaces,
157 const faceList& faces,
158 const label pointOffset,
159 OFstream& ensightGeometryFile
164 const labelList& pointOffsets,
165 OFstream& ensightGeometryFile
172 const cellShapeList& cellShapes,
173 const labelList& pointOffsets,
174 OFstream& ensightGeometryFile
179 const faceList& patchFaces,
180 const label pointOffset,
181 OFstream& ensightGeometryFile
186 const faceList& patchFaces,
187 const labelList& prims
190 void writeAllFacePrims
193 const labelList& prims,
195 const faceList& patchFaces,
196 const labelList& pointOffsets,
197 const labelList& patchProcessors,
198 OFstream& ensightGeometryFile
201 void writeNSidedNPointsPerFace
203 const faceList& patchFaces,
204 OFstream& ensightGeometryFile
207 void writeNSidedPoints
209 const faceList& patchFaces,
210 const label pointOffset,
211 OFstream& ensightGeometryFile
216 const labelList& prims,
218 const faceList& patchFaces,
219 const labelList& pointOffsets,
220 const labelList& patchProcessors,
221 OFstream& ensightGeometryFile
226 const fileName& postProcPath,
228 const label timeIndex,
229 Ostream& ensightCaseFile
234 const fileName& postProcPath,
236 const label timeIndex,
237 Ostream& ensightCaseFile
240 void writePrimsBinary
242 const cellShapeList& cellShapes,
243 const label pointOffset,
244 std::ofstream& ensightGeometryFile
247 void writeAllPrimsBinary
251 const cellShapeList& cellShapes,
252 const labelList& pointOffsets,
253 std::ofstream& ensightGeometryFile
256 void writePolysNFacesBinary
258 const labelList& polys,
259 const cellList& cellFaces,
260 std::ofstream& ensightGeometryFile
263 void writePolysNPointsPerFaceBinary
265 const labelList& polys,
266 const cellList& cellFaces,
267 const faceList& faces,
268 std::ofstream& ensightGeometryFile
271 void writePolysPointsBinary
273 const labelList& polys,
274 const cellList& cellFaces,
275 const faceList& faces,
276 const label pointOffset,
277 std::ofstream& ensightGeometryFile
280 void writeAllPolysBinary
282 const labelList& pointOffsets,
283 std::ofstream& ensightGeometryFile
286 void writeAllFacePrimsBinary
289 const labelList& prims,
291 const faceList& patchFaces,
292 const labelList& pointOffsets,
293 const labelList& patchProcessors,
294 std::ofstream& ensightGeometryFile
297 void writeFacePrimsBinary
299 const faceList& patchFaces,
300 const label pointOffset,
301 std::ofstream& ensightGeometryFile
304 void writeNSidedPointsBinary
306 const faceList& patchFaces,
307 const label pointOffset,
308 std::ofstream& ensightGeometryFile
311 void writeNSidedNPointsPerFaceBinary
313 const faceList& patchFaces,
314 std::ofstream& ensightGeometryFile
317 void writeAllNSidedBinary
319 const labelList& prims,
321 const faceList& patchFaces,
322 const labelList& pointOffsets,
323 const labelList& patchProcessors,
324 std::ofstream& ensightGeometryFile
331 //- Construct from fvMesh
332 ensightMesh(const fvMesh&, const argList& args, const bool binary);
343 const fvMesh& mesh() const
348 const cellSets& meshCellSets() const
350 return meshCellSets_;
353 const List<faceSets>& boundaryFaceSets() const
355 return boundaryFaceSets_;
358 const wordList& allPatchNames() const
360 return allPatchNames_;
363 const List<labelList>& allPatchProcs() const
365 return allPatchProcs_;
368 const wordHashSet& patchNames() const
373 const HashTable<nFacePrimitives>& nPatchPrims() const
378 //- The ensight part id for the first patch
379 label patchPartOffset() const
381 return patchPartOffset_;
389 const fileName& postProcPath,
391 const label timeIndex,
392 Ostream& ensightCaseFile
397 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
399 } // End namespace Foam
401 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
405 // ************************************************************************* //