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