FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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 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 <OpenFOAM/boolList.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class faceZoneSet Declaration
48 \*---------------------------------------------------------------------------*/
49 
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 
104  virtual ~faceZoneSet();
105 
106 
107  // Member functions
108 
109  const labelList& addressing() const
110  {
111  return addressing_;
112  }
113 
115  {
116  return addressing_;
117  }
118 
119 
120  const boolList& flipMap() const
121  {
122  return flipMap_;
123  }
124 
126  {
127  return flipMap_;
128  }
129 
130 
131  //- Sort addressing and make faceSet part consistent with addressing
132  void updateSet();
133 
134  //- Invert contents. (insert all members 0..maxLen-1 which were not in
135  // set)
136  virtual void invert(const label maxLen);
137 
138  //- Subset contents. Only elements present in both sets remain.
139  virtual void subset(const topoSet& set);
140 
141  //- Add elements present in set.
142  virtual void addSet(const topoSet& set);
143 
144  //- Delete elements present in set.
145  virtual void deleteSet(const topoSet& set);
146 
147  //- Sync faceZoneSet across coupled patches.
148  virtual void sync(const polyMesh& mesh);
149 
150  //- Write maxLen items with label and coordinates.
151  virtual void writeDebug
152  (
153  Ostream& os,
154  const primitiveMesh&,
155  const label maxLen
156  ) const;
157 
158  //- Write faceZone
159  virtual bool writeObject
160  (
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 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************ vim: set sw=4 sts=4 et: ************************ //