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 (ndarray of float, optional) – Radial coordinates (Default = 1.0).

  • theta (ndarray of float, optional) – Poloidal coordinates (Default = 0.0).

  • zeta (ndarray of float, optional) – Toroidal coordinates (Default = 0.0).

Methods

change_resolution(L, M, N[, NFP])

Change the resolution of the grid.

copy([deepcopy])

Return a (deep)copy of this object.

eq(other)

Compare equivalence between DESC objects.

load(load_from[, file_format])

Initialize from file.

save(file_name[, file_format, file_mode])

Save the object.

Attributes

L

Radial grid resolution.

M

Poloidal grid resolution.

N

Toroidal grid resolution.

NFP

Number of (toroidal) field periods.

axis

Indices of nodes at magnetic axis.

endpoint

Whether the grid is made of open or closed intervals.

inverse_rho_idx

Indices of unique_rho_idx that recover the rho coordinates.

inverse_theta_idx

Indices of unique_theta_idx that recover the theta coordinates.

inverse_zeta_idx

Indices of unique_zeta_idx that recover the zeta coordinates.

node_pattern

Pattern for placement of nodes in (rho,theta,zeta).

nodes

Node coordinates, in (rho,theta,zeta).

num_nodes

Total number of nodes.

num_rho

Number of unique rho coordinates.

num_theta

Number of unique theta coordinates.

num_zeta

Number of unique zeta coordinates.

spacing

Node spacing, in (rho,theta,zeta).

sym

True for stellarator symmetry, False otherwise.

unique_rho_idx

Indices of unique rho coordinates.

unique_theta_idx

Indices of unique theta coordinates.

unique_zeta_idx

Indices of unique zeta coordinates.

weights

Weight for each node, either exact quadrature or volume based.