Loading...
Searching...
No Matches
cellZoneSet.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-2024 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::cellZoneSet
29
30Description
31 Like cellSet but -reads data from cellZone -updates cellZone when writing.
32
33SourceFiles
34 cellZoneSet.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_cellZoneSet_H
39#define Foam_cellZoneSet_H
40
41#include "cellSet.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
48/*---------------------------------------------------------------------------*\
49 Class cellZoneSet Declaration
50\*---------------------------------------------------------------------------*/
51
52class cellZoneSet
53:
54 public cellSet
55{
56 // Private Data
57
58 const polyMesh& mesh_;
59
60 labelList addressing_;
61
62public:
63
64 //- Runtime type information
65 TypeNameNoDebug("cellZoneSet");
66
67
68 // Constructors
69
70 //- Construct from objectRegistry and name
72 (
73 const polyMesh& mesh,
74 const word& name,
77 );
78
79 //- Construct empty (no-read) with initial labelHashSet capacity.
81 (
82 const polyMesh& mesh,
83 const word& name,
84 const label initialCapacity,
86 );
87
88 //- Copy construct (no-read) from existing set
90 (
91 const polyMesh& mesh,
92 const word& name,
93 const topoSet& set,
95 );
96
97
98
99 //- Destructor
100 virtual ~cellZoneSet() = default;
101
102
103 // Member functions
104
106 {
107 return addressing_;
108 }
109
111 {
112 return addressing_;
113 }
114
116 //- Sort addressing and make cellSet part consistent with addressing
117 void updateSet();
118
119 //- Invert contents.
120 // Insert all members [0,maxLen) which were not in set
121 virtual void invert(const label maxLen);
122
123 //- Subset contents. Only elements present in both sets remain.
124 virtual void subset(const labelUList& elems);
125
126 //- Subset contents. Only elements present in both sets remain.
127 virtual void subset(const topoSet& set);
128
129 //- Add given elements to the set
130 virtual void addSet(const labelUList& elems);
131
132 //- Add given elements to the set
133 virtual void addSet(const topoSet& set);
134
135 //- Subtract given elements from the set
136 virtual void subtractSet(const labelUList& elems);
137
138 //- Subtract given elements from the set
139 virtual void subtractSet(const topoSet& set);
140
141 //- Sync cellSet across coupled patches; update cellZone from cellSet
142 virtual void sync(const polyMesh& mesh);
143
144 //- Write maxLen items with label and coordinates.
145 virtual void writeDebug
146 (
147 Ostream& os,
148 const primitiveMesh&,
149 const label maxLen
150 ) const;
151
152 //- Write cellZone using stream options
153 virtual bool writeObject
154 (
155 IOstreamOption streamOpt,
156 const bool writeOnProc
157 ) const;
158
159 //- Update any stored data for new labels
160 virtual void updateMesh(const mapPolyMesh& morphMap);
161
162 //- Return max index+1.
163 virtual label maxSize(const polyMesh& mesh) const;
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace Foam
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#endif
174
175// ************************************************************************* //
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
writeOption
Enumeration defining write preferences.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
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:59
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write cellZone using stream options.
virtual ~cellZoneSet()=default
Destructor.
virtual void invert(const label maxLen)
Invert contents.
TypeNameNoDebug("cellZoneSet")
Runtime type information.
labelList & addressing() noexcept
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
virtual void sync(const polyMesh &mesh)
Sync cellSet across coupled patches; update cellZone from cellSet.
const labelList & addressing() const noexcept
virtual void subset(const labelUList &elems)
Subset contents. Only elements present in both sets remain.
virtual void subtractSet(const labelUList &elems)
Subtract given elements from the set.
cellZoneSet(const polyMesh &mesh, const word &name, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE)
Construct from objectRegistry and name.
Definition cellZoneSet.C:67
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
virtual void addSet(const labelUList &elems)
Add given elements to the set.
void updateSet()
Sort addressing and make cellSet part consistent with addressing.
Definition cellZoneSet.C:41
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Cell-face mesh analysis engine.
General set of labels of mesh quantity (points, cells, faces).
Definition topoSet.H:63
virtual bool set(const label id)
Set an index.
Definition topoSet.C:545
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
const direction noexcept
Definition scalarImpl.H:265
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition typeInfo.H:61