DistributedFFTSolver Class ReferenceΒΆ

adc_cpp: pops::DistributedFFTSolver Class Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
pops::DistributedFFTSolver Class Reference

DIRECT periodic Poisson solver (spectral FFT) DISTRIBUTED, models EllipticSolver. More...

#include <poisson_fft_solver.hpp>

+ Collaboration diagram for pops::DistributedFFTSolver:

Public Member Functions

 DistributedFFTSolver (const Geometry &geom, const BCRec &=BCRec{}, std::function< bool(Real, Real)>={})
 
MultiFabrhs ()
 
MultiFabphi ()
 
const Geometrygeom () const
 
void solve ()
 
Real residual ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DistributedFFTSolver()

pops::DistributedFFTSolver::DistributedFFTSolver ( const Geometry geom,
const BCRec = BCRec{},
std::function< bool(Real, Real)>  = {} 
)
inline

Member Function Documentation

◆ geom()

const Geometry & pops::DistributedFFTSolver::geom ( ) const
inline

◆ phi()

MultiFab & pops::DistributedFFTSolver::phi ( )
inline

◆ residual()

Real pops::DistributedFFTSolver::residual ( )
inline
+ Here is the call graph for this function:

◆ rhs()

MultiFab & pops::DistributedFFTSolver::rhs ( )
inline

◆ solve()

void pops::DistributedFFTSolver::solve ( )
inline

The documentation for this class was generated from the following file: