OpenFOAM
v2406
The open source CFD toolbox
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-2024 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 Foam_faceSet_H
39
#define Foam_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
TypeNameNoDebug
(
"faceSet"
);
60
61
62
// Constructors
63
64
//- Construct from IOobject. No checking.
65
explicit
faceSet
(
const
IOobject
&
io
);
66
67
//- Construct empty (no-read) with IOobject information
68
faceSet
(
const
IOobject
&
io
,
const
Foam::zero
);
69
70
//- Construct from polyMesh (registry) and name
71
faceSet
72
(
73
const
polyMesh
&
mesh
,
74
const
word
&
name
,
75
IOobjectOption::readOption
rOpt =
IOobjectOption::MUST_READ
,
76
IOobjectOption::writeOption
wOpt =
IOobjectOption::NO_WRITE
,
77
IOobjectOption::registerOption
reg =
IOobjectOption::LEGACY_REGISTER
78
);
79
80
//- Construct from polyMesh (registry), name and registration option
81
faceSet
82
(
83
const
polyMesh
&
mesh
,
84
const
word
&
name
,
85
IOobjectOption::registerOption
reg,
86
IOobjectOption::readOption
rOpt =
IOobjectOption::MUST_READ
,
87
IOobjectOption::writeOption
wOpt =
IOobjectOption::NO_WRITE
88
)
89
:
90
faceSet
(
mesh
,
name
, rOpt, wOpt, reg)
91
{}
92
93
//- Construct empty (no-read) with initial labelHashSet capacity.
94
faceSet
95
(
96
const
polyMesh
&
mesh
,
97
const
word
&
name
,
98
const
label initialCapacity,
99
IOobjectOption::writeOption
wOpt =
IOobjectOption::NO_WRITE
100
);
101
102
//- Copy construct (no-read) from existing set
103
faceSet
104
(
105
const
polyMesh
&
mesh
,
106
const
word
&
name
,
107
const
topoSet
&
set
,
108
IOobjectOption::writeOption
wOpt =
IOobjectOption::NO_WRITE
109
);
110
111
//- Copy construct (no-read) from labelHashSet,
112
//- with search for IOobject instance.
113
faceSet
114
(
115
const
polyMesh
&
mesh
,
116
const
word
&
name
,
117
const
labelHashSet
& labels,
118
IOobjectOption::writeOption
wOpt =
IOobjectOption::NO_WRITE
119
);
120
121
//- Move construct (no-read) from labelHashSet,
122
//- with search for IOobject instance.
123
faceSet
124
(
125
const
polyMesh
&
mesh
,
126
const
word
&
name
,
127
labelHashSet
&& labels,
128
IOobjectOption::writeOption
wOpt =
IOobjectOption::NO_WRITE
129
);
130
131
//- Copy construct (no-read) from labels,
132
//- with search for IOobject instance.
133
faceSet
134
(
135
const
polyMesh
&
mesh
,
136
const
word
&
name
,
137
const
labelUList
& labels,
138
IOobjectOption::writeOption
wOpt =
IOobjectOption::NO_WRITE
139
);
140
141
142
// Factory Methods
143
144
//- Read and return contents. Intermediate IOobject is not registered
145
static
labelHashSet
readContents
146
(
147
const
polyMesh
&
mesh
,
148
const
word
&
name
149
);
150
151
152
//- Destructor
153
virtual
~faceSet
() =
default
;
154
155
156
// Member functions
157
158
//- Sync faceSet across coupled patches.
159
virtual
void
sync
(
const
polyMesh
&
mesh
);
160
161
//- Return max index+1.
162
virtual
label
maxSize
(
const
polyMesh
&
mesh
)
const
;
163
164
//- Update any stored data for new labels
165
virtual
void
updateMesh
(
const
mapPolyMesh
& morphMap);
166
167
//- Update any stored data for mesh redistribution.
168
virtual
void
distribute
(
const
mapDistributePolyMesh
& map);
169
170
//- Write maxLen items with label and coordinates.
171
virtual
void
writeDebug
172
(
173
Ostream
&
os
,
174
const
primitiveMesh
&,
175
const
label maxLen
176
)
const
;
177
};
178
179
180
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182
}
// End namespace Foam
183
184
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186
#endif
187
188
// ************************************************************************* //
Foam::faceSet::maxSize
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition:
faceSet.C:183
Foam::IOobjectOption::writeOption
writeOption
Enumeration defining write preferences.
Definition:
IOobjectOption.H:83
Foam::HashSet< label, Hash< label > >
Foam::faceSet
A list of face labels.
Definition:
faceSet.H:47
Foam::faceSet::distribute
virtual void distribute(const mapDistributePolyMesh &map)
Update any stored data for mesh redistribution.
Definition:
faceSet.C:195
Foam::IOobjectOption::LEGACY_REGISTER
Legacy/default registration request (bool: true)
Definition:
IOobjectOption.H:105
Foam::IOobject::name
const word & name() const noexcept
Return the object name.
Definition:
IOobjectI.H:195
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition:
primitiveMesh.H:75
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition:
mapDistributePolyMesh.H:65
Foam::IOobjectOption::NO_WRITE
Ignore writing from objectRegistry::writeObject()
Definition:
IOobjectOption.H:86
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition:
mapPolyMesh.H:158
Foam::faceSet::writeDebug
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Definition:
faceSet.C:237
topoSet.H
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
Foam::faceSet::~faceSet
virtual ~faceSet()=default
Destructor.
Foam::word
A class for handling words, derived from Foam::string.
Definition:
word.H:63
Foam::IOobjectOption::MUST_READ
Reading required.
Definition:
IOobjectOption.H:63
Foam::UList< label >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition:
Ostream.H:56
os
OBJstream os(runTime.globalPath()/outputName)
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition:
topoSet.H:59
Foam::IOobjectOption::registerOption
registerOption
Enumeration for use with registerObject(). Values map to bool (false/true)
Definition:
IOobjectOption.H:96
Foam::faceSet::readContents
static labelHashSet readContents(const polyMesh &mesh, const word &name)
Read and return contents. Intermediate IOobject is not registered.
Definition:
faceSet.C:131
Foam::faceSet::faceSet
faceSet(const IOobject &io)
Construct from IOobject. No checking.
Definition:
faceSet.C:41
Foam::faceSet::TypeNameNoDebug
TypeNameNoDebug("faceSet")
Runtime type information.
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition:
zero.H:57
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition:
polyMesh.H:75
Foam::faceSet::sync
virtual void sync(const polyMesh &mesh)
Sync faceSet across coupled patches.
Definition:
faceSet.C:152
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition:
IOobject.H:180
Foam::faceSet::updateMesh
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition:
faceSet.C:189
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:26
Foam::IOobjectOption::readOption
readOption
Enumeration defining read preferences.
Definition:
IOobjectOption.H:57
src
meshTools
topoSet
topoSets
faceSet.H
Generated by
1.8.14