include/pops/runtime/program/program_context.hpp File ReferenceΒΆ

adc_cpp: include/pops/runtime/program/program_context.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
program_context.hpp File Reference

ProgramContext – the C++-side facade a generated problem.so calls to run a compiled time Program during sim.step(dt) (epic ADC-399, ADC-401 Phase 2b). More...

+ Include dependency graph for program_context.hpp:

Go to the source code of this file.

Classes

struct  pops::runtime::program::detail::SchurOperatorCoeffKernelC
 Aux-component-aware variants of the native Schur kernels (coupling/schur/core/schur_condensation.hpp. More...
 
struct  pops::runtime::program::detail::SchurExplicitFluxKernelC
 out = B^{-1} (mx, my) at the center (Fx in comp 0, Fy in comp 1): the explicit flux F = rho*B^{-1}*v. More...
 
struct  pops::runtime::program::detail::SchurRhsAssembleKernelC
 rhs = -Lap phi^n - g*div(F), the centered FV divergence of the explicit flux F packed in ONE 2-component buffer (Fx in comp 0, Fy in comp 1 – the layout schur_explicit_flux writes), fused with the already-negated -Lap phi^n. More...
 
struct  pops::runtime::program::detail::SchurReconstructKernelC
 Reconstruct v^{n+theta} = B^{-1}(v^n - theta*dt*grad phi) and write mom = rho^n*v (rho frozen). More...
 
struct  pops::runtime::program::detail::SchurEnergyKernelC
 Condensed-Schur kinetic-energy increment (ADC-427), mirroring the native detail::SchurEnergyKernel: E^{n+1} = E^n + (1/2) rho (|v^{n+1}|^2 - |v^n|^2), v = (mx, my)/rho. More...
 
class  pops::runtime::program::ProgramContext
 

Namespaces

namespace  pops
 
namespace  pops::runtime
 
namespace  pops::runtime::program
 
namespace  pops::runtime::program::detail
 

Detailed Description

ProgramContext – the C++-side facade a generated problem.so calls to run a compiled time Program during sim.step(dt) (epic ADC-399, ADC-401 Phase 2b).

It REIMPLEMENTS NOTHING. Each method forwards to an existing pops::System primitive: install(fn) -> System::install_program_step(fn) (registers the macro-step body) solve_fields() -> System::solve_fields() (elliptic solve + aux at current U) solve_fields_from_state(b, U) -> System::solve_fields_from_state(b, U) (aux at a stage state) n_blocks() -> System::n_blocks() state(b) -> System::block_state(b) (the block's live MultiFab, zero-copy) rhs_into(b, U, R) -> System::block_rhs_into(b, U, R) (R <- -div F + S, Poisson frozen) neg_div_flux_default_into(b, U, R) -> System::block_neg_div_flux_into (R <- -div F, NO source) axpy(U, a, R) -> pops::saxpy(U, a, R) (U <- U + a R, device-dispatched)

The Program composes the chain (e.g. Forward Euler = solve_fields(); for each block: rhs_into(b, U, R); axpy(U, dt, R)) and installs it via install(...). The .so NEVER touches System::Impl / Array4 / fill_boundary / the elliptic solver / Kokkos / MPI / CFL / substeps.

IDIOM: ProgramContext is a plain (non-template) class holding a System*. A generated .so receives the System as a flat void* across the dlopen boundary (like the native loader's void* self) and wraps it here; it reaches per-block storage through the System's public accessors because System::Impl is private to the _pops translation unit.