Sounds good. I myself only need the uniform k=1 case. I’ve been looking at some basic methods, as I’m not so familiar with the field yet, and I worked out a simple set of polynomial shape functions that can be used to interpolate between nodes with both values and gradients on a rectangular mesh. (I’m pretty sure one can work out the same for a triangular mesh rather easily). The idea is a quite simple extension of the tensor-product approximation in Sec. 4.3 of the linked notes. If u
is the function to approximate and U
is the approximation, then
U(x,y) = ∑ u(x_i, y_i) φ_i(x,y) + ∂x u(x_i,y_i) φx_i(x,y)+∂y u(x_i,y_i) φy_i(x,y)
The sum is over nodes at positions (x_i,y_i)
and the shape functions are biqubic polynomials inside each finite element with that node, and zero outside. The three shape functions have zero value and zero gradient at all vertices of the rectangular element except at their particular node, where they either evaluate to 1 with zero gradient, or have a derivative of 1 and a value of 0. If we map the rectangular element to a square of side 1, we can write these shape functions as
φ_i(x,y) = φ(x-x_i)φ(y-y_i)
φx_i(x,y) = φt(x-x_i)φ(y-y_i)
φy_i(x,y) = φ(x-x_i)φt(y-y_i)
φ(x) = 1 - 3x^2 + 2x^3
φt(x) = x - 2x^2 + x^3
so that
φ(0)==1, φ(1)==0, φ'(0)==0, φ'(1)==0
φt(0)==0, φt(1)==0, φt'(0)==1, φt'(1)==0
I’m not sure if this holds any relation to the Hermite polynomials in the paper you sent (I find it hard to follow). I’ve done some checks and the approximation above works very well, but I’m pretty sure there are much more rigorous and sophisticated approaches. Could you say if this is related to what you have in mind?
On the other hand, I don’t really need to be very general with the mesh at this stage. I think I could manage with rectangular meshes. In that case, this type of interpolation with gradients could fit right into the wonderful Interpolations.jl package. Do you think it would be worthwhile to extend Interpolations.jl instead of creating something new? Maybe @tim.holy or some other contributor of that project could comment on how feasible that could be.
[EDIT: typos]