Stellarator-Tools
Loading...
Searching...
No Matches
fourier::fourier_class Interface Reference

Base class containing fourier memory. More...

Public Member Functions

procedure, pass toijsp_2d (this, xmn, xuv, dflag, parity)
 Fourier transform a 2D quantity to real space.
 
procedure, pass toijsp_3d (this, xmn, xuv, dflag, parity)
 Convert a quantity from fourier to real space in parallel.
 
GENERIC toijsp toijsp_2d, toijsp_3d
 
procedure, pass tomnsp_3d (this, xuv, xmn, parity)
 Convert a quantity from real to fourier space in parallel.
 
procedure, pass tomnsp_2d (this, xuv, xmn, parity)
 Fourier transform a 2D quantity to fourier space.
 
procedure, pass tomnsp_2d_u (this, xuv)
 Sum over the poloidal part.
 
procedure, pass tomnsp_2d_v (this, xmn, parity)
 Sum over toroidal angle.
 
procedure, pass tomnsp_3d_pest (this, xuv, xmn, lmns, lmnc,
 Convert a quantity from real to fourier space in pest coordinates.
 
procedure, pass tomnsp_2d_pest (this, xuv, xmn, lambda, dup
 Fourier transform a 2D quantity to fourier space.
 
procedure, pass tomnsp_2d_u_pest (this, xuv, lambda, dupdu,
 Sum over the poloidal part.
 
GENERIC tomnsp tomnsp_2d, tomnsp_3d, tomnsp_2d_u,
 
pass tomnsp_2d_v tomnsp_2d_v
 
pass tomnsp_3d_pest tomnsp_3d_pest
 
pass tomnsp_2d_pest tomnsp_2d_pest
 
pass tomnsp_2d_u_pest tomnsp_2d_u_pest
 
procedure get_origin (this, xuv, mode, asym)
 Computes the origin value of a half-mesh quantity.
 
procedure get_index (this, n)
 The the index position of the toroidal mode if it exists.
 
FINAL fourier_destruct (this)
 Deconstruct a fourier_class object.
 
class(fourier_class) function, pointer fourier_construct (mpol, ntor, ntheta, nzeta, nfp, sym, tor_modes)
 Construct a fourier_class object.
 

Public Attributes

real(dp), dimension(:,:), pointer orthonorm => null()
 Orthonorm factors for normalization.
 
real(dp), dimension(:,:), pointer cosmu => null()
 Cosine poloidal m and u values.
 
real(dp), dimension(:,:), pointer cosmum => null()
 Cosine derivative with respect to u for poloidal m and u values.
 
real(dp), dimension(:,:), pointer cosmui => null()
 Normalized Cosine poloidal m and u values.
 
real(dp), dimension(:,:), pointer cosnv => null()
 Cosine of nv.
 
real(dp), dimension(:,:), pointer cosnvn => null()
 Cosine derivative with respect to v.
 
real(dp), dimension(:,:), pointer sinmu => null()
 Sine poloidal m and u values.
 
real(dp), dimension(:,:), pointer sinmum => null()
 Sine derivative with respect to u for poloidal m and u values.
 
real(dp), dimension(:,:), pointer sinmui => null()
 Normalized Sine poloidal m and u values.
 
real(dp), dimension(:,:), pointer sinnv => null()
 Sine of nv.
 
real(dp), dimension(:,:), pointer sinnvn => null()
 Sine derivative with respect to v.
 
real(dp), dimension(:,:), pointer workmj1 => null()
 Working buffer for first mj terms.
 
real(dp), dimension(:,:), pointer workmj2 => null()
 Working buffer for second mj terms.
 
real(dp), dimension(:,:), pointer workin1 => null()
 Working buffer for first in terms.
 
real(dp), dimension(:,:), pointer workin2 => null()
 Working buffer for second in terms.
 
integer, dimension(:), pointer tor_modes => null()
 Toroidal mode numbers.
 

Detailed Description

Base class containing fourier memory.

Interface for the fourier constructor.

Member Function/Subroutine Documentation

◆ fourier_construct()

class (fourier_class) function, pointer fourier::fourier_class::fourier_construct ( integer, intent(in)  mpol,
integer, intent(in)  ntor,
integer, intent(in)  ntheta,
integer, intent(in)  nzeta,
integer, intent(in)  nfp,
logical, intent(in)  sym,
integer, dimension(-ntor:ntor), intent(in)  tor_modes 
)

Construct a fourier_class object.

Allocates memory and initializes a fourier_class object. Computes the othronorm and cosine and sine buffers.

This subroutine computes the cosine-sine factors that will be needed when moving between Fourier and real space. All normalizations are contained in the poloidal quantities used in the Fourier to real space transformation:

  • sinmui
  • cosmui

Fourier representations are assumed to have stellarator symmetry: *# cosine (iparity=0): C(u, v) = sum_u sum_v (C_mn COS(mu + n*nfp*v)) *# sine (iparity=1): S(u, v) = sum_u sum_v (S_mn SIN(mu + n*nfp*v))

The number of collocation points have been set initalially equal to the number of modes: theta_j = j*pi/M, j = 0,...,M Where M = mpol - 1 zeta_k = k*2*pi/(2N + 1) k = 0,...,2N Where N = ntor.

Parameters
[in]mpolNumber of poloidal modes.
[in]ntorNumber of toroidal modes.
[in]nthetaNumber of poloidal real grid points.
[in]nzetaNumber of toroidal real grid points.
[in]nfpNumber of field periods.
[in]symSymmetry flag.
[in]tor_modesToroidal mode numbers.

◆ fourier_destruct()

FINAL fourier::fourier_class::fourier_destruct ( type (fourier_class), intent(inout)  this)
final

Deconstruct a fourier_class object.

Deallocates memory and uninitializes a fourier_class object.

Parameters
[in,out]thisA fourier_class instance.

◆ get_index()

procedure fourier::fourier_class::get_index ( class (fourier_class), intent(inout)  this,
integer, intent(inout)  n 
)

The the index position of the toroidal mode if it exists.

Parameters
[in,out]thisA fourier_class instance.
[in,out]nToroidal mode number to check the index on exit.
Returns
True if the mode number was found.

◆ get_origin()

procedure fourier::fourier_class::get_origin ( class (fourier_class), intent(inout)  this,
real(dp), dimension(:,:,:), intent(inout), allocatable  xuv,
integer, intent(in)  mode,
logical, intent(in)  asym 
)

Computes the origin value of a half-mesh quantity.

The origin quantity is found from the m mode of the js = 2 value.

Parameters
[in,out]thisA fourier_class instance.
[in,out]xuvReal space quantity.
[in]modePoloidal mode number to be retained.
[in]asymAdd stellarator asymmetric terms.

◆ toijsp_2d()

procedure, pass fourier::fourier_class::toijsp_2d ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:), intent(in)  xmn,
real (dp), dimension(:,:), intent(inout)  xuv,
integer, intent(in)  dflag,
integer, intent(in)  parity 
)

Fourier transform a 2D quantity to real space.

Works by reshaping to a 3D array then passing to the normal 3D version.

Parameters
[in]thisA fourier_class instance.
[in]xmnFourier space quantity.
[in,out]xuvReal space quantity.
[in]dflagDerivative and sum control flags.
[in]parityFourier parity flag.

◆ toijsp_3d()

procedure, pass fourier::fourier_class::toijsp_3d ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:,:), intent(in)  xmn,
real (dp), dimension(:,:,:), intent(inout)  xuv,
integer, intent(in)  dflag,
integer, intent(in)  parity 
)

Convert a quantity from fourier to real space in parallel.

This subroutine moves a quantity to real space by summing over its Fourier harmonics. If the f_du flag is set take the poloidal derivative. If the f_dv flag is set take the toroidal derivative. If the f_sum flag is set add the real quanity to the previous value.

Parameters
[in]thisA fourier_class instance.
[in]xmnFourier space quantity.
[in,out]xuvReal space quantity.
[in]dflagDerivative and sum control flags.
[in]parityFourier parity flag.

◆ tomnsp_2d()

procedure, pass fourier::fourier_class::tomnsp_2d ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:), intent(in)  xuv,
real (dp), dimension(:,:), intent(out)  xmn,
integer, intent(in)  parity 
)

Fourier transform a 2D quantity to fourier space.

Works by reshaping to a 3D array then passing to the normal 3D version. Have the 3D function call the 2D function for each slice.

Parameters
[in,out]thisA fourier_class instance.
[in]xuvFourier space quantity.
[out]xmnReal space quantity.
[in]parityFourier parity flag.

◆ tomnsp_2d_pest()

procedure, pass fourier::fourier_class::tomnsp_2d_pest ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:), intent(in)  xuv,
real (dp), dimension(:,:), intent(out)  xmn,
real (dp), dimension(:,:), intent(in)  lambda,
  dup 
)

Fourier transform a 2D quantity to fourier space.

Works by reshaping to a 3D array then passing to the normal 3D version. Have the 3D function call the 2D function for each slice.

Parameters
[in,out]thisA fourier_class instance.
[in]xuvFourier space quantity.
[out]xmnReal space quantity.
[in]lambdaStellarator symmetric lambda.
[in]dupduStellarator asymmetric lambda.
[in]parityFourier parity flag.
[in]asymAdd stellarator asymmetric terms.

◆ tomnsp_2d_u()

procedure, pass fourier::fourier_class::tomnsp_2d_u ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:), intent(in)  xuv 
)

Sum over the poloidal part.

Pest transforms use the same sum over v but different sums over u. To encourage code reuse break the u and v sums into separate methods. This version uses the regular poloidal sum.

Parameters
[in,out]thisA fourier_class instance.
[in]xuvFourier space quantity.

◆ tomnsp_2d_u_pest()

procedure, pass fourier::fourier_class::tomnsp_2d_u_pest ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:), intent(in)  xuv,
real (dp), dimension(:,:), intent(in)  lambda,
real (dp), dimension(:,:), intent(in)  dupdu 
)

Sum over the poloidal part.

Pest transforms use the same sum over v but different sums over u. To encourage code reuse break the u and v sums into separate methods. This version uses the lambda poloidal sum.

Parameters
[in,out]thisA fourier_class instance.
[in]xuvFourier space quantity.
[in]lmnsStellarator symmetric lambda.
[in]lmncStellarator asymmetric lambda.
[in]asymAdd stellarator asymmetric terms.

◆ tomnsp_2d_v()

procedure, pass fourier::fourier_class::tomnsp_2d_v ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:), intent(out)  xmn,
integer, intent(in)  parity 
)

Sum over toroidal angle.

Pest transforms use the same sum over v but different sums over u. To encourage code reuse break the u and v sums into separate methods. This impliments the common toroidal sum.

Parameters
[in]thisA fourier_class instance.
[in]xuvFourier space quantity.
[out]xmnReal space quantity.
[in]parityFourier parity flag.

◆ tomnsp_3d()

procedure, pass fourier::fourier_class::tomnsp_3d ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:,:), intent(in)  xuv,
real (dp), dimension(:,:,:), intent(out)  xmn,
integer, intent(in)  parity 
)

Convert a quantity from real to fourier space in parallel.

This subroutine moves a 3D quantity to fourier space by summing over its real represenetation for each surface.

See also
fourier_tomnsp_2d
Parameters
[in,out]thisA fourier_class instance.
[in]xuvReal space quantity.
[out]xmnFourier space quantity.
[in]parityFourier parity flag.

◆ tomnsp_3d_pest()

procedure, pass fourier::fourier_class::tomnsp_3d_pest ( class (fourier_class), intent(inout)  this,
real (dp), dimension(:,:,:), intent(in)  xuv,
real (dp), dimension(:,:,:), intent(out)  xmn,
real (dp), dimension(:,:,:), intent(in)  lmns,
real (dp), dimension(:,:,:), intent(in)  lmnc 
)

Convert a quantity from real to fourier space in pest coordinates.

This subroutine moves a 3D quantity to fourier space by summing over its real represenetation for each surface.

See also
fourier_tomnsp_2d_pest.
Parameters
[in,out]thisA fourier_class instance.
[in]xuvReal space quantity.
[out]xmnFourier space quantity.
[in]lmnsStellarator symmetric lambda.
[in]lmncStellarator asymmetric lambda.
[in]parityFourier parity flag.
[in]asymAdd stellarator asymmetric terms.

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