Pulls out the apply_stencil function from the Hamiltonian derivatives into a standalone function derivative. This will automatically cache results of the passed-in function so that taking multiple partial derivatives of the same function at the same location will be faster.
Pulls out the
apply_stencil
function from the Hamiltonian derivatives into a standalone functionderivative
. This will automatically cache results of the passed-in function so that taking multiple partial derivatives of the same function at the same location will be faster.Also adds
d_poloidal_flux_d*
methods toMagneticField
so that we can take advantage ofRectBivariateSpline.partial_derivative
for interpolate fields.Overall this gives a speed up of ~5-10%