Loading...
Searching...
No Matches
clipPlaneToPoint.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) 2022 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::clipPlaneToPoint
28
29Description
30 A \c topoSetPointSource to select all points
31 above the specified plane
32
33 Operands:
34 \table
35 Operand | Type | Location
36 output | pointSet | $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 pointSet;
46 action <action>;
47
48 // Mandatory entries
49 source clipPlaneToPoint;
50
51 point (x y z);
52 normal (x y z);
53 }
54 \endverbatim
55
56 where the entries mean:
57 \table
58 Property | Description | Type | Req'd | Dflt
59 name | Name of pointSet | word | yes | -
60 type | Type name: pointSet | word | yes | -
61 action | Action applied on points - see below| word | yes | -
62 source | Source name: clipPlaneToPoint | word | yes | -
63 \endtable
64
65 Options for the \c action entry:
66 \verbatim
67 new | Create a new pointSet from selected points
68 add | Add selected points into this pointSet
69 subtract | Remove selected cells from this pointSet
70 \endverbatim
71
72 Options for the conditional mandatory entries:
73 \verbatim
74 Entry | Description | Type | Req'd | Dflt
75 point | The reference point for the plane | vector | yes | -
76 normal | The unit normal of the plane | vector | yes | -
77 \endverbatim
78
79See also
80 - Foam::topoSetSource
81 - Foam::topoSetPointSource
82
83SourceFiles
84 clipPlaneToPoint.C
85
86\*---------------------------------------------------------------------------*/
87
88#ifndef Foam_clipPlaneToPoint_H
89#define Foam_clipPlaneToPoint_H
90
91#include "topoSetPointSource.H"
92#include "point.H"
93
94// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95
96namespace Foam
97{
98
99/*---------------------------------------------------------------------------*\
100 Class clipPlaneToPoint Declaration
101\*---------------------------------------------------------------------------*/
102
104:
105 public topoSetPointSource
106{
107 // Private Data
108
109 //- Add usage string
110 static addToUsageTable usage_;
111
112 //- Point on the plane
113 const vector point_;
114
115 //- Normal to the plane
116 const vector normal_;
117
118
119 // Private Member Functions
120
121 void combine(topoSet& set, const bool add) const;
122
123
124public:
125
126 //- Runtime type information
127 TypeName("clipPlaneToPoint");
128
129
130 // Constructors
131
132 //- No default construct
133 clipPlaneToPoint() = delete;
134
135 //- Construct from components
137 (
138 const polyMesh& mesh,
139 const point& basePoint,
140 const vector& normal
141 );
142
143 //- Construct from dictionary
145
146 //- Construct from stream - a single box.
148
149
150 //- Destructor
151 virtual ~clipPlaneToPoint() = default;
152
153
154 // Member Functions
155
156 virtual void applyToSet
157 (
158 const topoSetSource::setAction action,
159 topoSet& set
160 ) const;
161};
162
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166} // End namespace Foam
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170#endif
171
172// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
A topoSetPointSource to select all points above the specified plane.
TypeName("clipPlaneToPoint")
Runtime type information.
clipPlaneToPoint()=delete
No default construct.
virtual ~clipPlaneToPoint()=default
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
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
Namespace for OpenFOAM.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
vector point
Point is a vector.
Definition point.H:37
Vector< scalar > vector
Definition vector.H:57
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68