I am trying to interpolate on a grid that is body fitted (in a Computational Fluid Dynamics context). The grid cannot be simply described by vectors describing the grid spacing in each dimensions, instead the points are simply represented by vectors x, y which are the same length as the number of data points in the grid. The output vector is then the same length as x, y.
To create a simple example, interpolating in a 1x1 box with arbitrarily located sample points:
# Some 2D function
f(x, y) = cos(8. * pi * x) + sin(4. * pi * y)
# 1000 (x, y) points
x_pts = rand(Float64, 1000)
y_pts = rand(Float64, 1000)
# Sample f at the generated points
output = f.(x_pts, y_pts)
# Now to generate an interpolator for this data
Ideally, I would just use the Interpolations.jl interpolate function, but AFAIK it wants rectilinear grids where the output matrix is of dimensions Nx, Ny. I can call the scipy.interpolate library and use something like the CloughTocher2DInterpolator, but I feel like this functionality, even just first-order interpolation, must exist in Julia but I just haven’t been able to find it.