Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::circleSet
28
29Description
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
43SourceFiles
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
56namespace Foam
57{
58
59// Forward declarations
60class meshSearch;
61
62/*---------------------------------------------------------------------------*\
63 Class circleSet Declaration
64\*---------------------------------------------------------------------------*/
65
66class 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
106public:
107
108 //- Runtime type information
109 TypeName("circle");
110
111
112 // Constructors
113
114 //- Construct from components
116 (
117 const word& name,
118 const polyMesh& mesh,
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
129 (
130 const word& name,
131 const polyMesh& mesh,
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// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
Samples along a circular path.
Definition circleSet.H:99
virtual point getRefPoint(const List< point > &pts) const
Get reference point.
Definition circleSet.C:204
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:163
virtual ~circleSet()=default
Destructor.
TypeName("circle")
Runtime type information.
const word & axis() const
The sort axis name.
Definition coordSet.H:160
const word & name() const noexcept
The coord-set name.
Definition coordSet.H:152
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition meshSearch.H:57
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition sampledSet.H:82
const meshSearch & searchEngine() const noexcept
Definition sampledSet.H:378
sampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const coordSet::coordFormat axisType)
Construct from components.
Definition sampledSet.C:405
const polyMesh & mesh() const noexcept
Definition sampledSet.H:373
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
vector point
Point is a vector.
Definition point.H:37
Vector< scalar > vector
Definition vector.H:57
dictionary dict
const pointField & pts
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68