fourier_field_init Subroutine

public subroutine fourier_field_init(field, m, n, B_mn, B_theta_covariant, B_phi_covariant, nfp, n_grid_in)

Uses

  • proc~~fourier_field_init~~UsesGraph proc~fourier_field_init fourier_field_init module~utils utils proc~fourier_field_init->module~utils module~constants constants module~utils->module~constants

Initialise magnetic field from flat Fourier mode lists and evaluated via 2D spline interpolation.

The field strength is given by B(theta, phi) = sum_k B_mn(k) * cos(m(k)*theta - nfp*n(k)*phi) where theta and phi are Boozer angles and nfp the number of field periods. During initialisation the series is evaluated on a n_fft x n_fft equidistant grid of the angles via fft, where n_fft = 2^k >= n_grid_in - 1 for smallest k. It then fits a 2D periodic quintic spline. Note again that n is considered normalized to the number of field periods nfp. If the user does not specificy n_grid_in explicitly, grid is chosen so Nynquist criterion is satisfied.

Arguments

Type IntentOptional Attributes Name
type(fourier_field_t), intent(inout) :: field
integer, intent(in) :: m(:)

poloidal mode numbers (flat array, length mn_max)

integer, intent(in) :: n(:)

toroidal mode numbers normalised to nfp (flat array, length mn_max)

real(kind=dp), intent(in) :: B_mn(:)

Fourier coefficients of B in Tesla (flat array, length mn_max)

real(kind=dp), intent(in) :: B_theta_covariant

covariant poloidal component of B in T*m

real(kind=dp), intent(in) :: B_phi_covariant

covariant toroidal component of B in T*m

integer, intent(in), optional :: nfp

number of field periods

integer, intent(in), optional :: n_grid_in

spline grid points per angle (rounded up to 2^k + 1 for fft init)


Calls

proc~~fourier_field_init~~CallsGraph proc~fourier_field_init fourier_field_init construct_splines_2d construct_splines_2d proc~fourier_field_init->construct_splines_2d proc~ifft_modes_to_b ifft_modes_to_B proc~fourier_field_init->proc~ifft_modes_to_b proc~linspace linspace proc~fourier_field_init->proc~linspace