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-2019 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 topoSetSource to select faces based on intersection (of cell-cell
32  vector) with a surface.
33 
34  \heading Dictionary parameters
35  \table
36  Property | Description | Required | Default
37  surfaceType | The searchable surface type | yes |
38  surfaceName | Name for the IOobject | no | mesh-name
39  surface | Same as 'surfaceType' | no |
40  name | Older specification for 'surfaceName' | no |
41  \endtable
42 
43 SourceFiles
44  searchableSurfaceToFaceZone.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef searchableSurfaceToFaceZone_H
49 #define searchableSurfaceToFaceZone_H
50 
51 #include "topoSetSource.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 class searchableSurface;
59 
60 /*---------------------------------------------------------------------------*\
61  Class searchableSurfaceToFaceZone Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class searchableSurfaceToFaceZone
65 :
66  public topoSetSource
67 {
68  // Private data
69 
70  //- Add usage string
71  static addToUsageTable usage_;
72 
73  //- Surface
74  autoPtr<searchableSurface> surfacePtr_;
75 
76 
77 protected:
78 
79  // Protected Member Functions
80 
81  //- Retrieve surface name from dictionary entry
82  static word getSurfaceName
83  (
84  const dictionary& dict,
85  const word& defaultName
86  );
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("searchableSurfaceToFaceZone");
93 
94  // Constructors
95 
96  //- Construct surface-type from dictionary
98  (
99  const word& surfaceType,
100  const polyMesh& mesh,
101  const dictionary& dict
102  );
103 
104 
105  //- Construct from dictionary
107  (
108  const polyMesh& mesh,
109  const dictionary& dict
110  );
111 
112 
113  //- Destructor
114  virtual ~searchableSurfaceToFaceZone() = default;
115 
116 
117  // Member Functions
118 
119  //- The source category is a faceZone
120  virtual topoSetSource::sourceType setType() const
121  {
122  return FACEZONE_SOURCE;
123  }
124 
125  virtual void applyToSet
126  (
127  const topoSetSource::setAction action,
128  topoSet& set
129  ) const;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
Foam::searchableSurfaceToFaceZone::searchableSurfaceToFaceZone
searchableSurfaceToFaceZone(const word &surfaceType, const polyMesh &mesh, const dictionary &dict)
Construct surface-type from dictionary.
Definition: searchableSurfaceToFaceZone.C:89
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::searchableSurfaceToFaceZone::setType
virtual topoSetSource::sourceType setType() const
The source category is a faceZone.
Definition: searchableSurfaceToFaceZone.H:144
Foam::topoSetSource::addToUsageTable
Class with constructor to add usage string to table.
Definition: topoSetSource.H:124
Foam::searchableSurfaceToFaceZone::TypeName
TypeName("searchableSurfaceToFaceZone")
Runtime type information.
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::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:134
Foam::searchableSurfaceToFaceZone::getSurfaceName
static word getSurfaceName(const dictionary &dict, const word &defaultName)
Retrieve surface name from dictionary entry.
Definition: searchableSurfaceToFaceZone.C:63
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::topoSetSource
Base class of a source for a topoSet.
Definition: topoSetSource.H:66
Foam::searchableSurfaceToFaceZone
A topoSetSource to select faces based on intersection (of cell-cell vector) with a surface.
Definition: searchableSurfaceToFaceZone.H:88
Foam::topoSetSource::FACEZONE_SOURCE
Faces as zone.
Definition: topoSetSource.H:87
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
topoSetSource.H