FreeFOAM The Cross-Platform CFD Toolkit
cellZoneSet.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::cellZoneSet
26 
27 Description
28  Like cellSet but updates cellZone when writing.
29 
30 SourceFiles
31  cellZone.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cellZoneSet_H
36 #define cellZoneSet_H
37 
38 #include "cellSet.H"
39 #include <OpenFOAM/boolList.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class cellZoneSet Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public cellSet
53 {
54  // Private data
55 
56  const polyMesh& mesh_;
57 
58  labelList addressing_;
59 
60 public:
61 
62  //- Runtime type information
63  TypeName("cellZoneSet");
64 
65 
66  // Constructors
67 
68  //- Construct from objectRegistry and name
70  (
71  const polyMesh& mesh,
72  const word& name,
75  );
76 
77  //- Construct from additional size of labelHashSet
79  (
80  const polyMesh& mesh,
81  const word& name,
82  const label,
84  );
85 
86  //- Construct from existing set
88  (
89  const polyMesh& mesh,
90  const word& name,
91  const topoSet&,
93  );
94 
95 
96 
97  // Destructor
98 
99  virtual ~cellZoneSet();
100 
101 
102  // Member functions
103 
104  const labelList& addressing() const
105  {
106  return addressing_;
107  }
108 
110  {
111  return addressing_;
112  }
113 
114  //- Sort addressing and make cellSet part consistent with addressing
115  void updateSet();
116 
117  //- Invert contents. (insert all members 0..maxLen-1 which were not in
118  // set)
119  virtual void invert(const label maxLen);
120 
121  //- Subset contents. Only elements present in both sets remain.
122  virtual void subset(const topoSet& set);
123 
124  //- Add elements present in set.
125  virtual void addSet(const topoSet& set);
126 
127  //- Delete elements present in set.
128  virtual void deleteSet(const topoSet& set);
129 
130  //- Sync cellZoneSet across coupled patches.
131  virtual void sync(const polyMesh& mesh);
132 
133  //- Write maxLen items with label and coordinates.
134  virtual void writeDebug
135  (
136  Ostream& os,
137  const primitiveMesh&,
138  const label maxLen
139  ) const;
140 
141  //- Write cellZone
142  virtual bool writeObject
143  (
147  ) const;
148 
149  //- Update any stored data for new labels
150  virtual void updateMesh(const mapPolyMesh& morphMap);
151 
152  //- Return max index+1.
153  virtual label maxSize(const polyMesh& mesh) const;
154 
155 
156 
157 
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************ vim: set sw=4 sts=4 et: ************************ //