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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::searchableSurfaceToFace
28 
29 Description
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 
44 Usage
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 
80 See also
81  - Foam::topoSetSource
82  - Foam::topoSetFaceSource
83 
84 SourceFiles
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 
97 namespace Foam
98 {
99 
100 /*---------------------------------------------------------------------------*\
101  Class searchableSurfaceToFace Declaration
102 \*---------------------------------------------------------------------------*/
103 
104 class 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 
122 public:
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;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
dictionary dict
TypeName("searchableSurfaceToFace")
Runtime type information.
virtual ~searchableSurfaceToFace()=default
Destructor.
const polyMesh & mesh() const noexcept
Reference to the mesh.
setAction
Enumeration defining various actions.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:59
searchableSurfaceToFace(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
Namespace for OpenFOAM.