DIRECT periodic Poisson solver (spectral FFT) DISTRIBUTED, models EllipticSolver.
More...
DIRECT periodic Poisson solver (spectral FFT) DISTRIBUTED, models EllipticSolver.
Role: distributed variant of PoissonFFTSolver. The periodic domain is split into SLABS (slabs, 1 box per rank – the FFT solver's native layout); PoissonFFT does the parallel transpose (MPI_Alltoall) internally. It is a STANDALONE EllipticSolver, usable as Coupler<Model, DistributedFFTSolver>, instead of locking the distributed FFT into SpectralCoupler. Usage: replaces GeometricMG/PoissonFFTSolver when the periodic Poisson must run on n_ranks() > 1.
Preconditions:
- geom.domain.ny() % n_ranks() == 0: Ny must be divisible by the number of ranks (split into equal slabs; enforced by an assert in the constructor);
- geom.domain.nx() and geom.domain.ny() powers of 2: otherwise PoissonFFT falls back on the direct O(n^2) DFT per slab (correct but quadratic), and the slab transpose still requires divisibility by np;
- periodic BCs on both axes (the passed BCRec is ignored: periodic by construction).
Invariants / constraints:
- solve() writes phi with zero mean (mode k=0 set to zero), one direct pass (no tolerance);
- residual() is COLLECTIVE: it first fills the inter-slab halos (fill_boundary MPI) then reduces the residual norm over all ranks (all_reduce_max);
- in serial (n_ranks() == 1) a single slab covers the domain -> identical to PoissonFFTSolver.