cellSet.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2016-2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::cellSet
29 
30 Description
31  A collection of cell labels.
32 
33 SourceFiles
34  cellSet.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cellSet_H
39 #define cellSet_H
40 
41 #include "topoSet.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class cellSet Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class cellSet
53 :
54  public topoSet
55 {
56  // Private Member Functions
57 
58  //- No copy construct
59  cellSet(const cellSet&) = delete;
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("cellSet");
66 
67 
68  // Constructors
69 
70  //- Construct from IOobject. No checking.
71  explicit cellSet(const IOobject& obj);
72 
73  //- Construct from polyMesh and name. Checks for valid cell ids.
74  cellSet
75  (
76  const polyMesh& mesh,
77  const word& name,
80  );
81 
82  //- Construct empty with initial size for labelHashSet
83  cellSet
84  (
85  const polyMesh& mesh,
86  const word& name,
87  const label size,
89  );
90 
91  //- Construct from existing set
92  cellSet
93  (
94  const polyMesh& mesh,
95  const word& name,
96  const topoSet& set,
98  );
99 
100  //- Construct (no-read) with copy of labelHashSet
101  cellSet
102  (
103  const polyMesh& mesh,
104  const word& name,
105  const labelHashSet& labels,
107  );
108 
109  //- Construct (no-read) with moving labelHashSet
110  cellSet
111  (
112  const polyMesh& mesh,
113  const word& name,
114  labelHashSet&& labels,
116  );
117 
118  //- Construct (no-read) with copy labels
119  cellSet
120  (
121  const polyMesh& mesh,
122  const word& name,
123  const labelUList& labels,
125  );
126 
127 
128  // Used for tetMesh cellSet only.
129 
130  //- Construct from objectRegistry and name.
131  cellSet
132  (
133  const Time&,
134  const word& name,
137  );
138 
139  //- Construct empty from objectRegistry.
140  cellSet
141  (
142  const Time&,
143  const word& name,
144  const label size,
146  );
147 
148  //- Construct from labelHashSet
149  cellSet
150  (
151  const Time&,
152  const word& name,
153  const labelHashSet& labels,
155  );
156 
157 
158  //- Destructor
159  virtual ~cellSet() = default;
160 
161 
162  // Member functions
163 
164  //- Sync cellSet across coupled patches.
165  virtual void sync(const polyMesh& mesh)
166  {}
167 
168  //- Return max index+1.
169  virtual label maxSize(const polyMesh& mesh) const;
170 
171  //- Update any stored data for new labels.
172  virtual void updateMesh(const mapPolyMesh& morphMap);
173 
174  //- Update any stored data for mesh redistribution.
175  virtual void distribute(const mapDistributePolyMesh& map);
176 
177  //- Write maxLen items with label and coordinates.
178  virtual void writeDebug
179  (
180  Ostream& os,
181  const primitiveMesh&,
182  const label maxLen
183  ) const;
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
Foam::HashTable< zero::null, label, Hash< label > >::size
label size() const noexcept
The number of elements in table.
Definition: HashTableI.H:52
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::cellSet::sync
virtual void sync(const polyMesh &mesh)
Sync cellSet across coupled patches.
Definition: cellSet.H:164
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::IOobject::name
const word & name() const
Return name.
Definition: IOobjectI.H:70
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
topoSet.H
Foam::cellSet::writeDebug
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition: cellSet.C:236
Foam::HashSet< label, Hash< label > >
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::IOobject::writeOption
writeOption
Enumeration defining the write options.
Definition: IOobject.H:127
Foam::cellSet::TypeName
TypeName("cellSet")
Runtime type information.
Foam::topoSet::set
virtual bool set(const label id)
Set an index.
Definition: topoSet.C:517
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:63
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cellSet
A collection of cell labels.
Definition: cellSet.H:51
Foam::cellSet::distribute
virtual void distribute(const mapDistributePolyMesh &map)
Update any stored data for mesh redistribution.
Definition: cellSet.C:194
Foam::cellSet::updateMesh
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition: cellSet.C:188
Foam::cellSet::maxSize
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition: cellSet.C:182
Foam::UList< label >
Foam::cellSet::~cellSet
virtual ~cellSet()=default
Destructor.
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::IOobject::readOption
readOption
Enumeration defining the read options.
Definition: IOobject.H:118
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:66
Foam::IOobject::MUST_READ
Definition: IOobject.H:120
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78