desc.magnetic_fields.PoloidalMagneticField

class desc.magnetic_fields.PoloidalMagneticField(B0, R0, iota)Source

Pure poloidal magnetic field (ie in theta direction).

Field strength is B0*iota*r/R0 where B0 is the toroidal field on axis, R0 is the major radius of the axis, iota is the desired rotational transform, and r is the minor radius centered on the magnetic axis.

Combined with a toroidal field with the same B0 and R0, creates an axisymmetric field with rotational transform iota

Note that the divergence of such a field is proportional to Z/R so is generally nonzero except on the midplane, but still serves as a useful test case

Parameters:
  • B0 (float) – field strength on axis

  • R0 (float) – major radius of magnetic axis

  • iota (float) – desired rotational transform

Methods

compute_Bnormal(surface[, eval_grid, ...])

Compute Bnormal from self on the given surface.

compute_magnetic_field(coords[, params, ...])

Compute magnetic field at a set of points.

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.

save_BNORM_file(surface, fname[, basis_M, ...])

Create BNORM-style .txt file containing Bnormal Fourier coefficients.

save_mgrid(path, Rmin, Rmax, Zmin, Zmax[, ...])

Save the magnetic field to an mgrid NetCDF file in "raw" format.

unpack_params(x)

Convert a single array of concatenated parameters into a dictionary.

Attributes

B0

field strength on axis.

R0

major radius of axis.

dim_x

total number of optimizable parameters.

dimensions

dictionary of integers of sizes of each optimizable parameter.

iota

desired rotational transform.

optimizable_params

string names of parameters that have been declared optimizable.

params_dict

dictionary of arrays of optimizable parameters.

x_idx

arrays of indices for each parameter in concatenated array.