searchableSurfaceToFaceZone.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 OpenFOAM Foundation
9  Copyright (C) 2018-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::searchableSurfaceToFaceZone
29 
30 Description
31  A \c topoSetSource to select all faces whose cell-cell centre vector
32  intersects with a given \c searchableSurface.
33 
34  Operands:
35  \table
36  Operand | Type | Location
37  input | triSurface | $FOAM_CASE/constant/triSurface/<file>
38  output 1 | faceSet | $FOAM_CASE/constant/polyMesh/sets/<set>
39  output 2 | faceZone | $FOAM_CASE/constant/polyMesh/faceZones
40  \endtable
41 
42 Usage
43  Minimal example by using \c system/topoSetDict.actions:
44  \verbatim
45  {
46  // Mandatory (inherited) entries
47  name <name>;
48  type faceZoneSet;
49  action <action>;
50 
51  // Mandatory entries
52  source searchableSurfaceToFaceZone;
53  surfaceType <surfaceTypeName>;
54 
55  // Optional entries
56  surfaceName <surfaceName>;
57  }
58  \endverbatim
59 
60  where the entries mean:
61  \table
62  Property | Description | Type | Req'd | Dflt
63  name | Name of faceZone | word | yes | -
64  type | Type name: faceZone | word | yes | -
65  action | Action applied on faces - see below | word | yes | -
66  source | Source name: searchableSurfaceToFaceZone | word | yes | -
67  surfaceType | The searchable surface type | word | yes | -
68  surfaceName | Name for the IOobject | word | no | mesh-name
69  \endtable
70 
71  Options for the \c action entry:
72  \verbatim
73  new | Create a new faceZone from selected faces
74  add | Add selected faces into this faceZone
75  subtract | Remove selected faces from this faceZone
76  \endverbatim
77 
78 See also
79  - Foam::topoSetSource
80 
81 SourceFiles
82  searchableSurfaceToFaceZone.C
83 
84 \*---------------------------------------------------------------------------*/
85 
86 #ifndef Foam_searchableSurfaceToFaceZone_H
87 #define Foam_searchableSurfaceToFaceZone_H
88 
89 #include "topoSetFaceZoneSource.H"
90 #include "searchableSurface.H"
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
94 namespace Foam
95 {
96 
97 /*---------------------------------------------------------------------------*\
98  Class searchableSurfaceToFaceZone Declaration
99 \*---------------------------------------------------------------------------*/
100 
101 class searchableSurfaceToFaceZone
102 :
103  public topoSetFaceZoneSource
104 {
105  // Private Data
106 
107  //- Add usage string
108  static addToUsageTable usage_;
109 
110  //- Surface
111  autoPtr<searchableSurface> surfacePtr_;
112 
113 
114 public:
115 
116  //- Runtime type information
117  TypeName("searchableSurfaceToFaceZone");
118 
119 
120  // Constructors
121 
122  //- Construct surface-type from dictionary
124  (
125  const word& surfaceType,
126  const polyMesh& mesh,
127  const dictionary& dict
128  );
129 
130  //- Construct from dictionary
132  (
133  const polyMesh& mesh,
134  const dictionary& dict
135  );
136 
137 
138  //- Destructor
139  virtual ~searchableSurfaceToFaceZone() = default;
140 
141 
142  // Member Functions
143 
144  virtual void applyToSet
145  (
146  const topoSetSource::setAction action,
147  topoSet& set
148  ) const;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
dictionary dict
TypeName("searchableSurfaceToFaceZone")
Runtime type information.
searchableSurfaceToFaceZone(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
const polyMesh & mesh() const noexcept
Reference to the mesh.
setAction
Enumeration defining various actions.
virtual ~searchableSurfaceToFaceZone()=default
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Namespace for OpenFOAM.