faceSet.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::faceSet
29 
30 Description
31  A list of face labels.
32 
33 SourceFiles
34  faceSet.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef faceSet_H
39 #define faceSet_H
40 
41 #include "topoSet.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class faceSet Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class faceSet
53 :
54  public topoSet
55 {
56 
57 public:
58 
59  //- Runtime type information
60  TypeName("faceSet");
61 
62 
63  // Constructors
64 
65  //- Construct from IOobject
66  explicit faceSet(const IOobject& obj);
67 
68  //- Construct from objectRegistry and name
69  faceSet
70  (
71  const polyMesh& mesh,
72  const word& name,
75  );
76 
77  //- Construct empty with initial size for labelHashSet
78  faceSet
79  (
80  const polyMesh& mesh,
81  const word& name,
82  const label size,
84  );
85 
86  //- Construct from existing set
87  faceSet
88  (
89  const polyMesh& mesh,
90  const word& name,
91  const topoSet& set,
93  );
94 
95  //- Construct (no-read) with copy of labelHashSet
96  faceSet
97  (
98  const polyMesh& mesh,
99  const word& name,
100  const labelHashSet& labels,
102  );
103 
104  //- Construct (no-read) with moving labelHashSet
105  faceSet
106  (
107  const polyMesh& mesh,
108  const word& name,
109  labelHashSet&& labels,
111  );
112 
113  //- Construct (no-read) with copy of labels
114  faceSet
115  (
116  const polyMesh& mesh,
117  const word& name,
118  const labelUList& labels,
120  );
121 
122 
123  //- Destructor
124  virtual ~faceSet() = default;
125 
126 
127  // Member functions
128 
129  //- Sync faceSet across coupled patches.
130  virtual void sync(const polyMesh& mesh);
131 
132  //- Return max index+1.
133  virtual label maxSize(const polyMesh& mesh) const;
134 
135  //- Update any stored data for new labels
136  virtual void updateMesh(const mapPolyMesh& morphMap);
137 
138  //- Update any stored data for mesh redistribution.
139  virtual void distribute(const mapDistributePolyMesh& map);
140 
141  //- Write maxLen items with label and coordinates.
142  virtual void writeDebug
143  (
144  Ostream& os,
145  const primitiveMesh&,
146  const label maxLen
147  ) const;
148 
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
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::IOobject::name
const word & name() const
Return name.
Definition: IOobjectI.H:46
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
topoSet.H
Foam::faceSet::distribute
virtual void distribute(const mapDistributePolyMesh &map)
Update any stored data for mesh redistribution.
Definition: faceSet.C:173
Foam::faceSet
A list of face labels.
Definition: faceSet.H:51
Foam::faceSet::maxSize
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition: faceSet.C:161
Foam::HashSet< label, Hash< label > >
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::faceSet::sync
virtual void sync(const polyMesh &mesh)
Sync faceSet across coupled patches.
Definition: faceSet.C:130
Foam::IOobject::writeOption
writeOption
Enumeration defining the write options.
Definition: IOobject.H:127
Foam::faceSet::writeDebug
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition: faceSet.C:215
Foam::label
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:62
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:66
Foam::faceSet::faceSet
faceSet(const IOobject &obj)
Construct from IOobject.
Definition: faceSet.C:48
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faceSet::TypeName
TypeName("faceSet")
Runtime type information.
Foam::UList< label >
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::faceSet::updateMesh
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition: faceSet.C:167
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::faceSet::~faceSet
virtual ~faceSet()=default
Destructor.
Foam::IOobject::MUST_READ
Definition: IOobject.H:120
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78