circleSet.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-2013 OpenFOAM Foundation
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::circleSet
28 
29 Description
30  Samples along a circular path
31 
32  For a dictionary specification:
33  \table
34  Property | Description | Required | Default
35  type | circle | yes |
36  axis | x, y, z, xyz, distance | yes |
37  origin | The origin of the circle | yes |
38  circleAxis | The axis of the circle | yes |
39  startPoint | Starting point of the circle | yes |
40  dTheta | Sampling increment in degrees | yes |
41  \endtable
42 
43 SourceFiles
44  circleSet.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef circleSet_H
49 #define circleSet_H
50 
51 #include "sampledSet.H"
52 #include "DynamicList.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 // Forward declarations
60 class meshSearch;
61 
62 /*---------------------------------------------------------------------------*\
63  Class circleSet Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class circleSet
67 :
68  public sampledSet
69 {
70  // Private data
71 
72  // Circle definition
73 
74  //- Origin (x, y, z) in global cartesian coordinates
75  point origin_;
76 
77  //- Axis of the circle
78  vector circleAxis_;
79 
80  //- Point on circle (x, y, z) in global cartesian coordinates
81  // Defines start point
82  point startPoint_;
83 
84 
85  // Sampling definition
86 
87  //- Sampling interval in degrees about the origin
88  scalar dTheta_;
89 
90 
91  // Private Member Functions
92 
93  //- Samples all points in sampleCoords.
94  void calcSamples
95  (
96  DynamicList<point>& samplingPts,
97  DynamicList<label>& samplingCells,
98  DynamicList<label>& samplingFaces,
99  DynamicList<label>& samplingSegments,
100  DynamicList<scalar>& samplingCurveDist
101  ) const;
102 
103  //- Uses calcSamples to obtain samples. Copies them into *this.
104  void genSamples();
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("circle");
110 
111 
112  // Constructors
113 
114  //- Construct from components
115  circleSet
116  (
117  const word& name,
118  const polyMesh& mesh,
119  const meshSearch& searchEngine,
120  const word& axis,
121  const point& origin,
122  const vector& circleAxis,
123  const point& startPoint,
124  const scalar dTheta
125  );
126 
127  //- Construct from dictionary
128  circleSet
129  (
130  const word& name,
131  const polyMesh& mesh,
132  const meshSearch& searchEngine,
133  const dictionary& dict
134  );
135 
136 
137  //- Destructor
138  virtual ~circleSet() = default;
139 
140 
141  // Member Functions
142 
143  //- Get reference point
144  virtual point getRefPoint(const List<point>& pts) const;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
Foam::sampledSet
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:83
Foam::circleSet
Samples along a circular path.
Definition: circleSet.H:100
Foam::coordSet::name
const word & name() const
Definition: coordSet.H:125
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::meshSearch
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition: meshSearch.H:60
Foam::DynamicList< point >
Foam::sampledSet::searchEngine
const meshSearch & searchEngine() const
Definition: sampledSet.H:286
Foam::coordSet::axis
word axis() const
Definition: coordSet.H:130
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
sampledSet.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:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::sampledSet::mesh
const polyMesh & mesh() const
Definition: sampledSet.H:281
Foam::circleSet::getRefPoint
virtual point getRefPoint(const List< point > &pts) const
Get reference point.
Definition: circleSet.C:211
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
DynamicList.H
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::circleSet::circleSet
circleSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const point &origin, const vector &circleAxis, const point &startPoint, const scalar dTheta)
Construct from components.
Definition: circleSet.C:170
Foam::circleSet::TypeName
TypeName("circle")
Runtime type information.
Foam::circleSet::~circleSet
virtual ~circleSet()=default
Destructor.