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.
Convert a single array of concatenated parameters into a dictionary.
Attributes
Spectral basis for B_lm.
Omnigenity magnetic well shape parameters.
Radial resolution of the magnetic well parameters well_l.
Radial resolution of x_lmn.
Number of spline points in the magnetic well parameters well_l.
Poloidal resolution of x_lmn.
Number of (toroidal) field periods.
Toroidal resolution of x_lmn.
total number of optimizable parameters.
dictionary of integers of sizes of each optimizable parameter.
Type of omnigenity (M, N).
string names of parameters that have been declared optimizable.
dictionary of arrays of optimizable parameters.
Spectral basis for x_lmn.
arrays of indices for each parameter in concatenated array.
Omnigenity coordinate mapping parameters.