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 public:
57 
58  //- Runtime type information
59  TypeName("faceSet");
60 
61 
62  // Constructors
63 
64  //- Construct from IOobject
65  explicit faceSet(const IOobject& obj);
66 
67  //- Construct from objectRegistry and name
68  faceSet
69  (
70  const polyMesh& mesh,
71  const word& name,
74  );
75 
76  //- Construct empty with initial size for labelHashSet
77  faceSet
78  (
79  const polyMesh& mesh,
80  const word& name,
81  const label size,
83  );
84 
85  //- Construct from existing set
86  faceSet
87  (
88  const polyMesh& mesh,
89  const word& name,
90  const topoSet& set,
92  );
93 
94  //- Construct (no-read) with copy of labelHashSet
95  faceSet
96  (
97  const polyMesh& mesh,
98  const word& name,
99  const labelHashSet& labels,
101  );
102 
103  //- Construct (no-read) with moving labelHashSet
104  faceSet
105  (
106  const polyMesh& mesh,
107  const word& name,
108  labelHashSet&& labels,
110  );
111 
112  //- Construct (no-read) with copy of labels
113  faceSet
114  (
115  const polyMesh& mesh,
116  const word& name,
117  const labelUList& labels,
119  );
120 
121 
122  //- Destructor
123  virtual ~faceSet() = default;
124 
125 
126  // Member functions
127 
128  //- Sync faceSet across coupled patches.
129  virtual void sync(const polyMesh& mesh);
130 
131  //- Return max index+1.
132  virtual label maxSize(const polyMesh& mesh) const;
133 
134  //- Update any stored data for new labels
135  virtual void updateMesh(const mapPolyMesh& morphMap);
136 
137  //- Update any stored data for mesh redistribution.
138  virtual void distribute(const mapDistributePolyMesh& map);
139 
140  //- Write maxLen items with label and coordinates.
141  virtual void writeDebug
142  (
143  Ostream& os,
144  const primitiveMesh&,
145  const label maxLen
146  ) const;
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
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:192
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::topoSet::set
virtual bool set(const label id)
Set an index.
Definition: topoSet.C:514
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:63
Foam::faceSet::faceSet
faceSet(const IOobject &obj)
Construct from IOobject.
Definition: faceSet.C:48
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faceSet::TypeName
TypeName("faceSet")
Runtime type information.
Foam::IOobject::name
const word & name() const noexcept
Return name.
Definition: IOobjectI.H:65
Foam::UList< label >
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
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:183
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:185
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78