Loading...
Searching...
No Matches
patchToFace.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) 2018-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::patchToFace
29
30Description
31 A \c topoSetFaceSource to select cells associated with given patch(es).
32
33 Operands:
34 \table
35 Operand | Type | Location
36 output | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
37 \endtable
38
39Usage
40 Minimal example by using \c system/topoSetDict.actions:
41 \verbatim
42 {
43 // Mandatory (inherited) entries
44 name <name>;
45 type faceSet;
46 action <action>;
47
48 // Mandatory entries
49 source patchToFace;
50
51 // Conditional mandatory entries
52 // Select one of the below
53
54 // Option-1
55 patches
56 (
57 <patchName1>
58 <patchName2>
59 ...
60 );
61
62 // Option-2
63 patch <patchName>;
64 }
65 \endverbatim
66
67 where the entries mean:
68 \table
69 Property | Description | Type | Req'd | Dflt
70 name | Name of faceSet | word | yes | -
71 type | Type name: faceSet | word | yes | -
72 action | Action applied on faces - see below | word | yes | -
73 source | Source name: patchToFace | word | yes | -
74 \endtable
75
76 Options for the \c action entry:
77 \verbatim
78 new | Create a new faceSet from selected faces
79 add | Add selected faces into this faceSet
80 subtract | Remove selected faces from this faceSet
81 \endverbatim
82
83 Options for the conditional mandatory entries:
84 \verbatim
85 Entry | Description | Type | Req'd | Dflt
86 patches | Names of patches | wordList | cond'l | -
87 patch | Name of patch | word | cond'l | -
88 \endverbatim
89
90Note
91 The order of precedence among the conditional mandatory entries from the
92 highest to the lowest is \c patches, and \c patch.
93
94See also
95 - Foam::topoSetSource
96 - Foam::topoSetFaceSource
97 - Foam::boundaryToFace
98
99SourceFiles
100 patchToFace.C
101
102\*---------------------------------------------------------------------------*/
103
104#ifndef patchToFace_H
105#define patchToFace_H
106
107#include "topoSetFaceSource.H"
108#include "wordRes.H"
109
110// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111
112namespace Foam
113{
114
115/*---------------------------------------------------------------------------*\
116 Class patchToFace Declaration
117\*---------------------------------------------------------------------------*/
118
119class patchToFace
120:
121 public topoSetFaceSource
122{
123 // Private Data
124
125 //- Add usage string
126 static addToUsageTable usage_;
127
128 //- Matcher for patches
129 wordRes selectedPatches_;
130
131
132 // Private Member Functions
133
134 void combine(topoSet& set, const bool add) const;
135
136
137public:
138
139 //- Runtime type information
140 TypeName("patchToFace");
141
142
143 // Constructors
144
145 //- Construct from components
146 patchToFace(const polyMesh& mesh, const wordRe& patchName);
147
148 //- Construct from dictionary
149 patchToFace(const polyMesh& mesh, const dictionary& dict);
150
151 //- Construct from Istream
153
154
155 //- Destructor
156 virtual ~patchToFace() = default;
157
158
159 // Member Functions
160
161 virtual void applyToSet
162 (
163 const topoSetSource::setAction action,
164 topoSet& set
165 ) const;
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A topoSetFaceSource to select cells associated with given patch(es).
TypeName("patchToFace")
Runtime type information.
patchToFace(const polyMesh &mesh, const wordRe &patchName)
Construct from components.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
virtual ~patchToFace()=default
Destructor.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
topoSetFaceSource(const polyMesh &mesh)
Construct from mesh.
Class with constructor to add usage string to table.
setAction
Enumeration defining various actions.
const polyMesh & mesh() const noexcept
Reference to the mesh.
General set of labels of mesh quantity (points, cells, faces).
Definition topoSet.H:63
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition wordRe.H:81
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
Namespace for OpenFOAM.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68