desc.magnetic_fields.FourierCurrentPotentialField.constant_offset_surface

FourierCurrentPotentialField.constant_offset_surface(offset, grid=None, M=None, N=None, full_output=False)Source

Create a FourierRZSurface with constant offset from the base surface (self).

Implementation of algorithm described in Appendix B of “An improved current potential method for fast computation of stellarator coil shapes”, Landreman (2017) https://iopscience.iop.org/article/10.1088/1741-4326/aa57d4

NOTE: Must have the toroidal angle as the cylindrical toroidal angle in order for this algorithm to work properly

Parameters:
  • base_surface (FourierRZToroidalSurface) – Surface from which the constant offset surface will be found.

  • offset (float) – constant offset (in m) of the desired surface from the input surface offset will be in the normal direction to the surface.

  • grid (Grid, optional) – Grid object of the points on the given surface to evaluate the offset points at, from which the offset surface will be created by fitting offset points with the basis defined by the given M and N. If None, defaults to a LinearGrid with M and N and NFP equal to the base_surface.M and base_surface.N and base_surface.NFP

  • M (int, optional) – Poloidal resolution of the basis used to fit the offset points to create the resulting constant offset surface, by default equal to base_surface.M

  • N (int, optional) – Toroidal resolution of the basis used to fit the offset points to create the resulting constant offset surface, by default equal to base_surface.N

  • full_output (bool, optional) – If True, also return a dict of useful data about the surfaces and a tuple where the first element is the residual from the root finding and the second is the number of iterations.

Returns:

  • offset_surface (FourierRZToroidalSurface) – FourierRZToroidalSurface, created from fitting points offset from the input surface by the given constant offset.

  • data (dict) –

    dictionary containing the following data, in the cylindrical basis:
    n(grid.num_nodes x 3) array of the unit surface normal on

    the base_surface evaluated at the input grid

    x(grid.num_nodes x 3) array of the position vectors on

    the base_surface evaluated at the input grid

    x_offset_surface(grid.num_nodes x 3) array of the

    position vectors on the offset surface, corresponding to the x points on the base_surface (i.e. the points to which the offset surface was fit)

  • info (tuple) – 2 element tuple containing residuals and number of iterations for each point. Only returned if full_output is True