PB3D [2.47]
Ideal linear high-n MHD stability in 3-D
Loading...
Searching...
No Matches
vmec_utilities::fourier2real Interface Reference

Inverse Fourier transformation, from VMEC. More...

Public Member Functions

integer function fourier2real_1 (varf_c, varf_s, trigon_factors, varr, sym, deriv)
 version with trigonometric factors
integer function fourier2real_2 (varf_c, varf_s, theta, zeta, varr, sym, deriv)
 version with angles

Detailed Description

Inverse Fourier transformation, from VMEC.

Also calculates the poloidal or toroidal derivatives in VMEC coords., as indicated by the variable deriv(2).

(The normal derivative is done on the variables in Fourier space, and should be provided here in varf_i if needed).

There are two variants:

  1. version using trigon_factors, which is useful when the grid on which the trigonometric factors are defined is not regular and ideally when they are reused multiple times.
  2. version using \(\theta\) and \(\zeta\) directly, which is useful for small, unique calculations.

Both these versions make use of a factor that represents angular derivatives. For deriv = [j,k], this is:

  • \(m^j (-n)^k (-1)^{\frac{j+k+1}{2}}\) for varf_c,
  • \(m^j (-n)^k (-1)^{\frac{j+k}{2}}\) for varf_s,

where the divisions have to be done using integers, i.e. without remainder. The first two factors are straightforward, and the third one originates in the change of sign when deriving a cosine, but not for a sine.

Finally, depending on whether \((j+k)\) is even or odd, the correct \(\cos\) or \(\sin\) is chosen.

Returns
ierr

Definition at line 56 of file VMEC_utilities.f90.

Member Function/Subroutine Documentation

◆ fourier2real_1()

integer function vmec_utilities::fourier2real::fourier2real_1 ( real(dp), dimension(:,:), intent(in) varf_c,
real(dp), dimension(:,:), intent(in) varf_s,
real(dp), dimension(:,:,:,:,:), intent(in) trigon_factors,
real(dp), dimension(:,:,:), intent(inout) varr,
logical, dimension(2), intent(in), optional sym,
integer, dimension(2), intent(in), optional deriv )

version with trigonometric factors

Parameters
[in]varf_c\(\cos\) factor of variable in Fourier space
[in]varf_s\(\sin\) factor of variable in Fourier space
[in]trigon_factorstrigonometric factor cosine and sine at these angles (see calc_trigon_factors())
[in,out]varrvariable in real space
[in]symwhether to use varf_c (1) and / or varf_s (2)
[in]derivoptional derivatives in angular coordinates

Definition at line 65 of file VMEC_utilities.f90.

◆ fourier2real_2()

integer function vmec_utilities::fourier2real::fourier2real_2 ( real(dp), dimension(:,:), intent(in) varf_c,
real(dp), dimension(:,:), intent(in) varf_s,
real(dp), dimension(:,:,:), intent(in) theta,
real(dp), dimension(:,:,:), intent(in) zeta,
real(dp), dimension(:,:,:), intent(inout) varr,
logical, dimension(2), intent(in), optional sym,
integer, dimension(2), intent(in), optional deriv )

version with angles

Parameters
[in]varf_c\(\cos\) factor of variable in Fourier space
[in]varf_s\(\sin\) factor of variable in Fourier space
[in]theta\(\theta_\text{E}\)
[in]zeta\(\zeta_\text{E}\)
[in,out]varrvariable in real space
[in]symwhether to use varf_c (1) and / or varf_s (2)
[in]derivoptional derivatives in angular coordinates

Definition at line 163 of file VMEC_utilities.f90.


The documentation for this interface was generated from the following file: