FreeFOAM The Cross-Platform CFD Toolkit
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) 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::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 <OpenFOAM/boolList.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class pointZoneSet Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public pointSet
53 {
54  // Private data
55 
56  const polyMesh& mesh_;
57 
58  labelList addressing_;
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 
102  virtual ~pointZoneSet();
103 
104 
105  // Member functions
106 
107  const labelList& addressing() const
108  {
109  return addressing_;
110  }
111 
113  {
114  return addressing_;
115  }
116 
117  //- Sort addressing and make pointSet part consistent with addressing
118  void updateSet();
119 
120  //- Invert contents. (insert all members 0..maxLen-1 which were not in
121  // set)
122  virtual void invert(const label maxLen);
123 
124  //- Subset contents. Only elements present in both sets remain.
125  virtual void subset(const topoSet& set);
126 
127  //- Add elements present in set.
128  virtual void addSet(const topoSet& set);
129 
130  //- Delete elements present in set.
131  virtual void deleteSet(const topoSet& set);
132 
133  //- Sync pointZoneSet across coupled patches.
134  virtual void sync(const polyMesh& mesh);
135 
136  //- Write maxLen items with label and coordinates.
137  virtual void writeDebug
138  (
139  Ostream& os,
140  const primitiveMesh&,
141  const label maxLen
142  ) const;
143 
144  //- Write pointZone
145  virtual bool writeObject
146  (
150  ) const;
151 
152  //- Update any stored data for new labels
153  virtual void updateMesh(const mapPolyMesh& morphMap);
154 
155  //- Return max index+1.
156  virtual label maxSize(const polyMesh& mesh) const;
157 
158 
159 
160 
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************ vim: set sw=4 sts=4 et: ************************ //