searchableSurfaceToFace.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) 2018-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::searchableSurfaceToFace
28
29Description
30 A \c topoSetFaceSource to select faces whose face
31 centre enclosed by a given \c searchableSurface.
32
33 The surface has to be closed - if not a warning will be given:
34 "The surface XXX appears to be unclosed ... ignoring" and the surface
35 will not be used.
36
37 Operands:
38 \table
39 Operand | Type | Location
40 input | triSurface | $FOAM_CASE/constant/triSurface/<file>
41 output | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
42 \endtable
43
44Usage
45 Minimal example by using \c system/topoSetDict.actions:
46 \verbatim
47 {
48 // Mandatory (inherited) entries
49 name <name>;
50 type faceSet;
51 action <action>;
52
53 // Mandatory entries
54 source searchableSurfaceToFace;
55 surfaceType <surfaceTypeName>;
56
57 // Optional entries
58 surfaceName <surfaceName>;
59 }
60 \endverbatim
61
62 where the entries mean:
63 \table
64 Property | Description | Type | Req'd | Dflt
65 name | Name of faceSet | word | yes | -
66 type | Type name: faceSet | word | yes | -
67 action | Action applied on faces - see below | word | yes | -
68 source | Source name: searchableSurfaceToFace | word | yes | -
69 surfaceType | The searchable surface type | word | yes | -
70 surfaceName | Name for the IOobject | word | no | mesh-name
71 \endtable
72
73 Options for the \c action entry:
74 \verbatim
75 new | Create a new faceSet from selected faces
76 add | Add selected faces into this faceSet
77 subtract | Remove selected faces from this faceSet
78 \endverbatim
79
80See also
81 - Foam::topoSetSource
82 - Foam::topoSetFaceSource
83
84SourceFiles
85 searchableSurfaceToFace.C
86
87\*---------------------------------------------------------------------------*/
88
89#ifndef Foam_searchableSurfaceToFace_H
90#define Foam_searchableSurfaceToFace_H
91
92#include "topoSetFaceSource.H"
93#include "searchableSurface.H"
94
95// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96
97namespace Foam
98{
99
100/*---------------------------------------------------------------------------*\
101 Class searchableSurfaceToFace Declaration
102\*---------------------------------------------------------------------------*/
103
104class searchableSurfaceToFace
105:
106 public topoSetFaceSource
107{
108 // Private Data
109
110 //- Add usage string
111 static addToUsageTable usage_;
112
113 //- The searchableSurface
114 autoPtr<searchableSurface> surf_;
115
116
117 // Private Member Functions
118
119 void combine(topoSet& set, const bool add) const;
120
121
122public:
123
124 //- Runtime type information
125 TypeName("searchableSurfaceToFace");
126
127
128 // Constructors
129
130 //- Construct surface-type from dictionary
132 (
133 const word& surfaceType,
134 const polyMesh& mesh,
135 const dictionary& dict
136 );
137
138 //- Construct from dictionary
140 (
141 const polyMesh& mesh,
142 const dictionary& dict
143 );
144
145
146 //- Destructor
147 virtual ~searchableSurfaceToFace() = default;
148
149
150 // Member Functions
151
152 virtual void applyToSet
153 (
154 const topoSetSource::setAction action,
155 topoSet& set
156 ) const;
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace Foam
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
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 topoSetFaceSource to select faces whose face centre enclosed by a given searchableSurface.
searchableSurfaceToFace(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
virtual ~searchableSurfaceToFace()=default
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
TypeName("searchableSurfaceToFace")
Runtime type information.
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.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73