Loading...
Searching...
No Matches
ensightFaMesh.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) 2021-2024 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::ensightFaMesh
28
29Description
30 Encapsulation of area meshes for writing in ensight format.
31
32Note
33 Currently restricted to a single faMesh representation.
34 The face elements are created from a specified subset of polyMesh
35 faces. The original ordering of these faces is retained in the
36 ensightFaces faceOrder().
37
38SourceFiles
39 ensightFaMesh.C
40 ensightFaMeshI.H
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef Foam_fa_ensightMesh_H
45#define Foam_fa_ensightMesh_H
46
47#include "ensightFaces.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54// Forward Declarations
55class faMesh;
56class ensightGeoFile;
57class ensightFaMesh;
59/*---------------------------------------------------------------------------*\
60 Class ensightMesh Declaration
61\*---------------------------------------------------------------------------*/
62
63class ensightFaMesh
64{
65 // Private Data
66
67 //- Reference to the finite-area mesh
68 const faMesh& mesh_;
69
70 //- Face elements for the area mesh (currently only one)
71 ensightFaces areaPart_;
72
73 //- Track if it needs an update
74 mutable bool needsUpdate_;
75
76 //- Output verbosity level
77 int verbose_;
78
79
80 // Private Member Functions
81
82 //- Clear all storage
83 void clear();
84
85 //- Enforce consistent index/part numbering
86 void renumber();
87
88
89public:
90
91 // Generated Methods
92
93 //- No copy construct
94 ensightFaMesh(const ensightFaMesh&) = delete;
95
96 //- No copy assignment
97 void operator=(const ensightFaMesh&) = delete;
98
99
100 // Constructors
101
102 //- Construct from mesh with all default options
103 explicit ensightFaMesh(const faMesh& mesh);
104
105
106 // Member Functions
107
108 //- Output verbosity level
109 int verbose() const noexcept;
110
111 //- Change the output verbosity level.
112 // \return old level
113 int verbose(const int level) noexcept;
114
115
116 // Access
117
118 //- Reference to the underlying faMesh
119 const faMesh& mesh() const noexcept
120 {
121 return mesh_;
122 }
123
124 //- Face elements for finite-area
125 const ensightFaces& areaPart() const noexcept
126 {
127 return areaPart_;
128 }
129
130
131 // Other
132
133 //- Does the content need an update?
134 bool needsUpdate() const noexcept
135 {
136 return needsUpdate_;
137 }
138
139 //- Mark as needing an update.
140 // May also free up unneeded data.
141 // Return false if already marked as expired.
142 inline bool expire();
143
144 //- Update for new mesh
145 void correct();
146
148 // Output
149
150 //- Write geometry to file (normally in parallel).
151 //- Adds beginGeometry() marker.
152 void write
153 (
155 bool parallel = UPstream::parRun()
156 ) const;
157
158 //- Write geometry to file (normally in parallel).
159 //- Adds beginGeometry() marker.
160 FOAM_DEPRECATED_FOR(2024-05, "write(ensightGeoFile&, ...")
161 inline void write
162 (
164 bool parallel = UPstream::parRun()
165 ) const;
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#include "ensightFaMeshI.H"
176
177#endif
178
179// ************************************************************************* //
writer write("magLe", fld)
Inter-processor communications stream.
Definition UPstream.H:69
static bool parRun(const bool on) noexcept
Set as parallel run on/off.
Definition UPstream.H:1669
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
Encapsulation of area meshes for writing in ensight format.
const ensightFaces & areaPart() const noexcept
Face elements for finite-area.
bool needsUpdate() const noexcept
Does the content need an update?
void write(ensightGeoFile &os, bool parallel=UPstream::parRun()) const
Write geometry to file (normally in parallel). Adds beginGeometry() marker.
const faMesh & mesh() const noexcept
Reference to the underlying faMesh.
void correct()
Update for new mesh.
int verbose() const noexcept
Output verbosity level.
void operator=(const ensightFaMesh &)=delete
No copy assignment.
bool expire()
Mark as needing an update.
ensightFaMesh(const ensightFaMesh &)=delete
No copy construct.
Sorting/classification of faces (2D) into corresponding ensight types.
A variant of ensightFile (Ensight writing) that includes the extra geometry file header information.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
OBJstream os(runTime.globalPath()/outputName)
surface1 clear()
Namespace for OpenFOAM.
const direction noexcept
Definition scalarImpl.H:265
runTime write()
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition stdFoam.H:43