labelToPoint.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-2015 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::labelToPoint
29
30Description
31 A \c topoSetPointSource to select points
32 based on explicitly given point labels.
33
34 Operands:
35 \table
36 Operand | Type | Location
37 output | pointSet | $FOAM_CASE/constant/polyMesh/sets/<set>
38 \endtable
39
40Usage
41 Minimal example by using \c system/topoSetDict.actions:
42 \verbatim
43 {
44 // Mandatory (inherited) entries
45 name <name>;
46 type pointSet;
47 action <action>;
48
49 // Mandatory entries
50 source labelToPoint;
51 value
52 (
53 <pointLabel1>
54 <pointLabel2>
55 ...
56 );
57 }
58 \endverbatim
59
60 where the entries mean:
61 \table
62 Property | Description | Type | Req'd | Dflt
63 name | Name of pointSet | word | yes | -
64 type | Type name: pointSet | word | yes | -
65 action | Action applied on points - see below | word | yes | -
66 source | Source name: labelToPoint | word | yes | -
67 value | Input point labels | labelList | yes | -
68 \endtable
69
70 Options for the \c action entry:
71 \verbatim
72 new | Create a new pointSet from selected points
73 add | Add selected points into this pointSet
74 subtract | Remove selected points from this pointSet
75 \endverbatim
76
77See also
78 - Foam::topoSetSource
79 - Foam::topoSetPointSource
80
81SourceFiles
82 labelToPoint.C
83
84\*---------------------------------------------------------------------------*/
85
86#ifndef labelToPoint_H
87#define labelToPoint_H
88
89#include "topoSetPointSource.H"
90
91// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92
93namespace Foam
94{
95
96/*---------------------------------------------------------------------------*\
97 Class labelToPoint Declaration
98\*---------------------------------------------------------------------------*/
99
100class labelToPoint
101:
102 public topoSetPointSource
103{
104 // Private Data
105
106 //- Add usage string
107 static addToUsageTable usage_;
108
109 //- Point labels read from dictionary
110 labelList labels_;
111
112
113public:
114
115 //- Runtime type information
116 TypeName("labelToPoint");
117
118
119 // Constructors
120
121 //- Construct from components, copying labels
122 labelToPoint(const polyMesh& mesh, const labelList& labels);
123
124 //- Construct from components, moving labels
125 labelToPoint(const polyMesh& mesh, labelList&& labels);
126
127 //- Construct from dictionary
128 labelToPoint(const polyMesh& mesh, const dictionary& dict);
129
130 //- Construct from Istream
131 labelToPoint(const polyMesh& mesh, Istream& is);
132
133
134 //- Destructor
135 virtual ~labelToPoint() = default;
136
137
138 // Member Functions
139
140 virtual void applyToSet
141 (
142 const topoSetSource::setAction action,
144 ) const;
145};
146
147
148// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149
150} // End namespace Foam
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154#endif
155
156// ************************************************************************* //
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 points based on explicitly given point labels.
Definition: labelToPoint.H:146
labelToPoint(const polyMesh &mesh, const labelList &labels)
Construct from components, copying labels.
Definition: labelToPoint.C:70
TypeName("labelToPoint")
Runtime type information.
virtual ~labelToPoint()=default
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: labelToPoint.C:117
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
The topoSetPointSource is a intermediate class for handling topoSet sources for selecting points.
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:67
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73