Differential operators: curl div, grad, laplacian, partial derivatives with automatic differentiation

The easiest way to do this might be to use

and then:

auto_jacvec(f, u, [1,0,0])

would be partial f(u) / partial x.