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
pure function GrevilleAbscissae(me,dsc) result(pt)
class(basis), intent(in) :: me
logical, optional, intent(in) :: dsc !< If true, then the Greville abscissae are modified
!< by shifting the boundary points into the domain
real(wp) :: pt(0:me%n) !< The array containing Greville abscissae
! locals
integer :: i, iak(2), L, li
real(wp) :: kseq(0:me%n+me%nk), sm(2), ak(2)
forall(i=0:me%n) pt(i) = sum(me%kv(i+1:i+me%p))/me%p
if(present(dsc))then
if(dsc)then
kseq(0:me%n)=pt
kseq(me%n+1:)=me%kv
kseq = sort(kseq)
iak(1) = me%p+1; iak(2) = 2*me%nb-1
L = 1; if(me%p>3) L=2
sm = 0.0_wp
do li = 1,L
do i=1,2
sm(i) = sm(i) + kseq(iak(i)-li) + kseq(iak(i)+li) - 2 * kseq(iak(i))
end do
end do
ak = sm / (2*L + 1)
pt(0) = pt(0) + ak(1)
pt(me%n) = pt(me%n) + ak(2)
end if
end if
end function GrevilleAbscissae