desc.equilibrium.Equilibrium.is_nested

Equilibrium.is_nested(grid=None, R_lmn=None, Z_lmn=None, msg=None)

Check that an equilibrium has properly nested flux surfaces in a plane.

Does so by checking coordianate Jacobian (sqrt(g)) sign. If coordinate Jacobian switches sign somewhere in the volume, this indicates that it is zero at some point, meaning surfaces are touching and the equilibrium is not nested.

NOTE: If grid resolution used is too low, or the solution is just barely unnested, this function may fail to return the correct answer.

Parameters:
  • grid (Grid, optional) – Grid on which to evaluate the coordinate Jacobian and check for the sign. (Default to QuadratureGrid with eq’s current grid resolutions)

  • R_lmn (ndarray, optional) – spectral coefficients for R and Z. Defaults to eq.R_lmn, eq.Z_lmn

  • Z_lmn (ndarray, optional) – spectral coefficients for R and Z. Defaults to eq.R_lmn, eq.Z_lmn

  • msg ({None, "auto", "manual"}) – Warning to throw if unnested.

Returns:

is_nested (bool) – whether the surfaces are nested