1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | 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/>.
25 Foam::meshWriters::STARCD
28 Writes polyMesh in pro-STAR (v4) bnd/cel/vrt format
30 Alternatively, extracts the surface of the FOAM mesh into
31 pro-STAR (v4) .cel/.vrt/ format.
32 This can be useful, for example, for surface morphing in an external
35 The cellTableId and cellTable information are used (if available).
36 Otherwise the cellZones are used (if available).
41 \*---------------------------------------------------------------------------*/
43 #ifndef STARCDMeshWriter_H
44 #define STARCDMeshWriter_H
46 #include "meshWriter.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 /*---------------------------------------------------------------------------*\
58 Class meshWriters::STARCD Declaration
59 \*---------------------------------------------------------------------------*/
67 static const char* defaultBoundaryName;
70 // Private Member Functions
72 //- Disallow default bitwise copy construct
73 STARCD(const STARCD&);
75 //- Disallow default bitwise assignment
76 void operator=(const STARCD&);
78 //- Pro-STAR 4+ header format
79 static void writeHeader(Ostream&, const char* filetype);
82 void writePoints(const fileName& baseName) const;
85 void writeCells(const fileName& baseName) const;
88 void writeBoundary(const fileName& baseName) const;
92 label findDefaultBoundary() const;
97 // Static data members
99 //- Face addressing from foam faces -> pro-STAR faces
100 static const label foamToStarFaceAddr[4][6];
105 //- Open a file for writing
109 const scalar scaleFactor = 1.0
121 //- Remove STAR-CD files for the baseName
122 void rmFiles(const fileName& baseName) const;
127 //- Write volume mesh
130 const fileName& meshName = fileName::null
133 //- Write surface mesh with optional triangulation
134 virtual bool writeSurface
136 const fileName& meshName = fileName::null,
137 const bool& triangulate = false
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 } // End namespace meshWriters
145 } // End namespace Foam
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 // ************************************************************************* //