arcEdge.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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::blockEdges::arcEdge
26 
27 Description
28  An arcEdge between two points on a circle. The arc is defined either by a
29  third point that the arc passes through, or by the angle of the sector and
30  the axis of the circle.
31 
32  If the angle-axis specification is used, the axis may not be not
33  perpendicular to the line connecting the end points. In that case, the axis
34  is considered to be that of a cylinder, and the arc represents a portion of
35  a helix on the surface of that cylinder.
36 
37 SourceFiles
38  arcEdge.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef blockEdges_arcEdge_H
43 #define blockEdges_arcEdge_H
44 
45 #include "blockEdge.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace blockEdges
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class arcEdge Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class arcEdge
59 :
60  public blockEdge
61 {
62  // Private Data
63 
64  //- The start point of the arc
65  const point p0_;
66 
67  //- The end point of the arc
68  const point p1_;
69 
70  //- The centre of the circle of which the arc is a part
71  point centre_;
72 
73  //- The axis of the circle of which the arc is a part
74  vector axis_;
75 
76  //- The sector angle of the arc
77  scalar theta_;
78 
79  //- The axial length of the arc/helix
80  scalar length_;
81 
82 
83  // Private Member Functions
84 
85  //- Calculate the coordinate system, angle and radius from a mid point
86  // somewhere within the arc
87  void calc(const point& pM);
88 
89  //- Calculate the coordinate system, angle and radius from a sector
90  // angle and a normal to the plane of the arc
91  void calc(const scalar theta, const vector& axis);
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("arc");
98 
99 
100  // Constructors
101 
102  //- Construct from Istream setting pointsList
103  arcEdge
104  (
105  const dictionary& dict,
106  const label index,
107  const searchableSurfaces& geometry,
108  const pointField& points,
109  Istream&
110  );
111 
112  //- Disallow default bitwise copy construction
113  arcEdge(const arcEdge&) = delete;
114 
115 
116  //- Destructor
117  virtual ~arcEdge()
118  {}
119 
120 
121  // Member Functions
122 
123  //- Return the point position corresponding to the curve parameter
124  // 0 <= lambda <= 1
125  point position(const scalar) const;
126 
127  //- Return the length of the curve
128  scalar length() const;
129 
130 
131  // Member Operators
132 
133  //- Disallow default bitwise assignment
134  void operator=(const arcEdge&) = delete;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End of namespace blockEdges
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
point position(const scalar) const
Return the point position corresponding to the curve parameter.
Definition: arcEdge.C:140
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
TypeName("arc")
Runtime type information.
An arcEdge between two points on a circle. The arc is defined either by a third point that the arc pa...
Definition: arcEdge.H:57
arcEdge(const dictionary &dict, const label index, const searchableSurfaces &geometry, const pointField &points, Istream &)
Construct from Istream setting pointsList.
Definition: arcEdge.C:105
const pointField & points
Container for searchableSurfaces.
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
Definition: Vector.H:57
virtual ~arcEdge()
Destructor.
Definition: arcEdge.H:116
Define a curved edge that is parameterised for 0<lambda<1 between the start and end point...
Definition: blockEdge.H:56
void operator=(const arcEdge &)=delete
Disallow default bitwise assignment.
scalar length() const
Return the length of the curve.
Definition: arcEdge.C:156
Namespace for OpenFOAM.