desc.magnetic_fields.SourceFreeField

class desc.magnetic_fields.SourceFreeField(surface, M, N, NFP=None, sym=False, B0=None, I=0.0, Y=0.0)Source

Compute source free magnetic fields.

Implements the Neumann formulation in multiply connected geometry described in [1]_.

Let 𝒳 be an open set with continuously differentiable closed boundary ∂𝒳. This class solves the following partial differential equation for varphi = φ = Φ (periodic) = Phi (periodic).

  • ∆φ(x) = 0 x ∈ 𝒳

  • (B - ∇φ - B₀)(x) = 0 x ∈ 𝒳

  • n dot (∇φ + B₀)(x) = 0 x ∈ ∂𝒳

  • n dot B(x) = 0 x ∈ ∂𝒳

  • curl (B - B₀)(x) = 0 x ∉ ∂𝒳

  • div B(x) = 0 ∀x

Parameters:
  • surface (Surface) – Geometry defining ∂𝒳.

  • M (int) – Poloidal Fourier resolution to interpolate potential on ∂𝒳.

  • N (int) – Toroidal Fourier resolution to interpolate potential on ∂𝒳.

  • NFP (int) – Field periodicity of potential on ∂𝒳. Default is surface.NFP which is correct only if the globally defined part of B0 produces an NFP periodic field.

  • sym (str) – Symmetry for Fourier basis interpolating the periodic part of the potential. Default is False.

  • B0 (_MagneticField) – Magnetic field due to currents in 𝒳 and net currents outside 𝒳

  • I (float) – Net toroidal current determining a circulation of Φ (not φ). Default is zero.

  • Y (float) – Net poloidal current determining a circulation of Φ (not φ). Default is zero.

Methods

change_resolution(*args, **kwargs)

Change the maximum poloidal and toroidal resolution.

compute(names, grid[, params, transforms, ...])

Compute the quantity given by name on grid.

constant_offset_surface(offset[, grid, M, ...])

Create a new FourierRZToroidalSurface with constant offset from self.

copy([deepcopy])

Return a (deep)copy of this object.

equiv(other)

Compare equivalence between DESC objects.

from_input_file(path, **kwargs)

Create a surface from Fourier coefficients in a DESC or VMEC input file.

from_qp_model([major_radius, aspect_ratio, ...])

Create a surface from a near-axis model for quasi-poloidal symmetry.

from_shape_parameters([major_radius, ...])

Create a surface using a generalized Miller parameterization.

from_values(coords, theta[, zeta, M, N, ...])

Create a surface from given R,Z coordinates in real space.

get_axis()

Get the axis of the surface.

get_coeffs(m[, n])

Get Fourier coefficients for given mode number(s).

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.

set_coeffs(m[, n, R, Z])

Set specific Fourier coefficients.

unpack_params(x)

Convert a single array of concatenated parameters into a dictionary.

Attributes

L

Maximum radial mode number.

M

Maximum poloidal mode number.

M_Phi

Poloidal resolution of periodic part of Phi.

N

Maximum toroidal mode number.

NFP

Number of (toroidal) field periods.

N_Phi

Toroidal resolution of periodic part of Phi.

Phi_basis

Basis for periodic part of potential.

R_basis

Spectral basis for R.

R_lmn

Spectral coefficients for R.

Z_basis

Spectral basis for Z.

Z_lmn

Spectral coefficients for Z.

dim_x

total number of optimizable parameters.

dimensions

dictionary of integers of sizes of each optimizable parameter.

name

Name of the surface.

optimizable_params

string names of parameters that have been declared optimizable.

params_dict

dictionary of arrays of optimizable parameters.

rho

Flux surface label.

surface

Surface geometry defining boundary.

sym

Whether the surface is stellarator symmetric.

sym_Phi

Type of symmetry of periodic part of Phi (no symmetry if False).

x_idx

arrays of indices for each parameter in concatenated array.