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 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 topoSetPointSource to select mesh points within a searchableSurface.
31 
32  \heading Dictionary parameters
33  \table
34  Property | Description | Required | Default
35  surfaceType | The searchable surface type | yes |
36  surfaceName | Name for the IOobject | no | mesh-name
37  surface | Same as 'surfaceType' | no |
38  \endtable
39 
40 SourceFiles
41  searchableSurfaceToPoint.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef searchableSurfaceToPoint_H
46 #define searchableSurfaceToPoint_H
47 
48 #include "topoSetPointSource.H"
49 #include "searchableSurface.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class searchableSurfaceToPoint Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class searchableSurfaceToPoint
61 :
62  public topoSetPointSource
63 {
64  // Private Data
65 
66  //- Add usage string
67  static addToUsageTable usage_;
68 
69  //- The searchableSurface
70  autoPtr<searchableSurface> surf_;
71 
72 
73  // Private Member Functions
74 
75  void combine(topoSet& set, const bool add) const;
76 
77 
78 protected:
79 
80  // Protected Member Functions
81 
82  //- Retrieve surface name from dictionary entry
83  static word getSurfaceName
84  (
85  const dictionary& dict,
86  const word& defaultName
87  );
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("searchableSurfaceToPoint");
94 
95 
96  // Constructors
97 
98  //- Construct surface-type from dictionary
100  (
101  const word& surfaceType,
102  const polyMesh& mesh,
103  const dictionary& dict
104  );
105 
106  //- Construct from dictionary
108  (
109  const polyMesh& mesh,
110  const dictionary& dict
111  );
112 
113 
114  //- Destructor
115  virtual ~searchableSurfaceToPoint() = default;
116 
117 
118  // Member Functions
119 
120  virtual void applyToSet
121  (
122  const topoSetSource::setAction action,
123  topoSet& set
124  ) const;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
searchableSurface.H
Foam::combine
Definition: FaceCellWave.C:56
Foam::topoSetSource::addToUsageTable
Class with constructor to add usage string to table.
Definition: topoSetSource.H:124
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::searchableSurfaceToPoint
A topoSetPointSource to select mesh points within a searchableSurface.
Definition: searchableSurfaceToPoint.H:79
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:66
Foam::topoSetPointSource
Base class of a topoSet source for selecting points.
Definition: topoSetPointSource.H:50
Foam::defaultName
static const word defaultName("coeffs")
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::searchableSurfaceToPoint::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: searchableSurfaceToPoint.C:173
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::searchableSurfaceToPoint::TypeName
TypeName("searchableSurfaceToPoint")
Runtime type information.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::searchableSurfaceToPoint::~searchableSurfaceToPoint
virtual ~searchableSurfaceToPoint()=default
Destructor.
topoSetPointSource.H
Foam::searchableSurfaceToPoint::getSurfaceName
static word getSurfaceName(const dictionary &dict, const word &defaultName)
Retrieve surface name from dictionary entry.
Definition: searchableSurfaceToPoint.C:72
Foam::searchableSurfaceToPoint::searchableSurfaceToPoint
searchableSurfaceToPoint(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
Definition: searchableSurfaceToPoint.C:117