desc.grid.Grid.create_meshgrid

static Grid.create_meshgrid(nodes, spacing=None, coordinates='rtz', period=None, NFP=1, jitable=True, **kwargs)Source

Create a tensor-product grid from the given coordinates in a jitable manner.

Parameters:
  • nodes (list of ndarray) – Three arrays, one for each coordinate. Unique values of each coordinate sorted in increasing order.

  • spacing (list of ndarray) – Three arrays, one for each coordinate. Weights for integration. Defaults to a midpoint rule.

  • coordinates (str) – Coordinates that are specified by the nodes[0], nodes[1], and nodes[2], respectively. raz : rho, alpha, zeta rvp : rho, theta_PEST, phi rtz : rho, theta, zeta

  • period (tuple of float) – Assumed periodicity for each coordinate. Use np.inf to denote no periodicity.

  • NFP (int) – Number of field periods (Default = 1). Only makes sense to change from 1 if last coordinate is periodic with some constant divided by NFP and the nodes are placed within one field period.

  • jitable (bool) – Whether to skip certain checks and conditionals that don’t work under jit. Allows grid to be created on the fly with custom nodes, but weights, symmetry etc. may be wrong if grid contains duplicate nodes.

Returns:

grid (Grid) – Meshgrid.