DESC
DESC copied to clipboard
Find contours in REGCOIL output by rootfinding on $\Phi(\theta(s),\zeta(s))$ with `FourierRZWindingSurfaceCurve`
Right now we use image-based methods like matplotlib.pyplot.contour
to find the contours of constant current potential for the REGCOIL surface current to coil cutting algorithm. This can have issues when the contours of constant current potential are very shaped, as if the grid used for the contour finding is not large enough the contours may be disjoint as they snake out of the grid and back in, causing bad coils like below. A possible alternative could be to instead find contours by creating FourierRZWindingSurfaceCurve objects and then rootfinding/optimizing the parameters of the curve to make $\Phi(\theta,\zeta)=constant$ along the curve, which should then yield a representation of the contour without needing to ensure the grid is large enough, and periodicity would be enforced by the secular terms for the curve (which can be fixed beforehand as they are related to the helicity of the surface current).
Related to #579 and #844
contour that is cut short
resulting coil that then is also cut short ( should be a helical coil that winds 5 times poloidally per field period)