Complex fast Fourier transform on a three-dimensional mesh.
Self-contained radix-2 implementation, sufficient for the particle mesh evaluation of the dispersion energy which is free to choose its mesh size. Supports powers of two only, a mixed-radix backend would lift the mesh quantisation but only matters once the transform dominates the runtime.
Twiddle factors shared by the transforms along all three mesh directions
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | mesh(3) | = | 0 |
Number of points along each direction |
|
| integer, | public | :: | nmax | = | 0 |
Length of the twiddle table, the largest mesh dimension |
|
| complex(kind=wp), | public, | allocatable | :: | tw(:) |
Roots of unity exp(-2pii*k/nmax) for k = 0 .. nmax/2 - 1 |
Smallest supported mesh size not below the requested number of points
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | npoint |
Requested number of mesh points |
Supported number of mesh points
Transform along all three directions, isign selects forward (-1) or backward (+1)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(fft_mesh), | intent(in) | :: | self |
Instance of the transform |
||
| complex(kind=wp), | intent(inout) | :: | grid(:,:,:) |
Mesh to transform in place |
||
| integer, | intent(in) | :: | isign |
Sign of the exponent |
Tabulate the roots of unity for transforms on the given mesh
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(fft_mesh), | intent(out) | :: | self |
Instance of the transform |
||
| integer, | intent(in) | :: | mesh(3) |
Number of points along each direction |