desc.geometry.FourierRZToroidalSurface.constant_offset_surface
- FourierRZToroidalSurface.constant_offset_surface(offset, grid=None, M=None, N=None, full_output=False)Source
Create a new FourierRZToroidalSurface with constant offset from 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
NOTE: if one wants to use this inside of an optimization, one should use the private method _constant_offset_surface directly, and refer to the documentation in PR #2016 for more details.
- 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 offset 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 twice the base_surface.M and base_surface.N and NFP equal to 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_nodesx 3) array of the unit surface normal onthe base_surface evaluated at the input
gridx(grid.num_nodesx 3) array of coordinates onthe base_surface evaluated at the input
gridx_offset_surface(grid.num_nodesx 3) array of thecoordinates on the offset surface, corresponding to the
xpoints on the base_surface (i.e. the points to which the offset surface was fit)transformsdict containing the Transform objects used tofit R and Z of the
info (tuple) – 2 element tuple containing residuals and number of iterations for each point. Only returned if
full_outputis True