![]() |
Stellarator-Tools
|
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. | |
Base class containing fourier memory.
Interface for the fourier constructor.
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:
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.
[in] | mpol | Number of poloidal modes. |
[in] | ntor | Number of toroidal modes. |
[in] | ntheta | Number of poloidal real grid points. |
[in] | nzeta | Number of toroidal real grid points. |
[in] | nfp | Number of field periods. |
[in] | sym | Symmetry flag. |
[in] | tor_modes | Toroidal mode numbers. |
|
final |
Deconstruct a fourier_class object.
Deallocates memory and uninitializes a fourier_class object.
[in,out] | this | A fourier_class instance. |
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.
[in,out] | this | A fourier_class instance. |
[in,out] | n | Toroidal mode number to check the index on exit. |
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.
[in,out] | this | A fourier_class instance. |
[in,out] | xuv | Real space quantity. |
[in] | mode | Poloidal mode number to be retained. |
[in] | asym | Add stellarator asymmetric terms. |
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.
[in] | this | A fourier_class instance. |
[in] | xmn | Fourier space quantity. |
[in,out] | xuv | Real space quantity. |
[in] | dflag | Derivative and sum control flags. |
[in] | parity | Fourier parity flag. |
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.
[in] | this | A fourier_class instance. |
[in] | xmn | Fourier space quantity. |
[in,out] | xuv | Real space quantity. |
[in] | dflag | Derivative and sum control flags. |
[in] | parity | Fourier parity flag. |
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.
[in,out] | this | A fourier_class instance. |
[in] | xuv | Fourier space quantity. |
[out] | xmn | Real space quantity. |
[in] | parity | Fourier parity flag. |
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.
[in,out] | this | A fourier_class instance. |
[in] | xuv | Fourier space quantity. |
[out] | xmn | Real space quantity. |
[in] | lambda | Stellarator symmetric lambda. |
[in] | dupdu | Stellarator asymmetric lambda. |
[in] | parity | Fourier parity flag. |
[in] | asym | Add stellarator asymmetric terms. |
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.
[in,out] | this | A fourier_class instance. |
[in] | xuv | Fourier space quantity. |
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.
[in,out] | this | A fourier_class instance. |
[in] | xuv | Fourier space quantity. |
[in] | lmns | Stellarator symmetric lambda. |
[in] | lmnc | Stellarator asymmetric lambda. |
[in] | asym | Add stellarator asymmetric terms. |
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.
[in] | this | A fourier_class instance. |
[in] | xuv | Fourier space quantity. |
[out] | xmn | Real space quantity. |
[in] | parity | Fourier parity flag. |
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.
[in,out] | this | A fourier_class instance. |
[in] | xuv | Real space quantity. |
[out] | xmn | Fourier space quantity. |
[in] | parity | Fourier parity flag. |
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.
[in,out] | this | A fourier_class instance. |
[in] | xuv | Real space quantity. |
[out] | xmn | Fourier space quantity. |
[in] | lmns | Stellarator symmetric lambda. |
[in] | lmnc | Stellarator asymmetric lambda. |
[in] | parity | Fourier parity flag. |
[in] | asym | Add stellarator asymmetric terms. |