faceZoneSet.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-2017 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::faceZoneSet
26 
27 Description
28  Like faceSet but -reads data from faceZone -updates faceZone when writing.
29 
30 SourceFiles
31  faceZone.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef faceZoneSet_H
36 #define faceZoneSet_H
37 
38 #include "faceSet.H"
39 #include "boolList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class faceZoneSet Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class faceZoneSet
51 :
52  public faceSet
53 {
54  // Private data
55 
56  const polyMesh& mesh_;
57 
58  labelList addressing_;
59 
60  boolList flipMap_;
61 
62  // Private Member Functions
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("faceZoneSet");
69 
70 
71  // Constructors
72 
73  //- Construct from objectRegistry and name
75  (
76  const polyMesh& mesh,
77  const word& name,
80  );
81 
82  //- Construct from additional size of labelHashSet
84  (
85  const polyMesh& mesh,
86  const word& name,
87  const label,
89  );
90 
91  //- Construct from existing set
93  (
94  const polyMesh& mesh,
95  const word& name,
96  const topoSet&,
98  );
99 
100 
101 
102  //- Destructor
103  virtual ~faceZoneSet();
104 
105 
106  // Member functions
108  const labelList& addressing() const
109  {
110  return addressing_;
111  }
114  {
115  return addressing_;
116  }
117 
119  const boolList& flipMap() const
120  {
121  return flipMap_;
122  }
124  boolList& flipMap()
125  {
126  return flipMap_;
127  }
128 
129 
130  //- Sort addressing and make faceSet part consistent with addressing
131  void updateSet();
132 
133  //- Invert contents. (insert all members 0..maxLen-1 which were not in
134  // set)
135  virtual void invert(const label maxLen);
136 
137  //- Subset contents. Only elements present in both sets remain.
138  virtual void subset(const topoSet& set);
139 
140  //- Add elements present in set.
141  virtual void addSet(const topoSet& set);
142 
143  //- Delete elements present in set.
144  virtual void deleteSet(const topoSet& set);
145 
146  //- Sync faceZoneSet across coupled patches.
147  virtual void sync(const polyMesh& mesh);
148 
149  //- Write maxLen items with label and coordinates.
150  virtual void writeDebug
151  (
152  Ostream& os,
153  const primitiveMesh&,
154  const label maxLen
155  ) const;
156 
157  //- Write faceZone
158  virtual bool writeObject
159  (
163  const bool valid
164  ) const;
165 
166  //- Update any stored data for new labels
167  virtual void updateMesh(const mapPolyMesh& morphMap);
168 
169  //- Return max index+1.
170  virtual label maxSize(const polyMesh& mesh) const;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
const boolList & flipMap() const
Definition: faceZoneSet.H:118
faceZoneSet(const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Construct from objectRegistry and name.
Definition: faceZoneSet.C:70
writeOption
Enumeration defining the write options.
Definition: IOobject.H:116
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
const word & name() const
Return name.
Definition: IOobject.H:291
A list of face labels.
Definition: faceSet.H:48
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:74
virtual void invert(const label maxLen)
Invert contents. (insert all members 0..maxLen-1 which were not in.
Definition: faceZoneSet.C:145
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write faceZone.
Definition: faceZoneSet.C:463
readOption
Enumeration defining the read options.
Definition: IOobject.H:107
virtual void deleteSet(const topoSet &set)
Delete elements present in set.
Definition: faceZoneSet.C:275
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition: faceZoneSet.C:508
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual ~faceZoneSet()
Destructor.
Definition: faceZoneSet.C:139
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition: faceZoneSet.C:537
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition: faceZoneSet.C:456
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:86
compressionType
Enumeration for the format of data in the stream.
Definition: IOstream.H:193
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
Definition: faceZoneSet.C:176
TypeName("faceZoneSet")
Runtime type information.
virtual void sync(const polyMesh &mesh)
Sync faceZoneSet across coupled patches.
Definition: faceZoneSet.C:327
void updateSet()
Sort addressing and make faceSet part consistent with addressing.
Definition: faceZoneSet.C:51
Like faceSet but -reads data from faceZone -updates faceZone when writing.
Definition: faceZoneSet.H:49
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:61
virtual void addSet(const topoSet &set)
Add elements present in set.
Definition: faceZoneSet.C:224
Version number type.
Definition: IOstream.H:96
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
const labelList & addressing() const
Definition: faceZoneSet.H:107
Namespace for OpenFOAM.