1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 An implementation of B-splines.
30 In this implementation, the end tangents are created automatically
33 In matrix form, the \e local interpolation on the interval t=[0..1] is
36 P(t) = 1/6 * [ t^3 t^2 t 1 ] * [ -1 3 -3 1 ] * [ P-1 ]
42 Where P-1 and P2 represent the neighbouring points or the extrapolated
43 end points. Simple reflection is used to automatically create the end
46 The spline is discretized based on the chord length of the individual
47 segments. In rare cases (sections with very high curvatures), the
48 resulting distribution may be sub-optimal.
50 A future implementation could also handle closed splines.
58 \*---------------------------------------------------------------------------*/
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 /*---------------------------------------------------------------------------*\
71 Class BSpline Declaration
72 \*---------------------------------------------------------------------------*/
78 // Private Member Functions
80 //- Disallow default bitwise copy construct
81 BSpline(const BSpline&);
83 //- Disallow default bitwise assignment
84 void operator=(const BSpline&);
91 //- Construct from components
94 const pointField& knots,
95 const bool notImplementedClosed = false
101 //- Return the point position corresponding to the curve parameter
103 point position(const scalar lambda) const;
105 //- Return the point position corresponding to the local parameter
106 // 0 <= lambda <= 1 on the given segment
107 point position(const label segment, const scalar lambda) const;
109 //- Return the length of the curve
110 scalar length() const;
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 } // End namespace Foam
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 // ************************************************************************* //