splineEdge.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-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2021 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::blockEdges::splineEdge
29 
30 Description
31  A blockEdge interface for Catmull-Rom splines.
32 
33 See also
34  BSpline
35  CatmullRomSpline
36 
37 SourceFiles
38  splineEdge.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef blockEdges_splineEdge_H
43 #define blockEdges_splineEdge_H
44 
45 #include "blockEdge.H"
46 #include "CatmullRomSpline.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace blockEdges
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class splineEdge Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class splineEdge
60 :
61  public blockEdge,
62  public CatmullRomSpline
63 {
64  // Private Member Functions
65 
66  //- No copy construct
67  splineEdge(const splineEdge&) = delete;
68 
69  //- No copy assignment
70  void operator=(const splineEdge&) = delete;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("spline");
77 
78 
79  // Constructors
80 
81  //- Construct from components
83  (
84  const pointField& points,
85  const edge& fromTo,
86  const pointField& internalPoints
87  );
88 
89  //- Construct from components
91  (
92  const pointField& points,
93  const label from,
94  const label to,
95  const pointField& internalPoints
96  );
97 
98  //- Construct from Istream and point field.
100  (
101  const dictionary& dict,
102  const label index,
103  const searchableSurfaces& /*unused*/,
104  const pointField& points,
105  Istream&
106  );
107 
108 
109  //- Destructor
110  virtual ~splineEdge() = default;
111 
112 
113  // Member Functions
114 
115  //- The point position corresponding to the curve parameter
116  // 0 <= lambda <= 1
117  virtual point position(const scalar) const;
118 
119  //- The length of the spline curve
120  // \note NotImplemented
121  virtual scalar length() const;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace blockEdges
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:63
Foam::blockEdges::splineEdge::TypeName
TypeName("spline")
Runtime type information.
CatmullRomSpline.H
Foam::CatmullRomSpline
An implementation of Catmull-Rom splines (sometimes known as Overhauser splines).
Definition: CatmullRomSpline.H:78
Foam::blockEdge
Define a curved edge that is parameterized for 0<lambda<1 between the start/end points.
Definition: blockEdge.H:63
Foam::polyLine::points
const pointField & points() const noexcept
Return const-access to the control-points.
Definition: polyLine.C:112
Foam::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::blockEdges::splineEdge::~splineEdge
virtual ~splineEdge()=default
Destructor.
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::blockEdges::splineEdge
A blockEdge interface for Catmull-Rom splines.
Definition: splineEdge.H:58
Foam::blockEdges::splineEdge::length
virtual scalar length() const
The length of the spline curve.
Definition: splineEdge.C:115
Foam::Vector< scalar >
Foam::searchableSurfaces
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
Definition: searchableSurfaces.H:92
Foam::blockEdges::splineEdge::position
virtual point position(const scalar) const
The point position corresponding to the curve parameter.
Definition: splineEdge.C:109
blockEdge.H