pleiades.FieldsOperator

class pleiades.FieldsOperator(mesh=None, rank=1, **kwargs)[source]

Mixin class for computing fields on meshes

Parameters:
  • mesh (pleiades.Mesh object) – The mesh to use for calculating fields
  • rank (int (1 or 2)) – Indicator of whether the current attribute is a scalar or vector
  • Variables
  • ---------
  • current (float or ndarray) – Current values in this object
  • rzw (ndarray or list of ndarray) – Nx3 arrays of centroid positions and weights
  • mesh – The mesh to use for calculating fields
BR(current=None, mesh=None)[source]

Compute the radial component of the magnetic field, BR.

Parameters:current (float, optional) – Specify a current value to override the current attribute for calculating the field. Defaults to None, which causes the current attribute to be used for the calculation
Returns:BR
Return type:np.array
BZ(current=None, mesh=None)[source]

Compute the z component of the magnetic field, BZ.

Parameters:current (float, optional) – Specify a current value to override the current attribute for calculating the field. Defaults to None, which causes the current attribute to be used for the calculation
Returns:BZ
Return type:np.array
gBR(mesh=None)[source]

Compute the Green’s function for the radial magnetic field, BR

Parameters:mesh (ndarray, optional) – An Nx2 array of points representing (R, Z) coordinates at which to calculate BR. Defaults to None, in which case the CurrentFilamentSet.mesh attribute is used.
Returns:gBR – 1D array representing the Green’s function for BR and whose size is equal to the number of mesh.
Return type:ndarray
gBZ(mesh=None)[source]

Compute the Green’s function for the vertical magnetic field, BZ

Parameters:mesh (ndarray, optional) – An Nx2 array of points representing (R, Z) coordinates at which to calculate BZ. Defaults to None, in which case the CurrentFilamentSet.mesh attribute is used.
Returns:gBZ – 1D array representing the Green’s function for BZ and whose size is equal to the number of mesh.
Return type:ndarray
gpsi(mesh=None)[source]

Compute the Green’s function for magnetic flux, \(psi\).

Parameters:mesh (ndarray, optional) – An Nx2 array of points representing (R, Z) coordinates at which to calculate the magnetic flux. Defaults to None, in which case the CurrentFilamentSet.mesh attribute is used.
Returns:gpsi – 1D array representing the Green’s function for flux and whose size is equal to the number of mesh.
Return type:ndarray
psi(current=None, mesh=None)[source]

Compute the magnetic flux, \(psi\).

Parameters:
  • current (float, optional) – Specify a current value in amps to use instead of CurrentFilamentSet.current. Defaults to None, in which case the current attribute is used to calculate the flux.
  • mesh (ndarray, optional) – An Nx2 array of points representing (R, Z) coordinates at which to calculate the magnetic flux. Defaults to None, in which case the CurrentFilamentSet.mesh attribute is used.
Returns:

psi

Return type:

ndarray