greville_abscissae Subroutine

public pure subroutine greville_abscissae(t, n, k, xi)

Greville abscissae of a b-spline: the average of the k-1 interior knots of the support of each b-spline basis function,

The control points of a 1D b-spline are , where are its coefficients. The spline lies within their convex hull, and the control polygon approximates the spline. In more than one dimension, the control net is the tensor product of the Greville abscissae in each direction, with the coefficient array.

The Greville abscissae are also the coefficients of (for k >= 2), and are in for clamped knots. For k = 1, the midpoints of the supports, , are returned.

See also

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(n+k) :: t

knot array

integer(kind=ip), intent(in) :: n

number of b-spline coefficients

integer(kind=ip), intent(in) :: k

order of the b-spline, k >= 1

real(kind=wp), intent(out), dimension(n) :: xi

the Greville abscissae


Called by

proc~~greville_abscissae~~CalledByGraph proc~greville_abscissae greville_abscissae proc~control_points_1d bspline_1d%control_points_1d proc~control_points_1d->proc~greville_abscissae

Source Code

    pure subroutine greville_abscissae(t,n,k,xi)

    implicit none

    integer(ip),intent(in)              :: n   !! number of b-spline coefficients
    integer(ip),intent(in)              :: k   !! order of the b-spline, `k >= 1`
    real(wp),dimension(n+k),intent(in)  :: t   !! knot array
    real(wp),dimension(n),intent(out)   :: xi  !! the Greville abscissae

    integer(ip) :: i  !! counter

    if (k==1_ip) then
        xi = 0.5_wp*(t(1_ip:n) + t(2_ip:n+1_ip))
    else
        do i = 1_ip, n
            ! the average, as an offset from the first knot (so it is exact
            ! for repeated knots, such as clamped ends), kept within the
            ! knots in case of rounding
            xi(i) = t(i+1_ip) + sum(t(i+2_ip:i+k-1_ip)-t(i+1_ip)) / real(k-1_ip,wp)
            xi(i) = min(max(xi(i), t(i+1_ip)), t(i+k-1_ip))
        end do
    end if

    end subroutine greville_abscissae