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 | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::circleSet
26 
27 Description
28  Samples along a circular path
29 
30 SourceFiles
31  circleSet.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef circleSet_H
36 #define circleSet_H
37 
38 #include "sampledSet.H"
39 #include "DynamicList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class meshSearch;
48 
49 /*---------------------------------------------------------------------------*\
50  Class circleSet Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class circleSet
54 :
55  public sampledSet
56 {
57  // Private data
58 
59  // Circle definition
60 
61  //- Origin (x, y, z) in global cartesian co-ordinates
62  point origin_;
63 
64  //- Axis of the circle
65  vector circleAxis_;
66 
67  //- Point on circle (x, y, z) in global cartesian co-ordinates
68  // Defines start point
69  point startPoint_;
70 
71 
72  // Sampling definition
73 
74  //- Sampling interval in degrees about the origin
75  scalar dTheta_;
76 
77 
78  // Private Member Functions
79 
80  //- Samples all points in sampleCoords.
81  void calcSamples
82  (
83  DynamicList<point>& samplingPts,
84  DynamicList<label>& samplingCells,
85  DynamicList<label>& samplingFaces,
86  DynamicList<label>& samplingSegments,
87  DynamicList<scalar>& samplingCurveDist
88  ) const;
89 
90  //- Uses calcSamples to obtain samples. Copies them into *this.
91  void genSamples();
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("circle");
97 
98 
99  // Constructors
100 
101  //- Construct from components
102  circleSet
103  (
104  const word& name,
105  const polyMesh& mesh,
106  const meshSearch& searchEngine,
107  const word& axis,
108  const point& origin,
109  const vector& circleAxis,
110  const point& startPoint,
111  const scalar dTheta
112  );
113 
114  //- Construct from dictionary
115  circleSet
116  (
117  const word& name,
118  const polyMesh& mesh,
119  const meshSearch& searchEngine,
120  const dictionary& dict
121  );
122 
123 
124  // Destructor
125 
126  virtual ~circleSet();
127 
128 
129  // Member Functions
130 
131  //- Get reference point
132  virtual point getRefPoint(const List<point>&) const;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
Definition: meshSearch.H:57
dictionary dict
const polyMesh & mesh() const
Definition: sampledSet.H:241
word axis() const
Definition: coordSet.H:116
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
virtual point getRefPoint(const List< point > &) const
Get reference point.
Definition: circleSet.C:237
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition: sampledSet.H:64
A class for handling words, derived from string.
Definition: word.H:59
Samples along a circular path.
Definition: circleSet.H:52
const word & name() const
Definition: coordSet.H:111
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:177
const meshSearch & searchEngine() const
Definition: sampledSet.H:246
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
virtual ~circleSet()
Definition: circleSet.C:231
TypeName("circle")
Runtime type information.
Namespace for OpenFOAM.