fourier_field Module


Uses

  • module~~fourier_field~~UsesGraph module~fourier_field fourier_field interpolate interpolate module~fourier_field->interpolate module~constants constants module~fourier_field->module~constants module~field_base field_base module~fourier_field->module~field_base module~field_base->module~constants

Derived Types

type, public, extends(field_t) ::  fourier_field_t

Magnetic field from a flat list of Boozer Fourier modes, evaluated via 2D spline interpolation.

Read more…

Components

Type Visibility Attributes Name Initial
logical, public :: initialized = .false.
type(SplineData2D), public :: spl
real(kind=dp), public :: nfp
real(kind=dp), public :: B_theta_covariant
real(kind=dp), public :: B_phi_covariant
integer, public :: n_grid
integer, public :: mn_max

Type-Bound Procedures

procedure, public :: compute_B_sqrtg_dB_dx
procedure, public :: compute_B_and_dB_dx
procedure, public :: compute_B_mod
procedure, public :: compute_nabla_s
procedure, public :: rel_accuracy_B
procedure, public :: get_covariant_components

Subroutines

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

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

Read more…

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)

public subroutine ifft_modes_to_B(m, n, B_mn, n_fft, fft_B)

Evaluate B(theta, phi) = sum_k B_mn(k)*cos(m(k)*theta - nfp*n(k)*phi) on the equidistant angle grid by a single 2D inverse FFT.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: m(:)

poloidal mode numbers (flat array)

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

toroidal mode numbers normalised to nfp (flat array)

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

Fourier coefficients of B in Tesla (flat array)

integer, intent(in) :: n_fft

transform length per direction, a power of two above 2*mn_max

real(kind=dp), intent(out) :: fft_B(:,:)

field strength on the open (periodic point excluded) fft angle grid