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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2016 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fileFormats::STARCDMeshWriter
29 
30 Description
31  Writes polyMesh in PROSTAR (v4) bnd/cel/vrt format
32 
33  The cellTableId and cellTable information are used (if available).
34  Otherwise the cellZones are used (if available).
35 
36 SourceFiles
37  STARCDMeshWriter.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef STARCDMeshWriter_H
42 #define STARCDMeshWriter_H
43 
44 #include "meshWriter.H"
45 #include "STARCDCore.H"
46 #include "IOstream.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 namespace fileFormats
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class fileFormats::STARCDMeshWriter Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class STARCDMeshWriter
61 :
62  public meshWriter,
63  protected STARCDCore
64 {
65  // Private data
66 
67  //- Write boundary (bnd) file - default true
68  bool writeBoundary_;
69 
70 
71  // Private Member Functions
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  //- No copy construct
85  STARCDMeshWriter(const STARCDMeshWriter&) = delete;
86 
87  //- No copy assignment
88  void operator=(const STARCDMeshWriter&) = delete;
89 
90 
91 public:
92 
93  // Constructors
94 
95  //- Write mesh files in PROSTAR format
97  (
98  const polyMesh&,
99  const scalar scaleFactor = 1.0,
100  const bool writeBndFile = true
101  );
102 
103 
104  //- Destructor
105  virtual ~STARCDMeshWriter() = default;
106 
107 
108  // Member Functions
109 
110  // Write
111 
112  //- Write volume mesh
113  virtual bool write
114  (
115  const fileName& meshName = fileName::null
116  ) const;
117 
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace fileFormats
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::fileFormats::STARCDMeshWriter::write
virtual bool write(const fileName &meshName=fileName::null) const
Write volume mesh.
Definition: STARCDMeshWriter.C:437
Foam::fileFormats::STARCDMeshWriter
Writes polyMesh in PROSTAR (v4) bnd/cel/vrt format.
Definition: STARCDMeshWriter.H:59
STARCDCore.H
Foam::fileFormats::STARCDMeshWriter::~STARCDMeshWriter
virtual ~STARCDMeshWriter()=default
Destructor.
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::fileFormats::STARCDCore
Core routines used when reading/writing PROSTAR vrt/cel/bnd files.
Definition: STARCDCore.H:59
IOstream.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileName::null
static const fileName null
An empty fileName.
Definition: fileName.H:101
meshWriter.H
Foam::meshWriter
Write OpenFOAM meshes and/or results to another CFD format.
Definition: meshWriter.H:82