The open source CFD toolbox
setAndNormalToFaceZone.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) 2013 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::setAndNormalToFaceZone
29
30Description
31 A \c topoSetSource to select faces based on usage in a \c faceSet,
32 where the normal vector is used to orient the faces.
33
34 Operands:
35 \table
36 Operand | Type | Location
37 input | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set> 38 output | faceZone |$FOAM_CASE/constant/polyMesh/faceZones
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 faceZoneSet;
48 action <action>;
49
50 // Mandatory entries
51 source setAndNormalToFaceZone;
52 faceSet <faceSetName>;
53 normal (1 0 0);
54 }
55 \endverbatim
56
57 where the entries mean:
58 \table
59 Property | Description | Type | Req'd | Dflt
60 name | Name of faceZoneSet | word | yes | -
61 type | Type name: faceZoneSet | word | yes | -
62 action | Action applied on faces - see below | word | yes | -
63 source | Source name: setAndNormalToFaceZone | word | yes | -
64 faceSet | Name of input faceSet | word | yes | -
65 normal | The normal vector for orientation | vector | yes | -
66 \endtable
67
68 Options for the \c action entry:
69 \verbatim
70 new | Create a new faceZoneSet from selected faces
72 subtract | Remove selected faces from this faceZoneSet
73 \endverbatim
74
75SourceFiles
76 setAndNormalToFaceZone.C
77
78\*---------------------------------------------------------------------------*/
79
80#ifndef setAndNormalToFaceZone_H
81#define setAndNormalToFaceZone_H
82
84
85// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86
87namespace Foam
88{
89
90/*---------------------------------------------------------------------------*\
91 Class setAndNormalToFaceZone Declaration
92\*---------------------------------------------------------------------------*/
93
94class setAndNormalToFaceZone
95:
96 public topoSetFaceZoneSource
97{
98 // Private Data
99
102
103 //- Name of set to use
104 word setName_;
105
106 //- Normal used to orient the faces
107 vector normal_;
108
109
110public:
111
112 //- Runtime type information
113 TypeName("setAndNormalToFaceZone");
114
115 // Constructors
116
117 //- Construct from components
119 (
120 const polyMesh& mesh,
121 const word& setName,
122 const vector& normal
123 );
124
125 //- Construct from dictionary
126 setAndNormalToFaceZone(const polyMesh& mesh, const dictionary& dict);
127
128 //- Construct from Istream
129 setAndNormalToFaceZone(const polyMesh& mesh, Istream& is);
130
131
132 //- Destructor
133 virtual ~setAndNormalToFaceZone() = default;
134
135
136 // Member Functions
137
138 virtual void applyToSet
139 (
140 const topoSetSource::setAction action,
141 topoSet& set
142 ) const;
143};
144
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148} // End namespace Foam
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152#endif
153
154// ************************************************************************* //
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
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A topoSetSource to select faces based on usage in a faceSet, where the normal vector is used to orien...
TypeName("setAndNormalToFaceZone")
Runtime type information.
setAndNormalToFaceZone(const polyMesh &mesh, const word &setName, const vector &normal)
Construct from components.
virtual ~setAndNormalToFaceZone()=default
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
The topoSetFaceZoneSource is a intermediate class for handling topoSet sources for selecting face zon...
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
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73