The open source CFD toolbox
pointToFace.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-2012 OpenFOAM Foundation
9 Copyright (C) 2018-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
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::pointToFace
29
30Description
31 A \c topoSetFaceSource to select faces with any
32 point or any edge within a given \c pointSet(s).
33
34 Operands
35 \table
36 Operand | Type | Location
37 input | pointSet(s) | $FOAM_CASE/constant/polyMesh/sets/<set> 38 output | faceSet |$FOAM_CASE/constant/polyMesh/sets/<set>
39 \endtable
40
41Usage
42 Minimal example by using \c system/topoSetDict.actions:
43 \verbatim
44 {
45 // Mandatory (inherited) entries
46 name <name>;
47 type faceSet;
48 action <action>;
49
50 // Mandatory entries
51 source pointToFace;
52 option <option>;
53
54 // Conditional mandatory entries
55 // Select either of the below
56
57 // Option-1
58 sets
59 (
60 <pointSetName1>
61 <pointSetName2>
62 ...
63 );
64
65 // Option-2
66 set <pointSetName>;
67 }
68 \endverbatim
69
70 where the entries mean:
71 \table
72 Property | Description | Type | Req'd | Dflt
73 name | Name of faceSet | word | yes | -
74 type | Type name: faceSet | word | yes | -
75 action | Action applied on faces - see below | word | yes | -
76 source | Source name: pointToFace | word | yes | -
77 option | Selection type - see below | word | yes | -
78 \endtable
79
80 Options for the \c action entry:
81 \verbatim
82 new | Create a new faceSet from selected faces
84 subtract | Remove selected faces from this faceSet
85 \endverbatim
86
87 Options for the \c option entry:
88 \verbatim
89 any | Any point in the pointSet
90 edge | Two consecutive points (an edge) in the pointSet
91 all | All points in the pointSet
92 \endverbatim
93
94 Options for the conditional mandatory entries:
95 \verbatim
96 Entry | Description | Type | Req'd | Dflt
97 sets | Names of input pointSets | wordList | cond'l | -
98 set | Name of input pointSet | word | cond'l | -
99 \endverbatim
100
101Note
102 The order of precedence among the conditional mandatory entries from the
103 highest to the lowest is \c sets, and \c set.
104
106 - Foam::topoSetSource
107 - Foam::topoSetFaceSource
108
109SourceFiles
110 pointToFace.C
111
112\*---------------------------------------------------------------------------*/
113
114#ifndef pointToFace_H
115#define pointToFace_H
116
117#include "topoSetFaceSource.H"
118#include "Enum.H"
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122namespace Foam
123{
124
125/*---------------------------------------------------------------------------*\
126 Class pointToFace Declaration
127\*---------------------------------------------------------------------------*/
128
129class pointToFace
130:
131 public topoSetFaceSource
132{
133
134public:
135
136 //- Enumeration defining the valid options
137 enum pointAction
138 {
139 ANY,
140 ALL,
141 EDGE
142 };
143
144
145private:
146
149
150 static const Enum<pointAction> pointActionNames_;
151
152 //- Names of sets to use
153 wordList names_;
154
155 //- Option
156 pointAction option_;
157
158
159 // Private Member Functions
160
161 //- Depending on face to cell option add to or delete from faceSet.
162 void combine(topoSet& set, const bool add, const word& setName) const;
163
164
165public:
166
167 //- Runtime type information
168 TypeName("pointToFace");
169
170
171 // Constructors
172
173 //- Construct from components
175 (
177 const word& setName,
178 const pointAction option
179 );
180
181 //- Construct from dictionary
182 pointToFace(const polyMesh& mesh, const dictionary& dict);
183
184 //- Construct from Istream
185 pointToFace(const polyMesh& mesh, Istream& is);
188 //- Destructor
189 virtual ~pointToFace() = default;
190
191
192 // Member Functions
193
194 virtual void applyToSet
195 (
196 const topoSetSource::setAction action,
197 topoSet& set
198 ) const;
199};
200
201
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204} // End namespace Foam
205
206// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207
208#endif
209
210// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A topoSetFaceSource to select faces with any point or any edge within a given pointSet(s).
Definition: pointToFace.H:179
pointAction
Enumeration defining the valid options.
Definition: pointToFace.H:185
TypeName("pointToFace")
Runtime type information.
virtual ~pointToFace()=default
Destructor.
pointToFace(const polyMesh &mesh, const word &setName, const pointAction option)
Construct from components.
Definition: pointToFace.C:166
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: pointToFace.C:212
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
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:67
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
List< word > wordList
A List of words.
Definition: fileName.H:63
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73