Loading...
Searching...
No Matches
pointSet.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::pointSet
29
30Description
31 A set of point labels.
32
33SourceFiles
34 pointSet.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_pointSet_H
39#define Foam_pointSet_H
40
41#include "topoSet.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
48/*---------------------------------------------------------------------------*\
49 Class pointSet Declaration
50\*---------------------------------------------------------------------------*/
51
52class pointSet
53:
54 public topoSet
55{
56public:
57
58 //- Runtime type information
59 TypeNameNoDebug("pointSet");
60
61
62 // Constructors
63
64 //- Construct from IOobject
65 explicit pointSet(const IOobject& io);
66
67 //- Construct empty (no-read) with IOobject information
68 pointSet(const IOobject& io, const Foam::zero);
69
70 //- Construct from polyMesh (registry) and name
72 (
73 const polyMesh& mesh,
74 const word& name,
78 );
79
80 //- Construct from polyMesh (registry), name and registration option
82 (
83 const polyMesh& mesh,
84 const word& name,
88 )
89 :
90 pointSet(mesh, name, rOpt, wOpt, reg)
91 {}
92
93 //- Construct empty (no-read) with initial labelHashSet capacity.
95 (
96 const polyMesh& mesh,
97 const word& name,
98 const label initialCapacity,
100 );
101
102 //- Copy construct (no-read) from existing set
104 (
105 const polyMesh& mesh,
106 const word& name,
107 const topoSet& set,
109 );
110
111 //- Copy construct (no-read) from labelHashSet,
112 //- with search for IOobject instance.
114 (
115 const polyMesh& mesh,
116 const word& name,
117 const labelHashSet& labels,
119 );
120
121 //- Move construct (no-read) from labelHashSet,
122 //- with search for IOobject instance.
124 (
125 const polyMesh& mesh,
126 const word& name,
127 labelHashSet&& labels,
129 );
130
131 //- Copy construct (no-read) from labels,
132 //- with search for IOobject instance.
134 (
135 const polyMesh& mesh,
136 const word& name,
137 const labelUList& labels,
139 );
140
141
142 // Factory Methods
143
144 //- Read and return contents. Intermediate IOobject is not registered
146 (
147 const polyMesh& mesh,
148 const word& name
149 );
150
151
152 //- Destructor
153 virtual ~pointSet() = default;
154
155
156 // Member Functions
157
158 //- Sync set across coupled patches. Adds coupled points to set.
159 virtual void sync(const polyMesh& mesh);
160
161 //- Return max index+1.
162 virtual label maxSize(const polyMesh& mesh) const;
163
164 //- Update any stored data for new labels
165 virtual void updateMesh(const mapPolyMesh& morphMap);
166
167 //- Update any stored data for mesh redistribution.
168 virtual void distribute(const mapDistributePolyMesh&);
169
170 //- Write maxLen items with label and coordinates.
171 virtual void writeDebug
173 Ostream& os,
174 const primitiveMesh&,
175 const label maxLen
176 ) const;
177};
178
179
180// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182} // End namespace Foam
183
184// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186#endif
187
188// ************************************************************************* //
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 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.
virtual ~pointSet()=default
Destructor.
virtual void distribute(const mapDistributePolyMesh &)
Update any stored data for mesh redistribution.
Definition pointSet.C:197
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition pointSet.C:185
static labelHashSet readContents(const polyMesh &mesh, const word &name)
Read and return contents. Intermediate IOobject is not registered.
Definition pointSet.C:132
pointSet(const IOobject &io)
Construct from IOobject.
Definition pointSet.C:42
TypeNameNoDebug("pointSet")
Runtime type information.
virtual void sync(const polyMesh &mesh)
Sync set across coupled patches. Adds coupled points to set.
Definition pointSet.C:153
pointSet(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 pointSet.H:87
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition pointSet.C:240
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition pointSet.C:191
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