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 "topoSetFaceZoneSource.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96 // Forward Declarations
97 class searchableSurface;
98 
99 /*---------------------------------------------------------------------------*\
100  Class searchableSurfaceToFaceZone Declaration
101 \*---------------------------------------------------------------------------*/
102 
103 class searchableSurfaceToFaceZone
104 :
105  public topoSetFaceZoneSource
106 {
107  // Private Data
108 
109  //- Add usage string
110  static addToUsageTable usage_;
111 
112  //- Surface
113  autoPtr<searchableSurface> surfacePtr_;
114 
115 
116 protected:
117 
118  // Protected Member Functions
119 
120  //- Retrieve surface name from dictionary entry
121  static word getSurfaceName
122  (
123  const dictionary& dict,
124  const word& defaultName
125  );
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("searchableSurfaceToFaceZone");
132 
133 
134  // Constructors
135 
136  //- Construct surface-type from dictionary
138  (
139  const word& surfaceType,
140  const polyMesh& mesh,
141  const dictionary& dict
142  );
143 
144 
145  //- Construct from dictionary
147  (
148  const polyMesh& mesh,
149  const dictionary& dict
150  );
151 
152 
153  //- Destructor
154  virtual ~searchableSurfaceToFaceZone() = default;
155 
156 
157  // Member Functions
158 
159  virtual void applyToSet
160  (
161  const topoSetSource::setAction action,
162  topoSet& set
163  ) const;
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
Foam::searchableSurfaceToFaceZone::searchableSurfaceToFaceZone
searchableSurfaceToFaceZone(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
Definition: searchableSurfaceToFaceZone.C:103
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Definition: BitOps.C:37
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::topoSetSource::addToUsageTable
Class with constructor to add usage string to table.
Definition: topoSetSource.H:129
Foam::topoSetFaceZoneSource
The topoSetFaceZoneSource is a intermediate class for handling topoSet sources for selecting face zon...
Definition: topoSetFaceZoneSource.H:57
Foam::searchableSurfaceToFaceZone::TypeName
TypeName("searchableSurfaceToFaceZone")
Runtime type information.
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:100
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:148
Foam::searchableSurfaceToFaceZone::getSurfaceName
static word getSurfaceName(const dictionary &dict, const word &defaultName)
Retrieve surface name from dictionary entry.
Definition: searchableSurfaceToFaceZone.C:77
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:63
dict
dictionary dict
Definition: searchingEngine.H:14
topoSetFaceZoneSource.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::searchableSurfaceToFaceZone
A topoSetSource to select all faces whose cell-cell centre vector intersects with a given searchableS...
Definition: searchableSurfaceToFaceZone.H:160
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::topoSetSource::mesh
const polyMesh & mesh() const noexcept
Reference to the mesh.
Definition: topoSetSource.H:342