include/pops/numerics/elliptic/poisson/poisson_fft_solver.hpp File ReferenceΒΆ

adc_cpp: include/pops/numerics/elliptic/poisson/poisson_fft_solver.hpp File 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
poisson_fft_solver.hpp File Reference

DIRECT EllipticSolver backends via spectral FFT (periodic BCs), MultiFab wrappers around PoissonFFT: PoissonFFTSolver (single-rank, single box), DistributedFFTSolver (distributed, slabs) and RemappedFFTSolver (System single-box layout outward, slabs inside). More...

+ Include dependency graph for poisson_fft_solver.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pops::PoissonFFTSolver
 
class  pops::DistributedFFTSolver
 DIRECT periodic Poisson solver (spectral FFT) DISTRIBUTED, models EllipticSolver. More...
 
class  pops::RemappedFFTSolver
 DIRECT periodic Poisson solver (spectral FFT) under MPI, presenting the SYSTEM LAYOUT, models EllipticSolver (ADC-287). More...
 

Namespaces

namespace  pops
 

Detailed Description

DIRECT EllipticSolver backends via spectral FFT (periodic BCs), MultiFab wrappers around PoissonFFT: PoissonFFTSolver (single-rank, single box), DistributedFFTSolver (distributed, slabs) and RemappedFFTSolver (System single-box layout outward, slabs inside).

Layer: include/pops/numerics/elliptic/poisson. Role: solve the SAME discrete 5-point Laplacian as GeometricMG (same eigenvalues) but in ONE transform instead of iterating – far cheaper when the elliptic part dominates the run (cf. PERFORMANCE.md). Same constructor signature and interface as GeometricMG, so they are interchangeable as the Coupler's Elliptic parameter. All three model the EllipticSolver concept (static_assert at the bottom). Contract: PoissonFFTSolver is single-rank/single box (the default case of the Coupler and the facades); DistributedFFTSolver is the distributed counterpart (1 slab per rank, internal MPI transpose of PoissonFFT); RemappedFFTSolver exposes the System's single round-robin box (rhs()/phi() on ba/dm = same layout as the aux) and hides a box<->slab scatter/gather around PoissonFFT inside solve(), so the System field solver stays untouched under MPI (ADC-287).

Invariants:

  • PoissonFFTSolver throws (HARD guard, active in Release) if n_ranks() > 1 or ba.size() != 1: otherwise a rank with no local box would dereference fab(0) -> SIGSEGV;
  • solve() writes phi with zero mean (mode k=0 set to zero) and fills phi's periodic ghosts (fill_boundary) so the aux derivation (centered grad phi) reads up-to-date ghosts;
  • residual() of DistributedFFTSolver and RemappedFFTSolver is COLLECTIVE (all_reduce_max) and first fills the inter-box/-slab halos (fill_boundary).