cylinderToFace.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) 2017 OpenFOAM Foundation
9  Copyright (C) 2018 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::cylinderToFace
29 
30 Description
31  A topoSetFaceSource to select faces based on face centres inside a cylinder.
32 
33  \heading Dictionary parameters
34  \table
35  Property | Description | Required | Default
36  p1 | Coordinate of endpoint | yes |
37  p2 | Coordinate of endpoint | yes |
38  radius | Cylinder (outer) radius | yes |
39  innerRadius | Cylinder inner radius | no | 0
40  \endtable
41 
42 SourceFiles
43  cylinderToFace.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef cylinderToFace_H
48 #define cylinderToFace_H
49 
50 #include "topoSetFaceSource.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class cylinderToFace Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class cylinderToFace
62 :
63  public topoSetFaceSource
64 {
65 
66  // Private data
67 
68  //- Add usage string
69  static addToUsageTable usage_;
70 
71  //- First point on cylinder axis
72  point point1_;
73 
74  //- Second point on cylinder axis
75  point point2_;
76 
77  //- Outer radius
78  scalar radius_;
79 
80  //- Inner radius
81  scalar innerRadius_;
82 
83 
84  // Private Member Functions
85 
86  void combine(topoSet& set, const bool add) const;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("cylinderToFace");
93 
94 
95  // Constructors
96 
97  //- Construct from components
99  (
100  const polyMesh& mesh,
101  const point& point1,
102  const point& point2,
103  const scalar radius,
104  const scalar innerRadius = 0
105  );
106 
107  //- Construct from dictionary
108  cylinderToFace(const polyMesh& mesh, const dictionary& dict);
109 
110  //- Construct from Istream
111  cylinderToFace(const polyMesh& mesh, Istream& is);
112 
113 
114  //- Destructor
115  virtual ~cylinderToFace() = 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::combine
Definition: FaceCellWave.C:56
Foam::cylinderToFace
A topoSetFaceSource to select faces based on face centres inside a cylinder.
Definition: cylinderToFace.H:85
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:99
Foam::cylinderToFace::TypeName
TypeName("cylinderToFace")
Runtime type information.
Foam::topoSetFaceSource
Base class of a topoSet source for selecting faces.
Definition: topoSetFaceSource.H:50
Foam::cylinderToFace::cylinderToFace
cylinderToFace(const polyMesh &mesh, const point &point1, const point &point2, const scalar radius, const scalar innerRadius=0)
Construct from components.
Definition: cylinderToFace.C:100
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::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::cylinderToFace::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: cylinderToFace.C:150
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:66
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cylinderToFace::~cylinderToFace
virtual ~cylinderToFace()=default
Destructor.
Foam::Vector< scalar >
topoSetFaceSource.H
Foam::point
vector point
Point is a vector.
Definition: point.H:43