dftd3_fourier_fft Module

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.


Uses


Derived Types

type, public ::  fft_mesh

Twiddle factors shared by the transforms along all three mesh directions

Components

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


Functions

public pure function valid_mesh_size(npoint) result(nmesh)

Smallest supported mesh size not below the requested number of points

Arguments

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

Requested number of mesh points

Return Value integer

Supported number of mesh points


Subroutines

public subroutine fft_3d(self, grid, isign)

Transform along all three directions, isign selects forward (-1) or backward (+1)

Arguments

Type IntentOptional 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

public subroutine new_fft_mesh(self, mesh)

Tabulate the roots of unity for transforms on the given mesh

Arguments

Type IntentOptional Attributes Name
type(fft_mesh), intent(out) :: self

Instance of the transform

integer, intent(in) :: mesh(3)

Number of points along each direction