API

Structs

DataInterpolationsND.NDInterpolation — Type
NDInterpolation(u, interp_dims; cache = EmptyCache())

The interpolation object containing the interpolation dimensions and the data to interpolate u. Given the number of interpolation dimensions N_in, for first N_in dimensions of u the size of u along that dimension must match the length of t of the corresponding interpolation dimension.

Arguments

  • interp_dims: A tuple of identically typed interpolation dimensions.
  • u: The array to be interpolated.

Keyword Arguments

  • cache: Optional global cache
source
DataInterpolationsND.LinearInterpolationDimension — Type
LinearInterpolationDimension(t; t_eval = similar(t, 0),
    extrapolation::ExtrapolationType.T = ExtrapolationType.Linear)

Interpolation dimension for linear interpolation between the data points. Both sides default to ExtrapolationType.Linear. If t has a single point, the interpolation is constant along this dimension for every extrapolation mode, and derivatives along it are zero.

Arguments

  • t: The time points for this interpolation dimension.

Keyword arguments

  • extrapolation: An ExtrapolationType mode applied on both sides of this dimension.
  • t_eval: A vector (like) of time evaluation points for efficient evaluation of multiple points, see eval_unstructured and eval_grid. Defaults to no points.
source
DataInterpolationsND.ConstantInterpolationDimension — Type
ConstantInterpolationDimension(t; t_eval = similar(t, 0), left = true,
    extrapolation::ExtrapolationType.T = ExtrapolationType.Constant)

Interpolation dimension for constant interpolation between the data points. Both sides default to ExtrapolationType.Constant; all supported modes hold the edge value. If t has a single point, the interpolation is constant along this dimension for every extrapolation mode, and derivatives along it are zero.

Arguments

  • t: The time points for this interpolation dimension.

Keyword arguments

  • left: Whether the interpolation looks to the left of the evaluation t for the value. Defaults to true.
  • extrapolation: An ExtrapolationType mode applied on both sides of this dimension.
  • t_eval: A vector (like) of time evaluation points for efficient evaluation of multiple points, see eval_unstructured and eval_grid. Defaults to no points.
source
DataInterpolationsND.BSplineInterpolationDimension — Type
BSplineInterpolationDimension(
    t, degree;
    t_eval = similar(t, 0),
    max_derivative_order_eval::Integer = 0,
    multiplicities::Union{AbstractVector{<:Integer}, Nothing} = nothing,
    extrapolation::ExtrapolationType.T = ExtrapolationType.Extension)

Interpolation dimension for BSpline or NURBS interpolation between the data points, used for evaluating the BSpline basis functions. Both sides default to ExtrapolationType.Extension. ExtrapolationType.Linear extends the boundary tangent and is not supported with NURBSWeights. t must contain at least two knots; otherwise an ArgumentError is thrown.

Arguments

  • t: The time points for this interpolation dimension, in this context also known as knots.
  • degree: The degree of the basis functions

Keyword arguments

  • extrapolation: An ExtrapolationType mode applied on both sides of this dimension.
  • t_eval: A vector (like) of time evaluation points for efficient evaluation of multiple points, see eval_unstructured and eval_grid. Defaults to no points.
  • max_derivative_order_eval: The maximum derivative order for which the basis functions will be precomputed for eval_unstructured and eval_grid.
  • multiplicities: The multiplicities of the knots t. Defaults to multiplicities for an open/clamped knot vector.
source

Extrapolation

Every dimension constructor accepts extrapolation::ExtrapolationType.T, which applies the selected mode on both sides of that dimension. The defaults are Linear for linear dimensions, Constant for constant dimensions, and Extension for spline dimensions.

DataInterpolationsND.ExtrapolationType — Module
ExtrapolationType

Extrapolation modes for each interpolation dimension, using the naming convention of DataInterpolations.jl. The extrapolation::ExtrapolationType.T keyword sets the mode for both sides of a dimension. Different dimensions can use different modes.

  • ExtrapolationType.Constant: hold the boundary value. Derivatives along an axis strictly outside its grid are zero; derivatives at the boundary use the interpolation.
  • ExtrapolationType.Linear: extend the boundary tangent. This is the default for linear dimensions. For constant dimensions the tangent is zero. Not supported with NURBSWeights.
  • ExtrapolationType.Extension: extend the boundary interpolation polynomial. This is the default for spline dimensions. Constant dimensions default to Constant.

The mode type is ExtrapolationType.T. Other DataInterpolations.jl extrapolation modes are not supported.

source

Multi-point evaluation

DataInterpolationsND.eval_unstructured — Function
function eval_unstructured(
    interp::NDInterpolation{N_in};
    derivative_orders::NTuple{N_in, <:Integer} = ntuple(_ -> 0, N_in)) where {N_in}

Evaluate the interpolation in the unstructured set of points defined by t_eval in the interpolation dimensions out of place. That is, t_eval must have the same length for each interpolation dimension and the interpolation is evaluated at the zip if these t_eval.

Keyword arguments

  • derivative_orders: The partial derivative order for each interpolation dimension. Defaults to 0 for each.
source
DataInterpolationsND.eval_unstructured! — Function
function eval_unstructured!(
    out::AbstractArray,
    interp::NDInterpolation{N_in};
    derivative_orders::NTuple{N_in, <:Integer} = ntuple(_ -> 0, N_in)) where {N_in}

Evaluate the interpolation in the unstructured set of points defined by t_eval in the interpolation dimensions in place. That is, t_eval must have the same length for each interpolation dimension and the interpolation is evaluated at the zip if these t_eval.

Keyword arguments

  • derivative_orders: The partial derivative order for each interpolation dimension. Defaults to 0 for each.
source
DataInterpolationsND.eval_grid — Function
function eval_grid(
    interp::NDInterpolation{N_in};
    derivative_orders::NTuple{N_in, <:Integer} = ntuple(_ -> 0, N_in)) where {N_in}

Evaluate the interpolation in the Cartesian product of the t_eval of the interpolation dimensions out of place.

Keyword arguments

  • derivative_orders: The partial derivative order for each interpolation dimension. Defaults to 0 for each.
source
DataInterpolationsND.eval_grid! — Function
function eval_grid!(
    out::AbstractArray,
    interp::NDInterpolation{N_in};
    derivative_orders::NTuple{N_in, <:Integer} = ntuple(_ -> 0, N_in)) where {N_in}

Evaluate the interpolation in the Cartesian product of the t_eval of the interpolation dimensions in place.

Keyword arguments

  • derivative_orders: The partial derivative order for each interpolation dimension. Defaults to 0 for each.
source