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 | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::pointZoneSet
26 
27 Description
28  Like pointSet but updates pointZone when writing.
29 
30 SourceFiles
31  pointZone.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef pointZoneSet_H
36 #define pointZoneSet_H
37 
38 #include "pointSet.H"
39 #include "boolList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class pointZoneSet Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class pointZoneSet
51 :
52  public pointSet
53 {
54  // Private data
55 
56  const polyMesh& mesh_;
57 
59 
60  // Private Member Functions
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("pointZoneSet");
67 
68 
69  // Constructors
70 
71  //- Construct from objectRegistry and name
73  (
74  const polyMesh& mesh,
75  const word& name,
78  );
79 
80  //- Construct from additional size of labelHashSet
82  (
83  const polyMesh& mesh,
84  const word& name,
85  const label,
87  );
88 
89  //- Construct from existing set
91  (
92  const polyMesh& mesh,
93  const word& name,
94  const topoSet&,
96  );
97 
98 
99 
100  //- Destructor
101  virtual ~pointZoneSet();
102 
103 
104  // Member functions
105 
106  const labelList& addressing() const
107  {
108  return addressing_;
109  }
110 
112  {
113  return addressing_;
114  }
115 
116  //- Sort addressing and make pointSet part consistent with addressing
117  void updateSet();
118 
119  //- Invert contents. (insert all members 0..maxLen-1 which were not in
120  // 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  //- Delete elements present in set.
130  virtual void deleteSet(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
144  virtual bool writeObject
145  (
149  ) const;
150 
151  //- Update any stored data for new labels
152  virtual void updateMesh(const mapPolyMesh& morphMap);
153 
154  //- Return max index+1.
155  virtual label maxSize(const polyMesh& mesh) const;
156 
157 
158 
159 
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Foam::pointZoneSet
Like pointSet but updates pointZone when writing.
Definition: pointZoneSet.H:49
Foam::pointZoneSet::updateMesh
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition: pointZoneSet.C:287
w
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
boolList.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::IOstream::compressionType
compressionType
Enumeration for the format of data in the stream.
Definition: IOstream.H:193
Foam::IOobject::MUST_READ
@ MUST_READ
Definition: IOobject.H:108
Foam::pointZoneSet::invert
virtual void invert(const label maxLen)
Invert contents. (insert all members 0..maxLen-1 which were not in.
Definition: pointZoneSet.C:139
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition: IOobject.H:118
Foam::IOstream::versionNumber
Version number type.
Definition: IOstream.H:96
Foam::pointZoneSet::maxSize
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition: pointZoneSet.C:236
Foam::pointZoneSet::mesh_
const polyMesh & mesh_
Definition: pointZoneSet.H:55
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::pointZoneSet::addressing
labelList & addressing()
Definition: pointZoneSet.H:110
Foam::pointZoneSet::sync
virtual void sync(const polyMesh &mesh)
Sync pointZoneSet across coupled patches.
Definition: pointZoneSet.C:232
Foam::IOobject::writeOption
writeOption
Enumeration defining the write options.
Definition: IOobject.H:115
Foam::pointZoneSet::writeDebug
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition: pointZoneSet.C:312
Foam::IOobject::name
const word & name() const
Return name.
Definition: IOobject.H:273
Foam::pointZoneSet::writeObject
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
Write pointZone.
Definition: pointZoneSet.C:244
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:61
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointZoneSet::addSet
virtual void addSet(const topoSet &set)
Add elements present in set.
Definition: pointZoneSet.C:189
Foam::pointZoneSet::subset
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
Definition: pointZoneSet.C:168
Foam::pointZoneSet::deleteSet
virtual void deleteSet(const topoSet &set)
Delete elements present in set.
Definition: pointZoneSet.C:210
Foam::pointSet
A set of point labels.
Definition: pointSet.H:48
Foam::pointZoneSet::TypeName
TypeName("pointZoneSet")
Runtime type information.
Foam::pointZoneSet::~pointZoneSet
virtual ~pointZoneSet()
Destructor.
Definition: pointZoneSet.C:133
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::IOobject::readOption
readOption
Enumeration defining the read options.
Definition: IOobject.H:106
Foam::pointZoneSet::addressing_
labelList addressing_
Definition: pointZoneSet.H:57
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::pointZoneSet::pointZoneSet
pointZoneSet(const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Construct from objectRegistry and name.
Definition: pointZoneSet.C:68
Foam::pointZoneSet::addressing
const labelList & addressing() const
Definition: pointZoneSet.H:105
Foam::pointZoneSet::updateSet
void updateSet()
Sort addressing and make pointSet part consistent with addressing.
Definition: pointZoneSet.C:50
Foam::HashSet::set
bool set(const Key &key)
Same as insert (cannot overwrite nil content)
Definition: HashSet.H:126
pointSet.H
Foam::IOstream::streamFormat
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:86
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:79