Vector calculus
Coordinates are passed as a list of variable names; vector fields as a list of component expressions in the same order. Empty variable lists and component/variable count mismatches raise.
gradient#
Explicit context
func gradient(
scalarField: UniffiExpression,
variables: [String],
) -> [UniffiExpression]: the partial derivatives in the order of variables.
divergence#
Explicit context
func divergence(
vectorComponents: [UniffiExpression],
variables: [String],
) -> UniffiExpression; component and variable counts must match.
curl#
Explicit context
func curl(
vectorComponents: [UniffiExpression],
variables: [String],
) -> [UniffiExpression]. Requires exactly three components and three variables; other dimensions raise.
laplacian#
Explicit context
func laplacian(
scalarField: UniffiExpression,
variables: [String],
) -> UniffiExpression.
jacobian#
Explicit context
func jacobian(
vectorComponents: [UniffiExpression],
variables: [String],
) -> UniffiMatrixThe matrix with entry (rows index components, columns index
variables). Returned as a Matrix so the result composes with the matrix
methods.
hessian#
Explicit context
func hessian(
scalarField: UniffiExpression,
variables: [String],
) -> UniffiMatrixThe matrix of second partials, computed as the Jacobian of the gradient; structurally symmetric on smooth input.