include/pops/numerics/elliptic/mg/composite_fac_poisson.hpp File ReferenceΒΆ

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

CompositeFacPoisson: 2-level AMR COMPOSITE elliptic solver (Fast Adaptive Composite, FAC) for the SCALAR Poisson Lap phi = f on a coarse level + ONE fine patch (ratio 2). More...

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

Go to the source code of this file.

Classes

class  pops::CompositeFacPoisson
 2-level COMPOSITE FAC Poisson solver (scalar). More...
 

Namespaces

namespace  pops
 
namespace  pops::detail
 

Functions

POPS_HD Real pops::detail::fac_bilerp_coarse (const ConstArray4 &C, int i, int j, int r)
 BILINEAR interpolation of the coarse potential (cell-centered, C with ghosts) at the CENTER of the fine cell (i, j).
 

Detailed Description

CompositeFacPoisson: 2-level AMR COMPOSITE elliptic solver (Fast Adaptive Composite, FAC) for the SCALAR Poisson Lap phi = f on a coarse level + ONE fine patch (ratio 2).

MOTIVATION (amr-schur path). The current AMR Poisson (Option A) solves the elliptic only on the coarse level then injects grad phi (piecewise constant) onto the fine patches: the patches refine the TRANSPORT but NOT the elliptic coupling. A COMPOSITE solver makes the fine patch ACTUALLY REFINE the elliptic solution (more accurate phi/grad phi near the patch). This is the AMR fidelity lock (the composite Poisson coupling (FAC) that amr_reflux.hpp explicitly leaves to this solver).

2-LEVEL FAC ALGORITHM (McCormick), one fine patch INTERIOR to the coarse domain. Composite solution phi = phi_f on the patch, phi_c elsewhere: 0. initial coarse solve: GeometricMG(Lap phi_c = f_c, Dirichlet); it. repeat:

  1. C-F ghosts: fill the patch ghost ring by BILINEAR INTERPOLATION of phi_c (order 2 vs the constant injection of Option A) -> cell-centered C-F Dirichlet condition;
  2. fine solve: red-black GS on the patch with FROZEN ghosts (Lap phi_f = f_f);
  3. average_down phi_f -> phi_c on the COVERED coarse cells (consistency);
  4. composite coarse residual: r_c = f_c - Lap phi_c (NON covered cells), 0 on covered ones,
    • C-F FLUX CORRECTION: on the coarse cells BORDERING the patch, the flux through the C-F face is replaced by the FINE flux (conservative sum of the 2 fine faces) -> two-way coupling;
  5. coarse correction: GeometricMG(Lap e_c = r_c, homogeneous Dirichlet); phi_c += e_c (non covered); until ||r_c|| (composite residual norm) below tolerance.

SCOPE (Phase 4a, multi fine patch). Cartesian, 2 levels, 1..N disjoint fine patches strictly interior, aligned (lo even / hi odd) and SEPARATED by at least one coarse cell (NON adjacent), ratio 2, REPLICATED MONO-BOX coarse (serial / single-rank). N == 1 -> mono-patch path bit-identical to Phase 1 (ctor delegates, per-patch loops degenerate to a single patch). The fine-fine join (ADJACENT patches), MPI and > 2 levels are Phase 4b. The MMS test validates that the fine patch REDUCES the elliptic error near the patch vs coarse-only.

MULTI-PATCH (Phase 4a). Each fine patch has its own box (fine BoxArray); the FINE operations (bilinear C-F ghosts, SOR, C-F flux correction) loop OVER EACH local patch. The coarse coverage (CoverageMask) is the UNION of the coarse footprints of all patches: it tells which coarse cells are shadowed (residual set to 0, average_down) and lets us skip a bordering cell covered by ANOTHER patch. The separation of at least one coarse cell (ctor guard) guarantees that no fine face is SHARED between two patches: each patch border is a true coarse-fine join, so the bilinear C-F ghost (read from the coarse) and the flux correction are exact patch by patch – no fine-fine exchange needed.