FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

BSpline Class Reference

An implementation of B-splines. More...


Detailed Description

An implementation of B-splines.

In this implementation, the end tangents are created automatically by reflection.

In matrix form, the local interpolation on the interval t=[0..1] is described as follows:

P(t) = 1/6 * [ t^3 t^2 t 1 ] * [ -1  3 -3  1 ] * [ P-1 ]
   [  3 -6  3  0 ]   [ P0 ]
   [ -3  0  3  0 ]   [ P1 ]
   [  1  4  1  0 ]   [ P2 ]

Where P-1 and P2 represent the neighbouring points or the extrapolated end points. Simple reflection is used to automatically create the end points.

The spline is discretized based on the chord length of the individual segments. In rare cases (sections with very high curvatures), the resulting distribution may be sub-optimal.

See also:
CatmullRomSpline
Todo:
A future implementation could also handle closed splines.
Source files

Definition at line 75 of file BSpline.H.

Inheritance diagram for BSpline:
Collaboration diagram for BSpline:

List of all members.

Public Member Functions

 BSpline (const pointField &knots, const bool notImplementedClosed=false)
 Construct from components.
point  position (const scalar lambda) const
 Return the point position corresponding to the curve parameter.
point  position (const label segment, const scalar lambda) const
 Return the point position corresponding to the local parameter.
scalar  length () const
 Return the length of the curve.

Constructor & Destructor Documentation

BSpline ( const pointField &   knots,
const bool   notImplementedClosed = false  
)

Construct from components.


Member Function Documentation

point position ( const scalar   lambda  ) const

Return the point position corresponding to the curve parameter.

0 <= lambda <= 1

Reimplemented from polyLine.

point position ( const label   segment,
const scalar   lambda  
) const

Return the point position corresponding to the local parameter.

0 <= lambda <= 1 on the given segment

Reimplemented from polyLine.

scalar length (  ) const

Return the length of the curve.

Reimplemented from polyLine.


The documentation for this class was generated from the following file:
  • applications/utilities/mesh/generation/blockMesh/curvedEdges/BSpline.H