include/pops/numerics/time/amr/reflux/amr_flux_helpers.hpp File ReferenceΒΆ

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

Basic MultiFab building blocks of an AMR step: AmrTimeMethod enum, device-clean functors and advance helpers (flux divergence, explicit/IMEX source, 2x2 average_down, space-time coarse-fine ghosts mono-box), shared by the whole subcycling path. More...

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

Go to the source code of this file.

Classes

struct  pops::AmrSspRhsKernel< Model >
 
struct  pops::AmrAdvanceFacesKernel
 Device-clean NAMED functor: U <- U - dt div(Fx,Fy) on a valid cell. More...
 
struct  pops::AmrApplySourceKernel< Model >
 Device-clean NAMED functor (template Model, see AmrSspRhsKernel): U <- U + dt S(U, aux) on a valid cell. More...
 
struct  pops::AmrAverageDownKernel
 Device-clean NAMED functor: 2x2 average fine -> coarse on a coarse cell. More...
 

Namespaces

namespace  pops
 

Enumerations

enum class  pops::AmrTimeMethod : int { pops::kEuler = 0 , pops::kSsprk3 = 1 }
 

Functions

template<class Model >
void pops::mf_eval_rhs (const Model &m, const MultiFab &U, const MultiFab &aux, const MultiFab &Fx, const MultiFab &Fy, Real dx, Real dy, MultiFab &R)
 
void pops::mf_advance_faces (MultiFab &U, const MultiFab &Fx, const MultiFab &Fy, Real dx, Real dy, Real dt)
 
template<class Model >
void pops::mf_apply_source (const Model &m, MultiFab &U, const MultiFab &aux, Real dt)
 
template<class Model >
void pops::mf_apply_source_treatment (const Model &m, MultiFab &U, const MultiFab &aux, Real dt, bool imex, const NewtonOptions &nopts={})
 
void pops::mf_average_down (const MultiFab &Uf, MultiFab &Uc, int CI0, int CI1, int CJ0, int CJ1)
 
void pops::fill_cf_ghost_cell (Array4 f, const ConstArray4 &co, const ConstArray4 &cn, int i, int j, int nc, Real frac, Real pos_floor=Real(0), int pos_comp=0)
 
void pops::mf_fill_fine_ghosts_t (MultiFab &Uf, const MultiFab &Uc_old, const MultiFab &Uc_new, Real frac, Real pos_floor=Real(0), int pos_comp=0)
 

Detailed Description

Basic MultiFab building blocks of an AMR step: AmrTimeMethod enum, device-clean functors and advance helpers (flux divergence, explicit/IMEX source, 2x2 average_down, space-time coarse-fine ghosts mono-box), shared by the whole subcycling path.

Layer: include/pops/numerics/time. Role: provide the kernels reused by amr_level / amr_patch_range / amr_subcycling. mf_advance_faces (U -= dt div F), mf_apply_source (U += dt S, forward Euler), mf_apply_source_treatment (explicit OR IMEX backward-Euler per runtime flag), mf_eval_rhs (R = -div F + S at the same state, for SSPRK3 stages), mf_average_down, fill_cf_ghost_cell / mf_fill_fine_ghosts_t.

Invariants:

  • kernels = NAMED functors (AmrSspRhsKernel, AmrAdvanceFacesKernel, ...) and not lambdas: a first instantiation from an external loader TU or an extended lambda would make nvcc choke;
  • the source is CELL-LOCAL (no face flux): it does not enter the reflux, so the IMEX split does not touch conservation at coarse-fine interfaces;
  • mf_apply_source_treatment with nopts={} (default) reproduces the legacy 2-iter Newton call -> bit-identical;
  • the device paths read/write unified memory: device_fence() before host read.