The module defining spline basis objects and their arguments
OBJECT CONSTRUCTOR
- Basis (Int)
=>
METHODS OF BASIS TYPE
- PlotBasisFunc (Sub)
- FindSpan (Fn)
- FindMult (Fn)
- FindSpanMult (Sub)
- BasisFuns (Sub)
- OneBasisFun (Fn)
- AllBasisFuns (Sub)
- DersBasisFuns (Sub)
- DersOneBasisFun (Sub)
- InsertKnot (Sub)
- UpdateBasis (Sub)
- BSegments (Sub)
- ParLen (Fn)
- GrevilleAbscissae (Fn)
- get_nquad (Fn)
=>
TYPE CONSTRUCTORS
- basis_constructor (Fn)
=>
PROCEDURES
- bin (Fn)
- sort (Fn)
=>
Recursive quicksort using binary tree pivot.
Spline basis constructor
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nk | Number of the knots |
||
| integer, | intent(in) | :: | p | Polynomial degree |
||
| real(kind=wp), | intent(in) | :: | k(nk) | Open knot vector |
Spline basis object
Spline basis function class
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | p | Polynomial degree |
|||
| integer, | public | :: | nk | Number of the knots |
|||
| integer, | public | :: | m | The highest index of the knots |
|||
| integer, | public | :: | nb | Number of basis functions |
|||
| integer, | public | :: | n | The highest index of the basis functions |
|||
| real(kind=wp), | public, | allocatable | :: | kv(:) | Open knot vector |
||
| real(kind=wp), | public, | allocatable | :: | unik(:) | Unique knot values |
||
| integer, | public, | allocatable | :: | mult(:) | Multiplicity of each unique knot value |
||
| integer, | public | :: | minreg | Minimum reqularity of the basis functions, |
|||
| integer, | public | :: | maxreg | Maximum reqularity of the basis functions, |
|||
| integer, | public | :: | nbez | Number of elements with nonzero measure, i.e., number of Bezier segments |
Spline basis constructor
| private pure function basisConstructor(nk, p, k) |
| procedure, public :: FindSpan | Knot span index search |
| procedure, public :: FindMult | Knot multiplicity computation |
| procedure, public :: FindSpanMult | Knot span and multiplicity computation |
| procedure, public :: BasisFuns | Computation of the non-vanishing basis functions |
| procedure, public :: OneBasisFun | Computation of a single basis function |
| procedure, public :: AllBasisFuns | Computation of a all non-zero basis function of all degrees from up to |
| procedure, public :: DersBasisFuns | Computation of the derivatives of the non-vanishing basis functions |
| procedure, public :: DersOneBasisFun | Computation of the the derivatives of a single basis function |
| procedure, public :: InsertKnot | Knot insertion of a given knot into the knot vector |
| procedure, public :: UpdateBasis | Updating the basis (the same contents with constructor) |
| procedure, public :: BSegments | Computation of the segments' data of the basis |
| procedure, public :: ParLen | Get the length of parameter space |
| procedure, public :: GrevilleAbscissae | Computation of the Greville abscissae |
| procedure, public :: Plot => PlotBasisFunc | Plot basis functions |
| procedure, public :: get_nquad | Get the number of quadrature points |
This procedure is an elemental function and does a binary search and return the integer :: span value, where lies on. Note that, indexing starts with zero. If , the index is , i.e., , where "nb " is number of control points of the univariate spline basis object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| real(kind=wp), | intent(in) | :: | u | Given value |
Knot span index of value
Computes the multiplicity of a knot
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| integer, | intent(in) | :: | i | Starting index for search |
||
| real(kind=wp), | intent(in) | :: | u | Given value |
Multiplicity of value
Computes a single basis function, .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| integer, | intent(in) | :: | i | Basis function index |
||
| real(kind=wp), | intent(in) | :: | u | Given value |
Return the length of the parameter space, i.e., , where is the highest index of the knot vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me |
Length of the parameter space
Return the Greville abscissae, , of the knot vector,
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| logical, | intent(in), | optional | :: | dsc | If true, then the Greville abscissae are modified by shifting the boundary points into the domain |
The array containing Greville abscissae
Return the number of quadrature points for a successive integration
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| character(len=*), | intent(in), | optional | :: | key | The key defining whether the quadrature is over the Bezier segments or over whole patch |
|
| logical, | intent(in), | optional | :: | reduced_int | Reduced integration flag, if true, the routine will return |
|
| character(len=*), | intent(in), | optional | :: | pdeq | Internal name of the relevant partial differential equation |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nk | Number of the knots |
||
| integer, | intent(in) | :: | p | Polynomial degree |
||
| real(kind=wp), | intent(in) | :: | k(nk) | Open knot vector |
Spline basis object
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n | |||
| integer, | intent(in) | :: | r |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(:) | :: | x | Input array |
This subroutine plots the basis functions or their th order derivatives having index from first to last by computing at interpolation points defined by plotRes, and print the image file into "|cwd|/data/work/fname.ext" if the workspace work is presented, "|cwd|/data/img/fname.ext" if else. Plotting requires GNUPlot installed on your computer. The input parameter terminal set the output terminal of GNUPlot.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| integer, | intent(in), | optional | :: | first | First index to be plotted |
|
| integer, | intent(in), | optional | :: | last | Last index to be plotted |
|
| integer, | intent(in), | optional | :: | d | Derivatives degree |
|
| integer, | intent(in), | optional | :: | plotRes | Resolution of the calculation, Default = 100 |
|
| character(len=*), | intent(in), | optional | :: | title | Title of the graph, Default = "Basis functions" |
|
| character(len=*), | intent(in), | optional | :: | work | Current work name to create folder |
|
| character(len=*), | intent(in), | optional | :: | fname | Filename of the *.png output, if GNUPlot terminal is |
|
| character(len=*), | intent(in), | optional | :: | terminal | GNUPlot terminal, Default = |
|
| logical, | intent(in), | optional | :: | showPlot | Key to open created |
Computes the span and multiplicity of a knot
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| real(kind=wp), | intent(in) | :: | u | Given value |
||
| integer, | intent(out) | :: | k | Knot span index of value |
||
| integer, | intent(out) | :: | s | Multiplicity of value |
Computes the nonvanishing basis functions based on Algorithm A2.2 in the NURBS Book 1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| real(kind=wp), | intent(in) | :: | u | Given value |
||
| real(kind=wp), | intent(out) | :: | N(0:me%p) |
|
||
| integer, | intent(in), | optional | :: | span | Knot span where lies on |
Computes all non-zero basis function of all degrees from up to .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| real(kind=wp), | intent(in) | :: | u | Given value |
||
| real(kind=wp), | intent(out) | :: | N(0:me%p,0:me%p) |
|
||
| integer, | intent(in), | optional | :: | span | Knot span where lies on |
Computes all nonzero basis functions and their derivatives based on Algorithm A2.3 in the NURBS Book [^1].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| real(kind=wp), | intent(in) | :: | u | Given value |
||
| integer, | intent(in) | :: | n | Number of derivatives () |
||
| real(kind=wp), | intent(out) | :: | ders(0:me%p,0:n) |
|
||
| integer, | intent(in), | optional | :: | span | Knot span where lies on |
Computes a single basis function and its derivatives based on Algorithm A2.5 in the NURBS Book [^1].
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| integer, | intent(in) | :: | i | Basis function index |
||
| real(kind=wp), | intent(in) | :: | u | Given value |
||
| integer, | intent(in) | :: | n | Number of derivatives () |
||
| real(kind=wp), | intent(out) | :: | ders(0:n) |
|
Insert knot into times.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | u | knot value |
||
| integer, | intent(in) | :: | r | multiplicity of new knot value |
||
| integer, | intent(in), | optional | :: | span | knot span |
Updates all component of the basis according to input knot vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | nk | Number of the knots |
||
| real(kind=wp), | intent(in) | :: | k(nk) | New knot vector |
||
| integer, | intent(in), | optional | :: | p | New basis degree |
Returns the number of Bezier segments, integer :: nb, of the basis and the real(wp) :: knots(:) array containing the unique values of the knot vector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(basis), | intent(in) | :: | me | |||
| integer, | intent(out) | :: | nb | Number of Bezier segments |
||
| real(kind=wp), | intent(out), | optional | allocatable | :: | knots(:) | The unique knot values |