basisConstructor Function

private pure function basisConstructor(nk, p, k) result(me)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: nk

Number of the knots

integer, intent(in) :: p

Polynomial degree

real(kind=wp), intent(in) :: k(nk)

Open knot vector
kv(0:m)

Return Value type(basis)

Spline basis object


Called by

proc~~basisconstructor~~CalledByGraph proc~basisconstructor basisConstructor interface~basis basis interface~basis->proc~basisconstructor

Contents

Source Code


Source Code

        pure function basisConstructor(nk,p,k) result(me)
            integer, intent(in)             :: nk       !< Number of the knots
            integer, intent(in)             :: p        !< Polynomial degree \(p\)
            real(wp), intent(in)            :: k(nk)    !< [Open knot vector](../page/01.fooiga/eqns.html#openvec)  
                                                        !< ` kv(0:m) ` \( = \left\{u_{0},..., u_{m}\right\} \)
            type(basis)                     :: me       !< Spline basis object
            !locals
            integer                     :: i

            me%nk = nk
            me%m  = nk - 1
            me%p  = p
            me%nb  = nk - ( p + 1 )     !number of basis functions or control points
            me%n   = me%nb - 1          !highest index of the basis functions or control points
            allocate(me%kv(0:nk-1), source=k)

            !calculate bezier segments, minimum and maximum regularities
            call me%BSegments(me%nbez,me%unik)
            if(allocated(me%mult)) deallocate(me%mult)
            allocate(me%mult(me%nbez+1))
            do i=1,me%nbez+1
                me%mult(i) = me%FindMult(i=me%FindSpan(me%unik(i)),u=me%unik(i))
            end do
            if(me%nbez>1)then
                me%minreg = me%p - maxval(me%mult(2:me%nbez))
                me%maxreg = me%p - minval(me%mult(2:me%nbez))
            else
                me%minreg = me%p
                me%maxreg = me%p
            end if
                        
        end function basisConstructor