desc.magnetic_fields.VectorPotentialField

class desc.magnetic_fields.VectorPotentialField(potential, params=None, NFP=1)Source

Magnetic field due to a vector magnetic potential in cylindrical coordinates.

Parameters:
  • potential (callable) – function to compute the vector potential. Should have a signature of the form potential(R,phi,Z,*params) -> ndarray. R,phi,Z are arrays of cylindrical coordinates.

  • params (dict, optional) – default parameters to pass to potential function

  • NFP (int, optional) – Whether the field has a discrete periodicity. This is only used when making a SplineMagneticField from this field using its from_field method, or when saving this field as an mgrid file using the save_mgrid method.

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.

compute_magnetic_vector_potential(coords[, ...])

Compute magnetic vector potential 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.

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.

Attributes

NFP

Number of (toroidal) field periods.