Skip to content
ForCADDocumentation

tensor_basis_derivatives2_local Subroutine

public pure subroutine tensor_basis_derivatives2_local(first1, nc1, ders1, first2, nc2, ders2, first3, nc3, ders3, basis, gradient, hessian, Wc)

Compute a tensor-product basis, gradient, and Hessian on local support. The derivative tables contain rows zero through one, or through two when hessian is requested. Unused directions use a matching one-column identity table. Rational derivatives apply the quotient rule through the requested total order. This is a fused tensor-product specialization of the multivariate quotient recurrence, extending the rational-surface recurrence in Piegl and Tiller, The NURBS Book, Algorithm A4.4 to as many as three parametric directions. Direction 1 varies fastest in basis. gradient(:,i) stores , while hessian(:,i,j) stores the mixed derivative . When Wc is present, its active entries are first multiplied by one common exact radix power selected from their largest model exponent. This preserves the projective quotient and its derivatives.

Arguments

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

First active control index in each parameter direction.

integer, intent(in) :: nc1

Control counts in the same direction order.

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

Univariate basis jets indexed by derivative order and local basis index.

integer, intent(in) :: first2

First active control index in each parameter direction.

integer, intent(in) :: nc2

Control counts in the same direction order.

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

Univariate basis jets indexed by derivative order and local basis index.

integer, intent(in) :: first3

First active control index in each parameter direction.

integer, intent(in) :: nc3

Control counts in the same direction order.

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

Univariate basis jets indexed by derivative order and local basis index.

real(kind=rk), intent(out), contiguous :: basis(0:)

Local tensor-product values.

real(kind=rk), intent(out), contiguous :: gradient(0:,:)

Local parametric gradients, shape [nlocal,rank].

real(kind=rk), intent(out), optional, contiguous :: hessian(0:,:,:)

Optional local parametric Hessians, shape [nlocal,rank,rank].

real(kind=rk), intent(in), optional, contiguous :: Wc(:)

Optional flattened global weight array.