desc.magnetic_fields.ToroidalMagneticField

class desc.magnetic_fields.ToroidalMagneticField(B0, R0)Source

Magnetic field purely in the toroidal (phi) direction.

Magnitude is B0*R0/R where R0 is the major radius of the axis and B0 is the field strength on axis

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

  • R0 (float) – major radius of axis

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.

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.