m_omp_poisson_fft Module


Uses

  • module~~m_omp_poisson_fft~~UsesGraph module~m_omp_poisson_fft m_omp_poisson_fft decomp_2d decomp_2d module~m_omp_poisson_fft->decomp_2d decomp_2d_constants decomp_2d_constants module~m_omp_poisson_fft->decomp_2d_constants decomp_2d_fft decomp_2d_fft module~m_omp_poisson_fft->decomp_2d_fft module~m_common m_common module~m_omp_poisson_fft->module~m_common module~m_field m_field module~m_omp_poisson_fft->module~m_field module~m_mesh m_mesh module~m_omp_poisson_fft->module~m_mesh module~m_omp_spectral m_omp_spectral module~m_omp_poisson_fft->module~m_omp_spectral module~m_poisson_fft m_poisson_fft module~m_omp_poisson_fft->module~m_poisson_fft module~m_tdsops m_tdsops module~m_omp_poisson_fft->module~m_tdsops mpi mpi module~m_common->mpi module~m_field->module~m_common module~m_mesh->module~m_common module~m_mesh->module~m_field iso_fortran_env iso_fortran_env module~m_mesh->iso_fortran_env module~m_mesh_content m_mesh_content module~m_mesh->module~m_mesh_content module~m_mesh->mpi module~m_omp_spectral->module~m_common module~m_poisson_fft->module~m_common module~m_poisson_fft->module~m_field module~m_poisson_fft->module~m_mesh module~m_poisson_fft->module~m_tdsops module~m_tdsops->module~m_common module~m_tdsops->iso_fortran_env module~m_mesh_content->module~m_common

Used by

  • module~~m_omp_poisson_fft~~UsedByGraph module~m_omp_poisson_fft m_omp_poisson_fft proc~init_omp_poisson_fft m_omp_backend::omp_backend_t%init_omp_poisson_fft proc~init_omp_poisson_fft->module~m_omp_poisson_fft

Interfaces

public interface omp_poisson_fft_t

  • private function init(mesh, xdirps, ydirps, zdirps, lowmem) result(poisson_fft)

    Arguments

    Type IntentOptional Attributes Name
    type(mesh_t), intent(in), target :: mesh
    class(dirps_t), intent(in) :: xdirps
    class(dirps_t), intent(in) :: ydirps
    class(dirps_t), intent(in) :: zdirps
    logical, intent(in), optional :: lowmem

    Return Value type(omp_poisson_fft_t)


Derived Types

type, public, extends(poisson_fft_t) ::  omp_poisson_fft_t

FFT based Poisson solver

Components

Type Visibility Attributes Name Initial
type(mesh_t), public, pointer :: mesh => null()
integer, public :: nx_glob

Global dimensions

integer, public :: ny_glob

Global dimensions

integer, public :: nz_glob

Global dimensions

integer, public :: nx_loc

Local dimensions

integer, public :: ny_loc

Local dimensions

integer, public :: nz_loc

Local dimensions

integer, public :: nx_perm

Local dimensions in the permuted slabs

integer, public :: ny_perm

Local dimensions in the permuted slabs

integer, public :: nz_perm

Local dimensions in the permuted slabs

integer, public :: nx_spec

Local dimensions in the permuted slabs in spectral space

integer, public :: ny_spec

Local dimensions in the permuted slabs in spectral space

integer, public :: nz_spec

Local dimensions in the permuted slabs in spectral space

integer, public :: sp_st(3)

Offset per spectral dimension (dim1, dim2, dim3) in spectral space

complex(kind=dp), public, allocatable, dimension(:, :, :) :: waves

Local domain sized array storing the spectral equivalence constants

real(kind=dp), public, allocatable, dimension(:) :: ax

Wave numbers in x, y, and z

real(kind=dp), public, allocatable, dimension(:) :: bx

Wave numbers in x, y, and z

real(kind=dp), public, allocatable, dimension(:) :: ay

Wave numbers in x, y, and z

real(kind=dp), public, allocatable, dimension(:) :: by

Wave numbers in x, y, and z

real(kind=dp), public, allocatable, dimension(:) :: az

Wave numbers in x, y, and z

real(kind=dp), public, allocatable, dimension(:) :: bz

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: kx

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: ky

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: kz

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: exs

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: eys

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: ezs

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: k2x

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: k2y

Wave numbers in x, y, and z

complex(kind=dp), public, allocatable, dimension(:) :: k2z

Wave numbers in x, y, and z

real(kind=dp), public, allocatable, dimension(:) :: trans_x_re

Staggared grid transformation

real(kind=dp), public, allocatable, dimension(:) :: trans_x_im

Staggared grid transformation

real(kind=dp), public, allocatable, dimension(:) :: trans_y_re

Staggared grid transformation

real(kind=dp), public, allocatable, dimension(:) :: trans_y_im

Staggared grid transformation

real(kind=dp), public, allocatable, dimension(:) :: trans_z_re

Staggared grid transformation

real(kind=dp), public, allocatable, dimension(:) :: trans_z_im

Staggared grid transformation

logical, public :: periodic_x

Periodicity in x, y, and z

logical, public :: periodic_y

Periodicity in x, y, and z

logical, public :: periodic_z

Periodicity in x, y, and z

logical, public :: stretched_y = .false.

Periodicity in x, y, and z

logical, public :: stretched_y_sym

Periodicity in x, y, and z

real(kind=dp), public, allocatable, dimension(:, :, :, :) :: a_odd_re

Stretching operator matrices

real(kind=dp), public, allocatable, dimension(:, :, :, :) :: a_odd_im

Stretching operator matrices

real(kind=dp), public, allocatable, dimension(:, :, :, :) :: a_even_re

Stretching operator matrices

real(kind=dp), public, allocatable, dimension(:, :, :, :) :: a_even_im

Stretching operator matrices

real(kind=dp), public, allocatable, dimension(:, :, :, :) :: a_re

Stretching operator matrices

real(kind=dp), public, allocatable, dimension(:, :, :, :) :: a_im

Stretching operator matrices

logical, public :: lowmem = .false.

lowmem option, only used in CUDA backend

procedure(poisson_xxx), public, pointer :: poisson => null()

Procedure pointer to BC specific poisson solvers

complex(kind=dp), public, allocatable, dimension(:, :, :) :: c_x
complex(kind=dp), public, allocatable, dimension(:, :, :) :: c_y
complex(kind=dp), public, allocatable, dimension(:, :, :) :: c_z
logical, public :: is_100_case = .false.

Non-periodic in x, periodic in y and z

integer, public :: p_row = 1

2decomp processor grid. p_row splits y in the x-pencil, p_col splits z.

integer, public :: p_col = 1

2decomp processor grid. p_row splits y in the x-pencil, p_col splits z.

type(decomp_info), public, pointer :: ph => null()

Physical space decomposition owned by the FFT. The 100 case builds the transform on the swapped cell grid (ny, nx, nz), so ph%xsz is exactly the layout the transform reads, and ph%ysz is what a local dim1/dim2 swap of the untransposed x-pencil lands on. decomp_main cannot serve here because it is built on vertex dims.

real(kind=dp), public, allocatable, dimension(:, :, :) :: r_yp

Y-pencil staging buffer of ph, only needed when y is decomposed.

type(decomp_info), public, pointer :: sp => null()

Spectral decomposition, and its y-pencil staging buffers. The FFT leaves the spectral slab in a z-pencil, where dim2 (the x modes) is split across p_col. The paired split in the postprocess couples a mode with its mirror in that same direction, so it needs dim2 whole. The y-pencil of the very same decomposition has dim2 complete for any processor grid, so 2decomp's own transpose delivers exactly the layout the pairing wants. waves is redistributed once, at init. sp is associated for every case, since init also reads the spectral slab extents from it, but c_pair and waves_pair exist only when the pairing actually needs the hop.

complex(kind=dp), public, allocatable, dimension(:, :, :) :: c_pair
complex(kind=dp), public, allocatable, dimension(:, :, :) :: waves_pair
real(kind=dp), public, allocatable, dimension(:, :, :) :: r_tr

Exact sized, x-y transposed real work buffer for the 100 case. The FFT is initialised with the x and y dimensions swapped so that the r2c transform runs along the periodic y direction and the non-periodic x direction keeps its full mode range in dim2, which is what the paired split in the spectral postprocess needs. The buffer is also exactly (ny, nx, nz) rather than padded up to a multiple of SZ, because 2decomp plans its FFTW transforms over the flat array and a padded one would be read with the wrong stride.

Constructor

private function init (mesh, xdirps, ydirps, zdirps, lowmem)

Type-Bound Procedures

procedure, public :: base_init
procedure, public :: solve_poisson
procedure, public :: stretching_matrix
procedure, public :: waves_set
procedure, public :: get_km
procedure, public :: get_km_re
procedure, public :: get_km_im
procedure, public :: fft_forward => fft_forward_omp
procedure, public :: fft_forward_010 => fft_forward_omp
procedure, public :: fft_forward_100 => fft_forward_100_omp
procedure, public :: fft_forward_110 => fft_forward_110_omp
procedure, public :: fft_backward => fft_backward_omp
procedure, public :: fft_backward_010 => fft_backward_omp
procedure, public :: fft_backward_100 => fft_backward_100_omp
procedure, public :: fft_backward_110 => fft_backward_110_omp
procedure, public :: fft_postprocess_000 => fft_postprocess_000_omp
procedure, public :: fft_postprocess_010 => fft_postprocess_010_omp
procedure, public :: fft_postprocess_100 => fft_postprocess_100_omp
procedure, public :: fft_postprocess_110 => fft_postprocess_110_omp
procedure, public :: enforce_periodicity_x => enforce_periodicity_x_omp
procedure, public :: undo_periodicity_x => undo_periodicity_x_omp
procedure, public :: enforce_periodicity_y => enforce_periodicity_y_omp
procedure, public :: undo_periodicity_y => undo_periodicity_y_omp
procedure, public :: enforce_periodicity_xy => enforce_periodicity_xy_omp
procedure, public :: undo_periodicity_xy => undo_periodicity_xy_omp

Subroutines

public subroutine fft_forward_omp(self, f_in)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(in) :: f_in

public subroutine fft_forward_010_omp(self, f_in)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(in) :: f_in

public subroutine fft_forward_100_omp(self, f_in)

Forward FFT for the non-periodic x case. Transposes x and y so that the non-periodic direction sits in dim2, where it keeps its full mode range, then transforms the (ny, nx, nz) buffer with the swapped plan set up in init.

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(in) :: f_in

public subroutine fft_forward_110_omp(self, f_in)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(in) :: f_in

public subroutine fft_backward_omp(self, f_out)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out

public subroutine fft_backward_010_omp(self, f_out)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out

public subroutine fft_backward_100_omp(self, f_out)

Backward FFT for the non-periodic x case, undoing the x-y transpose applied by fft_forward_100_omp. Only the unpadded extents are written, which is all undo_periodicity_x_omp goes on to read.

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out

public subroutine fft_backward_110_omp(self, f_out)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out

public subroutine fft_postprocess_000_omp(self)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self

public subroutine fft_postprocess_010_omp(self)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self

public subroutine fft_postprocess_100_omp(self)

Post-process div U* in spectral space for the non-periodic x case.

Read more…

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self

public subroutine fft_postprocess_110_omp(self)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self

public subroutine enforce_periodicity_x_omp(self, f_out, f_in)

Gathers the non-periodic x line into a periodic one so that a plain FFT can stand in for the cosine transform. Unlike the y version below this handles an odd nx, which the 100 case requires.

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out
class(field_t), intent(in) :: f_in

public subroutine undo_periodicity_x_omp(self, f_out, f_in)

Scatters the gathered x line back to its original ordering.

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out
class(field_t), intent(in) :: f_in

public subroutine enforce_periodicity_y_omp(self, f_out, f_in)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out
class(field_t), intent(in) :: f_in

public subroutine undo_periodicity_y_omp(self, f_out, f_in)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out
class(field_t), intent(in) :: f_in

public subroutine enforce_periodicity_xy_omp(self, f_out, f_in)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out
class(field_t), intent(in) :: f_in

public subroutine undo_periodicity_xy_omp(self, f_out, f_in)

Arguments

Type IntentOptional Attributes Name
class(omp_poisson_fft_t) :: self
class(field_t), intent(inout) :: f_out
class(field_t), intent(in) :: f_in