desc.magnetic_fields.OmnigenousField

class desc.magnetic_fields.OmnigenousField(L_B=0, M_B=2, L_x=0, M_x=0, N_x=0, NFP=1, helicity=(1, 0), B_lm=None, x_lmn=None)Source

A magnetic field with perfect omnigenity (but is not necessarily analytic).

Uses parameterization from Dudt et. al. [1]

Parameters:
  • L_B (int) – Resolution of the radial Chebyshev polynomials for magnetic well parameters.

  • M_B (int) – Number of monotonic spline knots per surface of the magnetic well parameters.

  • L_x (int) – Resolution of the radial Chebyshev polynomials for the omnigenity parameters.

  • M_x (int) – Resolution of the Fourier series in eta for the omnigenity parameters.

  • N_x (int) – Resolution of the Fourier series in alpha for the omnigenity parameters.

  • NFP (int) – Number of field periods.

  • helicity (tuple, optional) – Type of pseudo-symmetry (M, N). Default = toroidal contours (1, 0).

  • B_lm (ndarray, optional) – Magnetic well parameters describing ||B||(ρ,η). These values are a flattened 2D array of shape (L_B + 1, M_B), where the rows are Chebyshev coefficients corresponding to the modes in B_basis for the radial variation, and the columns are the values of ||B|| at linearly spaced monotonic spline knots. (The array is flattened in the default row-major or ‘C’-style order.) If not supplied, B_lm defaults to a constant field of 1 T.

  • x_lmn (ndarray, optional) – Omnigenity parameters describing h(ρ,η,α). The coefficients correspond to the modes in x_basis. If not supplied, x_lmn defaults to zero for all modes.

Notes

Doesn’t conform to MagneticField API, as it only knows about \(|B|\) in computational coordinates, not vector B in lab coordinates.

References

Methods

change_resolution([L_B, M_B, L_x, M_x, N_x, NFP])

Set the spectral resolution of field parameters.

compute(names[, grid, params, transforms, ...])

Compute the quantity given by name on grid.

copy([deepcopy])

Return a (deep)copy of this object.

equiv(other)

Compare equivalence between DESC objects.

load(load_from[, file_format])

Initialize from file.

pack_params(p)

Convert a dictionary of parameters into a single array.

save(file_name[, file_format, file_mode])

Save the object.

unpack_params(x)

Convert a single array of concatenated parameters into a dictionary.

Attributes

B_basis

Spectral basis for B_lm.

B_lm

Omnigenity magnetic well shape parameters.

L_B

Radial resolution of the magnetic well parameters well_l.

L_x

Radial resolution of x_lmn.

M_B

Number of spline points in the magnetic well parameters well_l.

M_x

Poloidal resolution of x_lmn.

NFP

Number of (toroidal) field periods.

N_x

Toroidal resolution of x_lmn.

dim_x

total number of optimizable parameters.

dimensions

dictionary of integers of sizes of each optimizable parameter.

helicity

Type of omnigenity (M, N).

optimizable_params

string names of parameters that have been declared optimizable.

params_dict

dictionary of arrays of optimizable parameters.

x_basis

Spectral basis for x_lmn.

x_idx

arrays of indices for each parameter in concatenated array.

x_lmn

Omnigenity coordinate mapping parameters.