STARCDMeshWriter.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 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::meshWriters::STARCD
26 
27 Description
28  Writes polyMesh in pro-STAR (v4) bnd/cel/vrt format
29 
30  The cellTableId and cellTable information are used (if available).
31  Otherwise the cellZones are used (if available).
32 
33 SourceFiles
34  STARCDMeshWriter.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef STARCDMeshWriter_H
39 #define STARCDMeshWriter_H
40 
41 #include "meshWriter.H"
42 #include "IOstream.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 namespace meshWriters
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class meshWriters::STARCD Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class STARCD
57 :
58  public meshWriter
59 {
60  // Private Data
61 
62  static const char* defaultBoundaryName;
63 
64 
65  // Private Member Functions
66 
67  //- Disallow default bitwise copy construct
68  STARCD(const STARCD&);
69 
70  //- Disallow default bitwise assignment
71  void operator=(const STARCD&);
72 
73  //- Pro-STAR 4+ header format
74  static void writeHeader(Ostream&, const char* filetype);
75 
76  //- Write points
77  void writePoints(const fileName& baseName) const;
78 
79  //- Write cells
80  void writeCells(const fileName& baseName) const;
81 
82  //- Write boundary
83  void writeBoundary(const fileName& baseName) const;
84 
85  void getCellTable();
86 
87  label findDefaultBoundary() const;
88 
89 
90 public:
91 
92  // Static data members
93 
94  //- Face addressing from OpenFOAM faces -> pro-STAR faces
95  static const label foamToStarFaceAddr[4][6];
96 
97 
98  // Constructors
99 
100  //- Open a file for writing
101  STARCD
102  (
103  const polyMesh&,
104  const scalar scaleFactor = 1.0
105  );
106 
107 
108  //- Destructor
109  virtual ~STARCD();
110 
111 
112  // Member Functions
113 
114  // Edit
115 
116  //- Remove STAR-CD files for the baseName
117  void rmFiles(const fileName& baseName) const;
118 
119 
120  // Write
121 
122  //- Write volume mesh
123  virtual bool write
124  (
126  ) const;
127 
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace meshWriters
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
write OpenFOAM meshes and/or results to another CFD format
Definition: meshWriter.H:89
static const label foamToStarFaceAddr[4][6]
Face addressing from OpenFOAM faces -> pro-STAR faces.
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
A class for handling file names.
Definition: fileName.H:69
void rmFiles(const fileName &baseName) const
Remove STAR-CD files for the baseName.
static const fileName null
An empty fileName.
Definition: fileName.H:97
Writes polyMesh in pro-STAR (v4) bnd/cel/vrt format.
static char meshName[]
Definition: globalFoam.H:7
void scaleFactor(const scalar scaling)
Set points scaling.
Definition: meshWriter.H:156
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual ~STARCD()
Destructor.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.
virtual bool write(const fileName &meshName=fileName::null) const
Write volume mesh.