meshWriter.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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::meshWriter
29
30Description
31 Write OpenFOAM meshes and/or results to another CFD format.
32
33\par Files
34
35 "constant/boundaryRegion" is an IOMap<dictionary> that contains
36 the boundary type and names. eg,
37 \verbatim
38 (
39 0
40 {
41 BoundaryType wall;
42 Label Default_Boundary_Region;
43 }
44
45 1
46 {
47 BoundaryType inlet;
48 Label inlet_1;
49 }
50
51 ...
52
53 4
54 {
55 BoundaryType pressure;
56 Label outlet;
57 }
58 )
59 \endverbatim
60
61
62SourceFiles
63 meshWriter.C
64
65\*---------------------------------------------------------------------------*/
66
67#ifndef meshWriter_H
68#define meshWriter_H
69
70#include "polyMesh.H"
71#include "boundaryRegion.H"
72#include "cellTable.H"
73
74// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75
76namespace Foam
77{
78
79/*---------------------------------------------------------------------------*\
80 Class meshWriter Declaration
81\*---------------------------------------------------------------------------*/
83class meshWriter
84{
85 // Private Member Functions
86
87 //- No copy construct
88 meshWriter(const meshWriter&) = delete;
89
90 //- No copy assignment
91 void operator=(const meshWriter&) = delete;
92
93
94protected:
95
96 // Protected data
97
98 //- Mesh reference
99 const polyMesh& mesh_;
100
101 //- Scaling factor for points (eg, [m] -> [mm])
102 scalar scaleFactor_;
103
104 //- boundaryRegion persistent data saved as a dictionary
106
107 //- cellTable persistent data saved as a dictionary
109
110 //- cellTable IDs for each cell
112
113public:
114
115 // Static data members
116
117 //- Specify a default mesh name
118 static string defaultMeshName;
119
120
121 // Constructors
122
123 //- Create a writer object with given output scaling.
124 // Treats a zero or negative scale factor as unity scaling.
126 (
127 const polyMesh&,
128 const scalar scaling = 1.0
129 );
130
131
132 //- Destructor
133 virtual ~meshWriter();
134
135
136 // Member Functions
137
138 // Write
139
140 //- Write volume mesh. Subclass must supply this method
141 virtual bool write
142 (
144 ) const = 0;
145
146};
147
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151} // End namespace Foam
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155#endif
156
157// ************************************************************************* //
The boundaryRegion persistent data saved as a Map<dictionary>.
The cellTable persistent data saved as a Map<dictionary>.
Definition: cellTable.H:83
A class for handling file names.
Definition: fileName.H:76
Write OpenFOAM meshes and/or results to another CFD format.
Definition: meshWriter.H:83
scalar scaleFactor_
Scaling factor for points (eg, [m] -> [mm])
Definition: meshWriter.H:101
boundaryRegion boundaryRegion_
boundaryRegion persistent data saved as a dictionary
Definition: meshWriter.H:104
cellTable cellTable_
cellTable persistent data saved as a dictionary
Definition: meshWriter.H:107
labelList cellTableId_
cellTable IDs for each cell
Definition: meshWriter.H:110
static string defaultMeshName
Specify a default mesh name.
Definition: meshWriter.H:117
virtual bool write(const fileName &timeName=fileName::null) const =0
Write volume mesh. Subclass must supply this method.
virtual ~meshWriter()
Destructor.
Definition: meshWriter.C:60
const polyMesh & mesh_
Mesh reference.
Definition: meshWriter.H:98
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
word timeName
Definition: getTimeIndex.H:3
Namespace for OpenFOAM.
runTime write()