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