Skip to content
ForCADDocumentation

insert_knot_A_5_1 Subroutine

public pure recursive subroutine insert_knot_A_5_1(p, UP, Pw, u, k, s, r, nq, UQ, Qw, T)

Insert a knot without changing the represented homogeneous geometry.

For s+r<=p, this is Algorithm A5.1 of Piegl and Tiller, equivalent to repeated Boehm knot insertion. The s+r=p+1 extension first applies the standard insertion through multiplicity , then duplicates the interface control row to represent the same two one-sided pieces in a discontinuous space. Arrays use the algorithm's zero-based bounds. When requested, T satisfies Qw=matmul(T,Pw) and can transform any field in the same spline space. r=0 returns the exact identity operation.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: p

Polynomial degree.

real(kind=rk), intent(in), contiguous :: UP(0:)

Original valid knot vector, lower bound zero.

real(kind=rk), intent(in), contiguous :: Pw(0:,:)

Original homogeneous or polynomial control variables by row.

real(kind=rk), intent(in) :: u

Knot value to insert.

integer, intent(in) :: k

Zero-based span containing u.

integer, intent(in) :: s

Existing multiplicity of u.

integer, intent(in) :: r

Number of insertions, satisfying s+r<=p+1.

integer, intent(out) :: nq

New highest zero-based control index; -1 signals invalid input.

real(kind=rk), intent(out), allocatable :: UQ(:)

Refined knot vector.

real(kind=rk), intent(out), allocatable :: Qw(:,:)

Refined control variables.

real(kind=rk), intent(out), optional, allocatable :: T(:,:)

Optional refinement transformation.