STARCDMeshWriter.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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  //- Pro-STAR 4+ header format
68  static void writeHeader(Ostream&, const char* filetype);
69 
70  //- Write points
71  void writePoints(const fileName& baseName) const;
72 
73  //- Write cells
74  void writeCells(const fileName& baseName) const;
75 
76  //- Write boundary
77  void writeBoundary(const fileName& baseName) const;
78 
79  void getCellTable();
80 
81  label findDefaultBoundary() const;
82 
83 
84 public:
85 
86  // Static Data Members
87 
88  //- Face addressing from OpenFOAM faces -> pro-STAR faces
89  static const label foamToStarFaceAddr[4][6];
90 
91 
92  // Constructors
93 
94  //- Open a file for writing
95  STARCD
96  (
97  const polyMesh&,
98  const scalar scaleFactor = 1.0
99  );
100 
101  //- Disallow default bitwise copy construction
102  STARCD(const STARCD&) = delete;
103 
104 
105  //- Destructor
106  virtual ~STARCD();
107 
108 
109  // Member Functions
110 
111  // Edit
112 
113  //- Remove STAR-CD files for the baseName
114  void rmFiles(const fileName& baseName) const;
115 
116 
117  // Write
118 
119  //- Write volume mesh
120  virtual bool write
121  (
123  ) const;
124 
125 
126  // Member Operators
127 
128  //- Disallow default bitwise assignment
129  void operator=(const STARCD&) = delete;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace meshWriters
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
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:79
virtual bool write(const fileName &meshName=fileName::null) const
Write volume mesh.
static const fileName null
An empty fileName.
Definition: fileName.H:97
STARCD(const polyMesh &, const scalar scaleFactor=1.0)
Open a file for writing.
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:150
void operator=(const STARCD &)=delete
Disallow default bitwise assignment.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void rmFiles(const fileName &baseName) const
Remove STAR-CD files for the baseName.
virtual ~STARCD()
Destructor.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.