cylinderAnnulusToFace.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::cylinderAnnulusToFace
29 
30 Description
31  A topoSetFaceSource to select faces based on face centres inside a
32  cylinder annulus.
33 
34  \heading Dictionary parameters
35  \table
36  Property | Description | Required | Default
37  p1 | Coordinate of endpoint | yes |
38  p2 | Coordinate of endpoint | yes |
39  outerRadius | Cylinder outer radius | yes |
40  innerRadius | Cylinder inner radius | yes |
41  \endtable
42 
43 SourceFiles
44  cylinderAnnulusToFace.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef cylinderAnnulusToFace_H
49 #define cylinderAnnulusToFace_H
50 
51 #include "topoSetFaceSource.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class cylinderAnnulusToFace Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class cylinderAnnulusToFace
63 :
64  public topoSetFaceSource
65 {
66 
67  // Private data
68 
69  //- Add usage string
70  static addToUsageTable usage_;
71 
72  //- First point on cylinder axis
73  point point1_;
74 
75  //- Second point on cylinder axis
76  point point2_;
77 
78  //- Outer radius
79  scalar radius_;
80 
81  //- Inner radius
82  scalar innerRadius_;
83 
84 
85  // Private Member Functions
86 
87  void combine(topoSet& set, const bool add) const;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("cylinderAnnulusToFace");
94 
95 
96  // Constructors
97 
98  //- Construct from components
100  (
101  const polyMesh& mesh,
102  const point& point1,
103  const point& point2,
104  const scalar radius,
105  const scalar innerRadius = 0
106  );
107 
108  //- Construct from dictionary
110 
111  //- Construct from Istream
113 
114 
115  //- Destructor
116  virtual ~cylinderAnnulusToFace() = default;
117 
118 
119  // Member Functions
120 
121  virtual void applyToSet
122  (
123  const topoSetSource::setAction action,
124  topoSet&
125  ) const;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::combine
Definition: FaceCellWave.C:56
Foam::cylinderAnnulusToFace
A topoSetFaceSource to select faces based on face centres inside a cylinder annulus.
Definition: cylinderAnnulusToFace.H:86
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::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::cylinderAnnulusToFace::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Apply specified action to the topoSet.
Definition: cylinderAnnulusToFace.C:161
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::cylinderAnnulusToFace::~cylinderAnnulusToFace
virtual ~cylinderAnnulusToFace()=default
Destructor.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Vector< scalar >
topoSetFaceSource.H
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::cylinderAnnulusToFace::TypeName
TypeName("cylinderAnnulusToFace")
Runtime type information.
Foam::cylinderAnnulusToFace::cylinderAnnulusToFace
cylinderAnnulusToFace(const polyMesh &mesh, const point &point1, const point &point2, const scalar radius, const scalar innerRadius=0)
Construct from components.
Definition: cylinderAnnulusToFace.C:111