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-2020 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 searchableSurfaceToFaceZone_H
87 #define searchableSurfaceToFaceZone_H
88 
89 #include "topoSetSource.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96 class searchableSurface;
97 
98 /*---------------------------------------------------------------------------*\
99  Class searchableSurfaceToFaceZone Declaration
100 \*---------------------------------------------------------------------------*/
101 
102 class searchableSurfaceToFaceZone
103 :
104  public topoSetSource
105 {
106  // Private Data
107 
108  //- Add usage string
109  static addToUsageTable usage_;
110 
111  //- Surface
112  autoPtr<searchableSurface> surfacePtr_;
113 
114 
115 protected:
116 
117  // Protected Member Functions
118 
119  //- Retrieve surface name from dictionary entry
120  static word getSurfaceName
121  (
122  const dictionary& dict,
123  const word& defaultName
124  );
125 
126 
127 public:
128 
129  //- Runtime type information
130  TypeName("searchableSurfaceToFaceZone");
131 
132 
133  // Constructors
134 
135  //- Construct surface-type from dictionary
137  (
138  const word& surfaceType,
139  const polyMesh& mesh,
140  const dictionary& dict
141  );
142 
143 
144  //- Construct from dictionary
146  (
147  const polyMesh& mesh,
148  const dictionary& dict
149  );
150 
151 
152  //- Destructor
153  virtual ~searchableSurfaceToFaceZone() = default;
154 
155 
156  // Member Functions
157 
158  //- The source category is a faceZone
160  {
161  return FACEZONE_SOURCE;
162  }
163 
164  virtual void applyToSet
165  (
166  const topoSetSource::setAction action,
167  topoSet& set
168  ) const;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
Foam::searchableSurfaceToFaceZone::searchableSurfaceToFaceZone
searchableSurfaceToFaceZone(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
Definition: searchableSurfaceToFaceZone.C:89
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::searchableSurfaceToFaceZone::setType
virtual topoSetSource::sourceType setType() const
The source category is a faceZone.
Definition: searchableSurfaceToFaceZone.H:216
Foam::topoSetSource::addToUsageTable
Class with constructor to add usage string to table.
Definition: topoSetSource.H:124
Foam::searchableSurfaceToFaceZone::TypeName
TypeName("searchableSurfaceToFaceZone")
Runtime type information.
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:99
Foam::topoSetSource::mesh
const polyMesh & mesh() const
Reference to the mesh.
Definition: topoSetSource.H:333
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::searchableSurfaceToFaceZone::~searchableSurfaceToFaceZone
virtual ~searchableSurfaceToFaceZone()=default
Destructor.
Foam::searchableSurfaceToFaceZone::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: searchableSurfaceToFaceZone.C:134
Foam::searchableSurfaceToFaceZone::getSurfaceName
static word getSurfaceName(const dictionary &dict, const word &defaultName)
Retrieve surface name from dictionary entry.
Definition: searchableSurfaceToFaceZone.C:63
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:63
Foam::defaultName
static const word defaultName("coeffs")
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::topoSetSource
Base class of a source for a topoSet.
Definition: topoSetSource.H:66
Foam::searchableSurfaceToFaceZone
A topoSetSource to select all faces whose cell-cell centre vector intersects with a given searchableS...
Definition: searchableSurfaceToFaceZone.H:159
Foam::topoSetSource::FACEZONE_SOURCE
Faces as zone.
Definition: topoSetSource.H:87
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
topoSetSource.H