pointZoneSet.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::pointZoneSet
29
30Description
31 Like pointSet but -reads data from pointZone -updates pointZone when
32 writing.
33
34SourceFiles
35 pointZone.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef pointZoneSet_H
40#define pointZoneSet_H
41
42#include "pointSet.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class pointZoneSet Declaration
51\*---------------------------------------------------------------------------*/
53class pointZoneSet
54:
55 public pointSet
56{
57 // Private Data
58
59 const polyMesh& mesh_;
60
61 labelList addressing_;
62
63
64public:
65
66 //- Runtime type information
67 TypeName("pointZoneSet");
68
69
70 // Constructors
71
72 //- Construct from objectRegistry and name
74 (
75 const polyMesh& mesh,
76 const word& name,
79 );
80
81 //- Construct empty with initial size for labelHashSet
83 (
84 const polyMesh& mesh,
85 const word& name,
86 const label size,
88 );
89
90 //- Copy construct from existing set
92 (
93 const polyMesh& mesh,
94 const word& name,
95 const topoSet& set,
97 );
98
99
100 //- Destructor
101 virtual ~pointZoneSet() = default;
102
103
104 // Member functions
106 const labelList& addressing() const
107 {
108 return addressing_;
109 }
112 {
113 return addressing_;
114 }
115
116 //- Sort addressing and make pointSet 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 topoSet& set);
125
126 //- Add elements present in set.
127 virtual void addSet(const topoSet& set);
128
129 //- Subtract elements present in set.
130 virtual void subtractSet(const topoSet& set);
131
132 //- Sync pointZoneSet across coupled patches.
133 virtual void sync(const polyMesh& mesh);
134
135 //- Write maxLen items with label and coordinates.
136 virtual void writeDebug
137 (
138 Ostream& os,
139 const primitiveMesh&,
140 const label maxLen
141 ) const;
142
143 //- Write pointZone using stream options
144 virtual bool writeObject
145 (
146 IOstreamOption streamOpt,
147 const bool valid
148 ) const;
149
150 //- Update any stored data for new labels
151 virtual void updateMesh(const mapPolyMesh& morphMap);
152
153 //- Return max index+1.
154 virtual label maxSize(const polyMesh& mesh) const;
155};
156
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160} // End namespace Foam
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164#endif
165
166// ************************************************************************* //
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
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
A set of point labels.
Definition: pointSet.H:54
Like pointSet but -reads data from pointZone -updates pointZone when writing.
Definition: pointZoneSet.H:55
virtual void invert(const label maxLen)
Invert contents.
Definition: pointZoneSet.C:127
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
Definition: pointZoneSet.C:194
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition: pointZoneSet.C:224
const labelList & addressing() const
Definition: pointZoneSet.H:105
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write pointZone using stream options.
Definition: pointZoneSet.C:231
labelList & addressing()
Definition: pointZoneSet.H:110
virtual void sync(const polyMesh &mesh)
Sync pointZoneSet across coupled patches.
Definition: pointZoneSet.C:214
TypeName("pointZoneSet")
Runtime type information.
virtual void addSet(const topoSet &set)
Add elements present in set.
Definition: pointZoneSet.C:175
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition: pointZoneSet.C:297
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition: pointZoneSet.C:273
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
Definition: pointZoneSet.C:156
virtual ~pointZoneSet()=default
Destructor.
void updateSet()
Sort addressing and make pointSet part consistent with addressing.
Definition: pointZoneSet.C:48
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.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73