FIREMeshWriter.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) 2016 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::fileFormats::FIREMeshWriter
28
29Description
30 Writes polyMesh in AVL/FIRE polyhedra format (fpma, fpmb)
31
32 It is also possible to write compressed formats (fpmaz, fpmbz)
33
34Note
35 The fpma, fpmb formats are relatively poorly documented, but are manageable
36 to read and write. It is, however, not recommended to import them directly
37 into AVL/FIRE (the GUI) since it is generally not robust enough.
38 Instead use their file-convertor to reconvert them into their native format.
39
40 In the AVL/FIRE polyhedra format, the faces normals point inwards, whereas
41 the OpenFOAM face normals always point outwards.
42
43SourceFiles
44 FIREMeshWriter.C
45
46\*---------------------------------------------------------------------------*/
47
48#ifndef FIREMeshWriter_H
49#define FIREMeshWriter_H
50
51#include "meshWriter.H"
52#include "FIRECore.H"
53#include "IOstream.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60namespace fileFormats
61{
62
63/*---------------------------------------------------------------------------*\
64 Class fileFormats::FIREMeshWriter Declaration
65\*---------------------------------------------------------------------------*/
68:
69 public meshWriter,
70 public FIRECore
71{
72 // Private Member Functions
73
74 //- No copy construct
75 FIREMeshWriter(const FIREMeshWriter&) = delete;
76
77 //- No copy assignment
78 void operator=(const FIREMeshWriter&) = delete;
79
80 //- Write points, faces, cells
81 bool writeGeometry(OSstream&) const;
82
83 //- Write selections
84 bool writeSelections(OSstream&) const;
85
86public:
87
88 // Static data members
89
90 //- Write binary (default ascii)
91 static bool binary;
92
93 //- Write with compression (default false)
94 static bool compress;
95
96 //- Prefix patches with 'BND_' before writing (default true)
97 static bool prefixBoundary;
98
99
100 // Constructors
101
102 //- Prepare for writing, optionally with scaling.
103 // Treats a zero or negative scale factor as unity scaling.
104 FIREMeshWriter(const polyMesh&, const scalar scaleFactor = 1.0);
105
106
107 //- Destructor
108 virtual ~FIREMeshWriter() = default;
109
110
111 // Member Functions
112
113 // Write
114
115 //- Write volume mesh
116 virtual bool write
117 (
118 const fileName& meshName = fileName::null
119 ) const;
120
121};
122
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126} // End namespace fileFormats
127} // End namespace Foam
128
129// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130
131#endif
132
133// ************************************************************************* //
writer writeGeometry()
Generic output stream using a standard (STL) stream.
Definition: OSstream.H:57
Core routines used when reading/writing AVL/FIRE files.
Definition: FIRECore.H:61
Writes polyMesh in AVL/FIRE polyhedra format (fpma, fpmb)
static bool binary
Write binary (default ascii)
virtual ~FIREMeshWriter()=default
Destructor.
static bool compress
Write with compression (default false)
static bool prefixBoundary
Prefix patches with 'BND_' before writing (default true)
A class for handling file names.
Definition: fileName.H:76
Write OpenFOAM meshes and/or results to another CFD format.
Definition: meshWriter.H:83
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Namespace for OpenFOAM.
runTime write()