desc.grid.LinearGrid
- class desc.grid.LinearGrid(L=None, M=None, N=None, NFP=1, sym=False, axis=True, endpoint=False, rho=array(1.), theta=array(0.), zeta=array(0.))Source
Grid in which the nodes are linearly spaced in each coordinate.
Useful for plotting and other analysis, though not very efficient for using as the solution grid.
- Parameters:
L (int, optional) – Radial grid resolution.
M (int, optional) – Poloidal grid resolution.
N (int, optional) – Toroidal grid resolution.
NFP (int) – Number of field periods (Default = 1).
sym (bool) – True for stellarator symmetry, False otherwise (Default = False).
axis (bool) – True to include a point at rho=0 (default), False for rho[0] = rho[1]/2.
endpoint (bool) – If True, theta=0 and zeta=0 are duplicated after a full period. Should be False for use with FFT. (Default = False). This boolean is ignored if an array is given for theta or zeta.
rho (int or ndarray of float, optional) – Radial coordinates (Default = 1.0). Alternatively, the number of radial coordinates (if an integer). Note that if supplied the values may be reordered in the resulting grid.
theta (int or ndarray of float, optional) – Poloidal coordinates (Default = 0.0). Alternatively, the number of poloidal coordinates (if an integer). Note that if supplied the values may be reordered in the resulting grid.
zeta (int or ndarray of float, optional) – Toroidal coordinates (Default = 0.0). Alternatively, the number of toroidal coordinates (if an integer). Note that if supplied the values may be reordered in the resulting grid.
Methods
change_resolution
(L, M, N[, NFP])Change the resolution of the grid.
compress
(x[, surface_label])Return elements of
x
at indices of unique surface label values.copy
([deepcopy])Return a (deep)copy of this object.
equiv
(other)Compare equivalence between DESC objects.
expand
(x[, surface_label])Expand
x
by duplicating elements to match the grid's pattern.load
(load_from[, file_format])Initialize from file.
replace_at_axis
(x, y[, copy])Replace elements of
x
with elements ofy
at the axis of grid.save
(file_name[, file_format, file_mode])Save the object.
Attributes
Radial grid resolution.
Poloidal grid resolution.
Toroidal grid resolution.
Number of (toroidal) field periods.
Indices of nodes at magnetic axis.
Whether the grid is made of open or closed intervals.
Indices of unique_rho_idx that recover the rho coordinates.
Indices of unique_theta_idx that recover the theta coordinates.
Indices of unique_zeta_idx that recover the zeta coordinates.
Pattern for placement of nodes in (rho,theta,zeta).
Node coordinates, in (rho,theta,zeta).
Total number of nodes.
Number of unique rho coordinates.
Number of unique theta coordinates.
Number of unique zeta coordinates.
Node spacing, in (rho,theta,zeta).
True for stellarator symmetry, False otherwise.
Indices of unique rho coordinates.
Indices of unique theta coordinates.
Indices of unique zeta coordinates.
Weight for each node, either exact quadrature or volume based.