Loading...
Searching...
No Matches
cellSet.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-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::cellSet
29
30Description
31 A collection of cell labels.
32
33SourceFiles
34 cellSet.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_cellSet_H
39#define Foam_cellSet_H
40
41#include "topoSet.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
48/*---------------------------------------------------------------------------*\
49 Class cellSet Declaration
50\*---------------------------------------------------------------------------*/
51
52class cellSet
53:
54 public topoSet
55{
56 // Private Member Functions
57
58 //- No copy construct
59 cellSet(const cellSet&) = delete;
60
61
62public:
63
64 //- Runtime type information
65 TypeNameNoDebug("cellSet");
66
67
68 // Constructors
69
70 //- Construct from IOobject. No checking.
71 explicit cellSet(const IOobject& io);
72
73 //- Construct empty (no-read) with IOobject information
74 cellSet(const IOobject& io, const Foam::zero);
75
76 //- Construct from polyMesh (registry) and name.
77 //- Checks for valid cell ids.
78 cellSet
79 (
80 const polyMesh& mesh,
81 const word& name,
85 );
86
87 //- Construct from polyMesh (registry), name and registration option
88 cellSet
89 (
90 const polyMesh& mesh,
91 const word& name,
95 )
96 :
97 cellSet(mesh, name, rOpt, wOpt, reg)
98 {}
99
100 //- Construct empty (no-read) with initial labelHashSet capacity
101 cellSet
102 (
103 const polyMesh& mesh,
104 const word& name,
105 const label initialCapacity,
107 );
108
109 //- Copy construct (no-read) from existing set
110 cellSet
111 (
112 const polyMesh& mesh,
113 const word& name,
114 const topoSet& set,
116 );
117
118 //- Copy construct (no-read) from labelHashSet,
119 //- with search for IOobject instance.
120 cellSet
121 (
122 const polyMesh& mesh,
123 const word& name,
124 const labelHashSet& labels,
126 );
127
128 //- Move construct (no-read) from labelHashSet,
129 //- with search for IOobject instance.
130 cellSet
131 (
132 const polyMesh& mesh,
133 const word& name,
134 labelHashSet&& labels,
136 );
137
138 //- Copy construct (no-read) from labels,
139 //- with search for IOobject instance.
140 cellSet
141 (
142 const polyMesh& mesh,
143 const word& name,
144 const labelUList& labels,
146 );
147
148
149 //- Construct from objectRegistry and name.
150 //- Used for tetMesh cellSet only.
151 cellSet
152 (
153 const Time&,
154 const word& name,
157 );
158
159 //- Construct empty (no-read) with initial labelHashSet capacity
160 //- from objectRegistry.
161 //- Used for tetMesh cellSet only.
162 cellSet
163 (
164 const Time&,
165 const word& name,
166 const label initialCapacity,
168 );
169
170 //- Copy construct (no-read) from labelHashSet.
171 //- Used for tetMesh cellSet only.
172 cellSet
173 (
174 const Time&,
175 const word& name,
176 const labelHashSet& labels,
178 );
179
180
181 // Factory Methods
182
183 //- Read and return contents. Intermediate IOobject is not registered
185 (
186 const polyMesh& mesh,
187 const word& name
188 );
189
190
191 //- Destructor
192 virtual ~cellSet() = default;
193
194
195 // Member functions
196
197 //- Sync cellSet across coupled patches.
198 virtual void sync(const polyMesh& mesh)
199 {}
200
201 //- Return max index+1.
202 virtual label maxSize(const polyMesh& mesh) const;
203
204 //- Update any stored data for new labels.
205 virtual void updateMesh(const mapPolyMesh& morphMap);
206
207 //- Update any stored data for mesh redistribution.
208 virtual void distribute(const mapDistributePolyMesh& map);
209
210 //- Write maxLen items with label and coordinates.
211 virtual void writeDebug
212 (
213 Ostream& os,
214 const primitiveMesh&,
215 const label maxLen
216 ) const;
217};
218
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222} // End namespace Foam
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226#endif
228// ************************************************************************* //
registerOption
Enumeration for use with registerObject(). Values map to bool (false/true).
@ LEGACY_REGISTER
Legacy/default registration request (bool: true).
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
writeOption
Enumeration defining write preferences.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A collection of cell labels.
Definition cellSet.H:50
cellSet(const polyMesh &mesh, const word &name, IOobjectOption::registerOption reg, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE)
Construct from polyMesh (registry), name and registration option.
Definition cellSet.H:96
virtual ~cellSet()=default
Destructor.
virtual void distribute(const mapDistributePolyMesh &map)
Update any stored data for mesh redistribution.
Definition cellSet.C:214
TypeNameNoDebug("cellSet")
Runtime type information.
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition cellSet.C:202
static labelHashSet readContents(const polyMesh &mesh, const word &name)
Read and return contents. Intermediate IOobject is not registered.
Definition cellSet.C:181
virtual void sync(const polyMesh &mesh)
Sync cellSet across coupled patches.
Definition cellSet.H:227
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition cellSet.C:256
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition cellSet.C:208
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
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
topoSet(const topoSet &)=delete
No copy construct.
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
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
const auto & io
Namespace for OpenFOAM.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition HashSet.H:85
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