Loading...
Searching...
No Matches
patchToPoint.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) 2024 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::patchToPoint
28
29Description
30 A \c topoSetPointSource to select points associated with given patch(es).
31
32 Operands:
33 \table
34 Operand | Type | Location
35 output | pointSet | $FOAM_CASE/constant/polyMesh/sets/<set>
36 \endtable
37
38Usage
39 Minimal example by using \c system/topoSetDict.actions:
40 \verbatim
41 {
42 // Mandatory (inherited) entries
43 name <name>;
44 type pointSet;
45 action <action>;
46
47 // Mandatory entries
48 source patchToPoint;
49
50 // Conditional mandatory entries
51 // Select either of the below
52
53 // Option-1
54 patches
55 (
56 <patchName1>
57 <patchName2>
58 ...
59 );
60
61 // Option-2
62 patch <patchName>;
63 }
64 \endverbatim
65
66 where the entries mean:
67 \table
68 Property | Description | Type | Req'd | Dflt
69 name | Name of pointSet | word | yes | -
70 type | Type name: pointSet | word | yes | -
71 action | Action applied on points - see below | word | yes | -
72 source | Source name: patchToPoint | word | yes | -
73 \endtable
74
75 Options for the \c action entry:
76 \verbatim
77 new | Create a new pointSet from selected points
78 add | Add selected points into this pointSet
79 subtract | Remove selected points from this pointSet
80 \endverbatim
81
82 Options for the conditional mandatory entries:
83 \verbatim
84 Entry | Description | Type | Req'd | Dflt
85 patches | Names of patches | wordList | cond'l | -
86 patch | Name of patch | word | cond'l | -
87 \endverbatim
88
89Note
90 The order of precedence among the conditional mandatory entries from the
91 highest to the lowest is \c patches, and \c patch.
92
93See also
94 - Foam::patchToFace
95
96SourceFiles
97 patchToPoint.C
98
99\*---------------------------------------------------------------------------*/
100
101#ifndef patchToPoint_H
102#define patchToPoint_H
103
104#include "topoSetPointSource.H"
105#include "wordRes.H"
106
107// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108
109namespace Foam
110{
111
112/*---------------------------------------------------------------------------*\
113 Class patchToPoint Declaration
114\*---------------------------------------------------------------------------*/
115
116class patchToPoint
117:
118 public topoSetPointSource
119{
120 // Private Data
121
122 //- Add usage string
123 static addToUsageTable usage_;
124
125 //- Matcher for patches
126 wordRes selectedPatches_;
127
128
129 // Private Member Functions
130
131 void combine(topoSet& set, const bool add) const;
132
133
134public:
135
136 //- Runtime type information
137 TypeName("patchToPoint");
138
139
140 // Constructors
141
142 //- Construct from components
143 patchToPoint(const polyMesh& mesh, const wordRe& patchName);
144
145 //- Construct from dictionary
146 patchToPoint(const polyMesh& mesh, const dictionary& dict);
147
148 //- Construct from Istream
150
151
152 //- Destructor
153 virtual ~patchToPoint() = default;
154
155
156 // Member Functions
157
158 virtual void applyToSet
159 (
160 const topoSetSource::setAction action,
161 topoSet& set
162 ) const;
163};
164
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168} // End namespace Foam
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172#endif
173
174// ************************************************************************* //
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 topoSetPointSource to select points associated with given patch(es).
virtual ~patchToPoint()=default
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
TypeName("patchToPoint")
Runtime type information.
patchToPoint(const polyMesh &mesh, const wordRe &patchName)
Construct from components.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
The topoSetPointSource is a intermediate class for handling topoSet sources for selecting points.
topoSetPointSource(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