desc.magnetic_fields.FourierCurrentPotentialField.to_CoilSet

FourierCurrentPotentialField.to_CoilSet(num_coils, step=1, spline_method='cubic', show_plots=False, npts=128, stell_sym=False, plot_kwargs={'figsize': (8, 6)}, check_intersection=True)Source

Find helical or modular coils from this surface current potential.

Surface current K is assumed given by

K = n x ∇ Φ

Φ(θ,ζ) = Φₛᵥ(θ,ζ) + Gζ/2π + Iθ/2π

where n is the winding surface unit normal, Φ is the current potential function, which is a function of theta and zeta, and is given as a secular linear term in theta (I) and zeta (G) and a double Fourier series in theta/zeta.

NOTE: The function is not jit/AD compatible

Parameters:
  • num_coils (int, optional) – Number of coils to discretize the surface current with. If the coils are modular (i.e. I=0), then this is the number of coils per field period. If the coils are stellarator-symmetric, then this is the number of coils per half field-period. The coils returned always have a coil which passes through the theta=0 zeta=0 point of the surface.

  • step (int, optional) – Amount of points to skip by when saving the coil geometry spline by default 1, meaning that every point will be saved if higher, less points will be saved e.g. 3 saves every 3rd point

  • spline_method (str, optional) – method of fitting to use for the spline, by default "cubic" see SplineXYZCoil for more info

  • show_plots (bool, optional,) – whether to show plots of the contours chosen for coils, by default False

  • npts (int, optional) – Number of zeta points over one field period to use to discretize the surface when finding constant current potential contours.

  • stell_sym (bool) – whether the coils are stellarator-symmetric or not. Defaults to False. Only matters for modular coils (currently)

  • plot_kwargs (dict) – dict of kwargs to use when plotting the contour plots if show_plots=True figsize is used for the figure size, and the rest are passed to plt.contourf

  • check_intersection (bool) – whether or not to check the resulting coilset for self-intersections. Defaults to True.

Returns:

coils (CoilSet) – DESC CoilSet of SplineXYZCoil coils that are a discretization of the surface current on the given winding surface.