regionToFace.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) 2012-2016 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::regionToFace
29
30Description
31 A \c topoSetFaceSource to select cells belonging to a topologically
32 connected region (that contains given points).
33
34 Operands:
35 \table
36 Operand | Type | Location
37 input | region | $FOAM_CASE/constant/\{<region>, polyMesh\}
38 output | faceSet | $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 faceSet;
48 action <action>;
49
50 // Mandatory entries
51 source regionToFace;
52 set <faceSetName>;
53 nearPoint <point>;
54 }
55 \endverbatim
56
57 where the entries mean:
58 \table
59 Property | Description | Type | Req'd | Dflt
60 name | Name of faceSet | word | yes | -
61 type | Type name: faceSet | word | yes | -
62 action | Action applied on faces - see below | word | yes | -
63 source | Source name: regionToFace | word | yes | -
64 set | Name of faceSet restricting search | word | yes | -
65 nearPoint | The point on/near to the region | vector | yes | -
66 \endtable
67
68 Options for the \c action entry:
69 \verbatim
70 new | Create a new faceSet from selected faces
71 add | Add selected faces into this faceSet
72 subtract | Remove selected faces from this faceSet
73 \endverbatim
74
75See also
76 - Foam::topoSetSource
77 - Foam::topoSetFaceSource
78
79SourceFiles
80 regionToFace.C
81
82\*---------------------------------------------------------------------------*/
83
84#ifndef regionToFace_H
85#define regionToFace_H
86
87#include "topoSetFaceSource.H"
89
90// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91
92namespace Foam
93{
94
95/*---------------------------------------------------------------------------*\
96 Class regionToFace Declaration
97\*---------------------------------------------------------------------------*/
98
99class regionToFace
100:
101 public topoSetFaceSource
102{
103 // Private Data
104
105 //- Add usage string
106 static addToUsageTable usage_;
107
108 //- Name of set to use
109 word setName_;
110
111 //- Coordinate that is nearest/on connected region
112 point nearPoint_;
113
114
115 // Private Member Functions
116
117 //- Walk edge-face-edge
118 void markZone
119 (
120 const indirectPrimitivePatch& patch,
121 const label proci,
122 const label facei,
123 const label zoneI,
124 labelList& faceZone
125 ) const;
126
127 void combine(topoSet& set, const bool add) const;
128
129
130public:
131
132 //- Runtime type information
133 TypeName("regionToFace");
134
135
136 // Constructors
137
138 //- Construct from components
140 (
141 const polyMesh& mesh,
142 const word& setName,
143 const point& nearPoint
144 );
145
146 //- Construct from dictionary
147 regionToFace(const polyMesh& mesh, const dictionary& dict);
148
149 //- Construct from Istream
150 regionToFace(const polyMesh& mesh, Istream& is);
151
153 //- Destructor
154 virtual ~regionToFace() = default;
155
156
157 // Member Functions
158
159 virtual void applyToSet
160 (
161 const topoSetSource::setAction action,
162 topoSet&
163 ) const;
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace Foam
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#endif
174
175// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A list of faces which address into the list of points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A subset of mesh faces organised as a primitive patch.
Definition: faceZone.H:67
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A topoSetFaceSource to select cells belonging to a topologically connected region (that contains give...
Definition: regionToFace.H:155
TypeName("regionToFace")
Runtime type information.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Apply specified action to the topoSet.
Definition: regionToFace.C:252
regionToFace(const polyMesh &mesh, const word &setName, const point &nearPoint)
Construct from components.
Definition: regionToFace.C:213
virtual ~regionToFace()=default
Destructor.
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
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 class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
vector point
Point is a vector.
Definition: point.H:43
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73