desc.grid.ConcentricGrid
- class desc.grid.ConcentricGrid(L, M, N, NFP=1, sym=False, axis=False, node_pattern='jacobi')Source
Grid in which the nodes are arranged in concentric circles.
Nodes are arranged concentrically within each toroidal cross-section, with more nodes per flux surface at larger radius. Typically used as the solution grid, cannot be easily used for plotting due to non-uniform spacing.
- Parameters:
L (int) – radial grid resolution
M (int) – poloidal grid resolution
N (int) – 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 the magnetic axis, False otherwise (Default = False)
node_pattern ({
'cheb1'
,'cheb2'
,'jacobi'
,linear
}) –pattern for radial coordinates
'cheb1'
: Chebyshev-Gauss-Lobatto nodes scaled to r=[0,1]'cheb2'
: Chebyshev-Gauss-Lobatto nodes scaled to r=[-1,1]'jacobi'
: Radial nodes are roots of Shifted Jacobi polynomial of degree M+1 r=(0,1), and angular nodes are equispaced 2(M+1) per surface'ocs'
: optimal concentric sampling to minimize the condition number of the resulting transform matrix, for doing inverse transform.linear
: linear spacing in r=[0,1]
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.
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.