faceZoneSet.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-2017 OpenFOAM Foundation
9 Copyright (C) 2018-2020 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::faceZoneSet
29
30Description
31 Like faceSet but -reads data from faceZone -updates faceZone when writing.
32
33SourceFiles
34 faceZone.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef faceZoneSet_H
39#define faceZoneSet_H
40
41#include "faceSet.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class faceZoneSet Declaration
50\*---------------------------------------------------------------------------*/
52class faceZoneSet
53:
54 public faceSet
55{
56 // Private Data
57
58 const polyMesh& mesh_;
59
60 labelList addressing_;
61
62 boolList flipMap_;
63
64
65public:
66
67 //- Runtime type information
68 TypeName("faceZoneSet");
69
70
71 // Constructors
72
73 //- Construct from objectRegistry and name
75 (
76 const polyMesh& mesh,
77 const word& name,
80 );
81
82 //- Construct with initial size for labelHashSet
84 (
85 const polyMesh& mesh,
86 const word& name,
87 const label size,
89 );
90
91 //- Copy construct from existing set
93 (
94 const polyMesh& mesh,
95 const word& name,
96 const topoSet& set,
98 );
99
100
101 //- Destructor
102 virtual ~faceZoneSet() = default;
103
104
105 // Member Functions
107 const labelList& addressing() const noexcept
108 {
109 return addressing_;
110 }
113 {
114 return addressing_;
115 }
116
118 const boolList& flipMap() const noexcept
119 {
120 return flipMap_;
121 }
124 {
125 return flipMap_;
126 }
127
128
129 //- Sort addressing and make faceSet part consistent with addressing
130 void updateSet();
131
132 //- Invert contents.
133 // Insert all members [0,maxLen) which were not in set.
134 virtual void invert(const label maxLen);
135
136 //- Subset contents. Only elements present in both sets remain.
137 virtual void subset(const topoSet& set);
138
139 //- Add elements present in set.
140 virtual void addSet(const topoSet& set);
141
142 //- Subtract elements present in set.
143 virtual void subtractSet(const topoSet& set);
144
145 //- Sync faceZoneSet across coupled patches.
146 virtual void sync(const polyMesh& mesh);
147
148 //- Write maxLen items with label and coordinates.
149 virtual void writeDebug
150 (
151 Ostream& os,
152 const primitiveMesh&,
153 const label maxLen
154 ) const;
155
156 //- Write faceZone using stream options
157 virtual bool writeObject
158 (
159 IOstreamOption streamOpt,
160 const bool valid
161 ) const;
162
163 //- Update any stored data for new labels
164 virtual void updateMesh(const mapPolyMesh& morphMap);
165
166 //- Return max index+1.
167 virtual label maxSize(const polyMesh& mesh) const;
168};
169
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173} // End namespace Foam
174
175// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177#endif
178
179// ************************************************************************* //
label size() const noexcept
The number of elements in table.
Definition: HashTableI.H:52
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
writeOption
Enumeration defining the write options.
Definition: IOobject.H:186
readOption
Enumeration defining the read options.
Definition: IOobject.H:177
The IOstreamOption is a simple container for options an IOstream can normally have.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of face labels.
Definition: faceSet.H:54
Like faceSet but -reads data from faceZone -updates faceZone when writing.
Definition: faceZoneSet.H:54
virtual void invert(const label maxLen)
Invert contents.
Definition: faceZoneSet.C:135
const boolList & flipMap() const noexcept
Definition: faceZoneSet.H:117
boolList & flipMap() noexcept
Definition: faceZoneSet.H:122
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
Definition: faceZoneSet.C:265
labelList & addressing() noexcept
Definition: faceZoneSet.H:111
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition: faceZoneSet.C:440
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write faceZone using stream options.
Definition: faceZoneSet.C:447
virtual void sync(const polyMesh &mesh)
Sync faceZoneSet across coupled patches.
Definition: faceZoneSet.C:317
const labelList & addressing() const noexcept
Definition: faceZoneSet.H:106
virtual void addSet(const topoSet &set)
Add elements present in set.
Definition: faceZoneSet.C:214
virtual ~faceZoneSet()=default
Destructor.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition: faceZoneSet.C:519
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition: faceZoneSet.C:490
TypeName("faceZoneSet")
Runtime type information.
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
Definition: faceZoneSet.C:166
void updateSet()
Sort addressing and make faceSet part consistent with addressing.
Definition: faceZoneSet.C:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:79
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:67
virtual bool set(const label id)
Set an index.
Definition: topoSet.C:514
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73