faceToPoint.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::faceToPoint
29
30Description
31 A \c topoSetPointSource to select all
32 points based on usage in given \c faceSet(s).
33
34 Operands:
35 \table
36 Operand | Type | Location
37 input | faceSet(s) | $FOAM_CASE/constant/polyMesh/sets/<set>
38 output | pointSet | $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 pointSet;
48 action <action>;
49
50 // Mandatory entries
51 source faceToPoint;
52 option <option>;
53
54 // Conditional mandatory entries
55 // Select either of the below
56
57 // Option-1
58 sets
59 (
60 <faceSetName0>
61 <faceSetName1>
62 ...
63 );
64
65 // Option-2
66 set <faceSetName>;
67 }
68 \endverbatim
69
70 where the entries mean:
71 \table
72 Property | Description | Type | Req'd | Dflt
73 name | Name of pointSet | word | yes | -
74 type | Type name: pointSet | word | yes | -
75 action | Action applied on points - see below | word | yes | -
76 source | Source name: faceToPoint | 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 pointSet from selected points
83 add | Add selected points into this pointSet
84 subtract | Remove selected points from this pointSet
85 \endverbatim
86
87 Options for the \c option entry:
88 \verbatim
89 all | Select all points of faces in the faceSet
90 \endverbatim
91
92 Options for the conditional mandatory entries:
93 \verbatim
94 Entry | Description | Type | Req'd | Dflt
95 sets | Names of input faceSets | wordList | cond'l | -
96 set | Name of input faceSet | word | cond'l | -
97 \endverbatim
98
99Note
100 The order of precedence among the conditional mandatory entries from the
101 highest to the lowest is \c sets, and \c set.
102
103See also
104 - Foam::topoSetSource
105 - Foam::topoSetPointSource
106
107SourceFiles
108 faceToPoint.C
109
110\*---------------------------------------------------------------------------*/
111
112#ifndef faceToPoint_H
113#define faceToPoint_H
114
115#include "topoSetPointSource.H"
116#include "Enum.H"
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120namespace Foam
121{
122
123/*---------------------------------------------------------------------------*\
124 Class faceToPoint Declaration
125\*---------------------------------------------------------------------------*/
126
127class faceToPoint
128:
129 public topoSetPointSource
130{
131
132public:
133 //- Enumeration defining the valid options
134 enum faceAction
135 {
136 ALL
137 };
138
139
140private:
141
142 // Private Data
143
144 //- Add usage string
145 static addToUsageTable usage_;
146
147 static const Enum<faceAction> faceActionNames_;
148
149 //- Names of sets to use
150 wordList names_;
151
152 //- Option
153 faceAction option_;
154
155
156 // Private Member Functions
157
158 void combine(topoSet& set, const bool add, const word& setName) const;
159
160
161public:
162
163 //- Runtime type information
164 TypeName("faceToPoint");
165
166
167 // Constructors
168
169 //- Construct from components
171 (
172 const polyMesh& mesh,
173 const word& setName,
174 const faceAction option
175 );
176
177 //- Construct from dictionary
178 faceToPoint(const polyMesh& mesh, const dictionary& dict);
179
180 //- Construct from Istream
182
183
184 //- Destructor
185 virtual ~faceToPoint() = default;
186
187
188 // Member Functions
189
190 virtual void applyToSet
191 (
192 const topoSetSource::setAction action,
193 topoSet& set
194 ) const;
195};
196
197
198// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199
200} // End namespace Foam
201
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204#endif
205
206// ************************************************************************* //
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 topoSetPointSource to select all points based on usage in given faceSet(s).
Definition: faceToPoint.H:177
virtual ~faceToPoint()=default
Destructor.
faceToPoint(const polyMesh &mesh, const word &setName, const faceAction option)
Construct from components.
Definition: faceToPoint.C:88
TypeName("faceToPoint")
Runtime type information.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: faceToPoint.C:134
faceAction
Enumeration defining the valid options.
Definition: faceToPoint.H:182
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
The topoSetPointSource is a intermediate class for handling topoSet sources for selecting points.
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