cylinderAnnulusToCell.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) 2011 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::cylinderAnnulusToCell
29 
30 Description
31  A topoSetCellSource to select cells based on cell 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  cylinderAnnulusToCell.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef cylinderAnnulusToCell_H
49 #define cylinderAnnulusToCell_H
50 
51 #include "topoSetCellSource.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class cylinderAnnulusToCell Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class cylinderAnnulusToCell
63 :
64  public topoSetCellSource
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("cylinderAnnulusToCell");
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 ~cylinderAnnulusToCell() = 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 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
Foam::combine
Definition: FaceCellWave.C:56
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::cylinderAnnulusToCell::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: cylinderAnnulusToCell.C:161
Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
cylinderAnnulusToCell(const polyMesh &mesh, const point &point1, const point &point2, const scalar radius, const scalar innerRadius=0)
Construct from components.
Definition: cylinderAnnulusToCell.C:111
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:66
topoSetCellSource.H
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::cylinderAnnulusToCell
A topoSetCellSource to select cells based on cell centres inside a cylinder annulus.
Definition: cylinderAnnulusToCell.H:86
Foam::cylinderAnnulusToCell::~cylinderAnnulusToCell
virtual ~cylinderAnnulusToCell()=default
Destructor.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Vector< scalar >
Foam::topoSetCellSource
Base class of a topoSet source for selecting cells.
Definition: topoSetCellSource.H:50
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::cylinderAnnulusToCell::TypeName
TypeName("cylinderAnnulusToCell")
Runtime type information.