include/pops/numerics/time/amr/levels/amr_subcycling.hpp File ReferenceΒΆ

adc_cpp: include/pops/numerics/time/amr/levels/amr_subcycling.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
amr_subcycling.hpp File Reference

AMR multi-patch subcycling engine (several fine boxes per level): 2-level step (amr_step_2level_multipatch), N-level recursion (detail::subcycle_level_mp, detail::amr_step_multilevel_multipatch), SSPRK3 per-stage advance, multi-box helpers (mf_fill_fine_ghosts_mb, mf_average_down_mb, mf_find_box, coarsen_grown) and types AmrLevelMP / RegMP. More...

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

Go to the source code of this file.

Classes

struct  pops::AmrLevelMP
 
struct  pops::RegMP
 

Namespaces

namespace  pops
 
namespace  pops::detail
 

Functions

template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::amr_step_2level_multipatch (const Model &m, MultiFab &Uc, const Box2D &dom, Real dxc, Real dyc, MultiFab &Uf, const MultiFab &auxc, const MultiFab &auxf, Real dt)
 
int pops::mf_find_box (const MultiFab &mf, int I, int J)
 
BoxArray pops::coarsen_grown (const BoxArray &ba, int ngrow, int r)
 
void pops::mf_fill_fine_ghosts_mb (MultiFab &Uf, const MultiFab &Po, const MultiFab &Pn, Real frac, bool replicated_parent=true, Real pos_floor=Real(0), int pos_comp=0)
 
void pops::mf_average_down_mb (const MultiFab &Uf, MultiFab &Uc)
 
void pops::detail::ssprk3_refill_level_ghosts (MultiFab &U, int lev, const Box2D &base_dom, Periodicity base_per, const MultiFab *pOld, const MultiFab *pNew, Real frac, bool coarse_replicated, Real pos_floor=Real(0), int pos_comp=0)
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::detail::ssprk3_advance_level (const Model &m, AmrLevelMP &lv, Real dt, MultiFab &fx, MultiFab &fy, bool recon_prim, int lev, const Box2D &base_dom, Periodicity base_per, const MultiFab *pOld, const MultiFab *pNew, Real frac, bool coarse_replicated, Real pos_floor=Real(0))
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::detail::subcycle_level_mp (const Model &m, std::vector< AmrLevelMP > &L, int lev, Real dt, const Box2D &base_dom, Periodicity base_per, const MultiFab *pOld, const MultiFab *pNew, Real frac, std::vector< RegMP > *parentRegs, bool coarse_replicated=true, bool recon_prim=false, bool imex=false, const NewtonOptions &nopts={}, AmrTimeMethod tmethod=AmrTimeMethod::kEuler, Real pos_floor=Real(0))
 
template<class Limiter = NoSlope, class NumericalFlux = RusanovFlux, class Model >
void pops::detail::amr_step_multilevel_multipatch (const Model &m, std::vector< AmrLevelMP > &L, const Box2D &dom, Real dt, Periodicity per=Periodicity{true, true}, bool coarse_replicated=true, bool recon_prim=false, bool imex=false, const NewtonOptions &nopts={}, AmrTimeMethod tmethod=AmrTimeMethod::kEuler, Real pos_floor=Real(0))
 

Detailed Description

AMR multi-patch subcycling engine (several fine boxes per level): 2-level step (amr_step_2level_multipatch), N-level recursion (detail::subcycle_level_mp, detail::amr_step_multilevel_multipatch), SSPRK3 per-stage advance, multi-box helpers (mf_fill_fine_ghosts_mb, mf_average_down_mb, mf_find_box, coarsen_grown) and types AmrLevelMP / RegMP.

This is the engine behind advance_amr.

Layer: include/pops/numerics/time. Role: COVERAGE-AWARE reflux in the style of AMReX FluxRegister – a coarse cell adjacent to a fine patch is corrected ONLY if it is not covered by another patch (fine-fine interfaces are handled by fill_boundary).

Invariants:

  • distributed (MPI) with COARSE REPLICATION: the single-box coarse level is replicated on each rank (local periodic fill), the fine patches distributed; average_down and reflux gather up through GLOBAL-indexed coarse buffers + all_reduce_sum_inplace, then each rank applies to its copy -> all stay identical. In serial this is bit-for-bit identical to the direct path;
  • validation: test_mpi_amr_multipatch (np=1/2/4 bit-identical);
  • SSPRK3 refills the ghosts BEFORE each stage flux evaluation (ssprk3_refill_level_ghosts), and requires imex == false;
  • saxpy/lincomb and the helper kernels are device-clean (named functors).