include/pops/runtime/program/program_context.hpp Source File¶
|
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
Go to the documentation of this file.
12#include <pops/runtime/program/profiler.hpp> // Profiler / ProfileScope (per-node timing, ADC-459)
13#include <pops/coupling/schur/core/schur_condensation.hpp> // SchurOperatorCoeffKernel / SchurExplicitFluxKernel (native coeff assembly, ADC-421)
15#include <pops/mesh/execution/for_each.hpp> // for_each_cell (per-cell coeff / reconstruct kernels + negated divergence copy)
20#include <pops/numerics/elliptic/interface/elliptic_problem.hpp> // field_postprocess (centered gradient)
21#include <pops/numerics/elliptic/mg/geometric_mg.hpp> // GeometricMG (the wired V-cycle, reused as a precond, ADC-516)
22#include <pops/numerics/elliptic/poisson/poisson_operator.hpp> // apply_laplacian (shared 5-point matvec)
23#include <pops/numerics/linalg/lorentz_eliminator.hpp> // LorentzEliminator (closed B^{-1}, ADC-421 reconstruct)
24#include <pops/runtime/config/runtime_params.hpp> // RuntimeParams (compiled-Program runtime params, ADC-510)
26#include <pops/runtime/program/cache_manager.hpp> // CacheManager (held-node value cache, ADC-458)
193 // No count_kernel() here: this forwards to the PUBLIC System::solve_fields() -> Impl::solve_fields(),
227 // The codegen builds @p u_stages indexed BY PROGRAM block index (a stage state slotted at its own
228 // Program index, the rest nullptr). The System solver expects it indexed by SYSTEM block index, so
229 // re-slot each Program entry p at its name-matched System index sys_block(p) (Spec 3 criterion 23,
230 // ADC-457). Identity map -> the vector is copied unchanged (order-matching Program, byte-identical).
238 // SYSTEM block count. The codegen sizes u_stages to ctx.n_blocks() but only fills Program slots
240 // install), walking the System-sized range would re-map the nullptr padding through the identity
379 // DistributionMapping (the same the Krylov solve allocates its r/p/Ap from), and grid_context()
Owning MPI rank of each box, indexed by GLOBAL box index (parallel to a BoxArray).
Definition distribution_mapping.hpp:19
ConstArray4 const_array() const
READ handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:96
Array4 array()
WRITE handle (POD device-copyable) over this Fab. Valid as long as the Fab lives.
Definition fab2d.hpp:91
std::int64_t size() const
Buffer size (nx_tot * ny_tot * ncomp).
Definition fab2d.hpp:82
Definition geometric_mg.hpp:79
Field distributed over a level: decomposition (BoxArray) + distribution (DistributionMapping) + ncomp...
Definition multifab.hpp:33
Fab2D & fab(int li)
Local fab at index li (0 <= li < local_size()), for writing.
Definition multifab.hpp:67
const DistributionMapping & dmap() const
GLOBAL distribution (owner rank per box).
Definition multifab.hpp:58
const BoxArray & box_array() const
GLOBAL decomposition of the level (all boxes, all ranks).
Definition multifab.hpp:56
const Box2D & box(int li) const
VALID box of local fab li.
Definition multifab.hpp:71
void set_val(Real v)
Fills all cells (valid + ghosts) of every local fab with v.
Definition multifab.hpp:85
int local_size() const
Number of fabs OWNED by this rank (bound on local indices).
Definition multifab.hpp:65
Coupled multi-species system, composed at runtime from generic bricks.
Definition system.hpp:89
POPS_EXPORT Real cfl_min_dx() const
The MIN physical cell size of the grid (Cartesian min(dx, dy); polar min(dr, r_min*dtheta)) – the SAM...
POPS_EXPORT MultiFab & read_history(const std::string &name, int lag)
The history slot lag macro-steps back (lag 0 = the current slot, lag 1 = the previous step's stored v...
POPS_EXPORT void block_neg_div_flux_into(int b, MultiFab &U, MultiFab &R)
R <- -div F(U) for block b – the SAME flux divergence as block_rhs_into but WITHOUT the model's defau...
POPS_EXPORT RuntimeParams program_params(int prog_block) const
Block prog_block's CURRENT RuntimeParams (a device-clean by-value copy: trivially copyable,...
POPS_EXPORT int macro_step() const
MACRO-STEP counter (0-indexed; incremented by step / step_cfl / step_adaptive).
POPS_EXPORT GridContext grid_context()
REAL mesh + BC + aux of the System (aux not owned)
POPS_EXPORT void block_source_into(int b, MultiFab &U, MultiFab &R)
R <- S(U, aux) for block b – the model's default/composite SOURCE only, WITHOUT the flux divergence (...
POPS_EXPORT MultiFab & block_state(int b)
The conservative state MultiFab of block b (zero-copy, non-owning reference).
POPS_EXPORT void solve_fields_from_state(int block_idx, const MultiFab &U_stage)
Per-stage field solve (ADC-409): SAME elliptic solve + aux derivation as solve_fields(),...
POPS_EXPORT runtime::program::CacheManager & program_cache()
POPS_EXPORT Real block_max_speed(int b, const MultiFab &U) const
The maximum |wave speed| of block b evaluated on U – the SAME per-block reduction step_cfl reads (Blo...
POPS_EXPORT void rotate_histories()
Shift every history ring buffer one step (slot k <- slot k-1, for k = depth-1 .
POPS_EXPORT void record_program_diagnostic(const std::string &name, Real value)
POPS_EXPORT void solve_fields()
solves Poisson then derives aux = (phi, grad phi); exported
POPS_EXPORT const std::vector< int > & program_block_map() const
The installed program-index -> system-index map (empty = identity). Read by ProgramContext.
POPS_EXPORT runtime::program::Profiler & profiler()
The System-owned Profiler (a non-owning reference; lives as long as the System).
POPS_EXPORT void block_rhs_into(int b, MultiFab &U, MultiFab &R)
R <- -div F(U) + S(U, aux) for block b (the block's frozen-Poisson residual closure).
POPS_EXPORT MultiFab & register_history(const std::string &name, int lag)
POPS_EXPORT MultiFab alloc_scalar_field(int n_comp, int n_ghost)
A fresh scalar field co-distributed with the System mesh: block 0's BoxArray and DistributionMapping,...
POPS_EXPORT void install_program_step(std::function< void(double)> step)
POPS_EXPORT void block_project(int b, MultiFab &u)
Apply block b's post-step positivity projection to u in place (ADC-177): U <- project(U,...
POPS_EXPORT void store_history(const std::string &name, const MultiFab &value)
Copy value (valid cells) into the CURRENT slot [0] of history name and mark it initialized.
POPS_EXPORT void solve_fields_from_blocks(const std::vector< const MultiFab * > &U_stages)
Coupled multi-block field solve (Spec 3 criterion 24, ADC-457): SAME elliptic solve + aux derivation ...
const MultiFab & retrieve(int node_id) const
Definition cache_manager.hpp:83
Real effective_dt(int node_id, Real dt_now)
Definition cache_manager.hpp:100
void store(int node_id, const MultiFab &value, int macro_step)
Definition cache_manager.hpp:65
bool is_due(int node_id, int macro_step, int every_n) const
Definition cache_manager.hpp:52
void accumulate_dt(int node_id, Real dt)
Definition cache_manager.hpp:88
Definition profiler.hpp:151
Definition profiler.hpp:27
void record(const std::string &name, double seconds)
Definition profiler.hpp:50
void count(const std::string &name, std::int64_t by=1)
Definition profiler.hpp:69
void count_max(const std::string &name, std::int64_t value)
Definition profiler.hpp:85
Definition program_context.hpp:169
void record_scalar(const std::string &name, Real value) const
Store a runtime Scalar value into the System diagnostics map under name (spec op 23),...
Definition program_context.hpp:673
void store_history(const std::string &name, const MultiFab &value) const
Store value into the CURRENT slot of history name (ADC-406a).
Definition program_context.hpp:630
void count_scratch(const MultiFab &mf) const
Record one scratch MultiFab allocation: bumps the allocation count and updates the byte peak with THI...
Definition program_context.hpp:735
void count_kernel(std::int64_t by=1) const
Definition program_context.hpp:729
bool cache_should_update(int node_id, int every_n) const
Definition program_context.hpp:767
MultiFab & state(int b) const
Definition program_context.hpp:248
void cache_restore_aux(int node_id) const
Restore node node_id's cached aux into the System aux (a held step: no elliptic solve).
Definition program_context.hpp:784
Real cache_effective_dt(int node_id, Real dt_now) const
The effective dt a due accumulate_dt step applies: dt_now plus the summed skipped dt since the last r...
Definition program_context.hpp:811
Real hmin() const
The MIN physical cell size of the grid (Cartesian min(dx, dy); polar min(dr, r_min*dtheta)) – the SAM...
Definition program_context.hpp:281
void source_default_into(int b, MultiFab &u, MultiFab &r) const
r <- S(u, aux) for block b – the model's default/composite SOURCE only, WITHOUT the flux divergence (...
Definition program_context.hpp:273
MultiFab alloc_scalar_field(int n_comp=1, int n_ghost=1) const
A fresh scalar field co-distributed with the System mesh (block 0's box array / distribution),...
Definition program_context.hpp:303
void apply_projection(int b, MultiFab &u) const
Apply block b's post-step positivity projection to u in place: U <- project(U, aux) over the valid ce...
Definition program_context.hpp:666
MultiFab & history(const std::string &name, int lag=1) const
The history slot lag macro-steps back (the SYSTEM-OWNED ring buffer, ADC-406a): lag 1 = the previous ...
Definition program_context.hpp:621
MultiFab rhs_scratch_like(const MultiFab &u) const
A zero-initialized RHS scratch with the SAME layout (box array / distribution / ghosts) as u,...
Definition program_context.hpp:582
void solve_fields_from_state(int b, MultiFab &u_stage) const
Per-stage field solve (ADC-409): re-solve the elliptic fields and re-fill the shared aux from block b...
Definition program_context.hpp:203
runtime::program::Profiler & profiler() const
Definition program_context.hpp:697
void solve_fields_from_blocks(const std::vector< const MultiFab * > &u_stages) const
Coupled multi-block field solve (Spec 3 criterion 24, ADC-457): re-solve the elliptic fields and re-f...
Definition program_context.hpp:225
void apply_laplacian_coeff(MultiFab &out, MultiFab &in, const MultiFab &eps_x, const MultiFab &eps_y, const MultiFab &a_xy, const MultiFab &a_yx) const
out = div(A grad in), A = [[eps_x, a_xy], [a_yx, eps_y]] – the coefficiented matrix-free matvec of th...
Definition program_context.hpp:439
void schur_energy(MultiFab &state, const MultiFab &state_old, int c_rho, int c_mx, int c_my, int c_E) const
Condensed-Schur kinetic-energy increment (ADC-427): E^{n+1} = E^n + (1/2)*rho*(|v^{n+1}|^2 - |v^n|^2)...
Definition program_context.hpp:541
void laplacian(MultiFab &out, MultiFab &in) const
out = Lap(in): fill in's ghosts (transport BC, periodic by default) then apply the SHARED discrete 5-...
Definition program_context.hpp:318
void cache_store_aux(int node_id) const
Store a copy of the System aux (the field solve's output) as node node_id's cached value,...
Definition program_context.hpp:780
void schur_reconstruct(MultiFab &state, MultiFab &phi, Real th_dt, int c_rho, int c_mx, int c_my, int c_bz) const
Reconstruct v^{n+theta} = B^{-1}(v^n - theta*dt*grad phi^{n+theta}) and write mom = rho^n*v into stat...
Definition program_context.hpp:518
int n_blocks() const
Definition program_context.hpp:247
Real max(const MultiFab &u) const
Definition program_context.hpp:650
int macro_step() const
The current macro step (0-based).
Definition program_context.hpp:801
void rotate_histories() const
Shift every history ring one macro-step (slot k <- slot k-1).
Definition program_context.hpp:638
Real max_wave_speed(int b, const MultiFab &u) const
The maximum |wave speed| of block b on the state u: the SAME per-block reduction step_cfl reads (Bloc...
Definition program_context.hpp:288
void solve_fields() const
Definition program_context.hpp:192
RuntimeParams program_params(int b) const
The CURRENT RuntimeParams of PROGRAM block b (epic ADC-479 / ADC-510, Spec 5 C5): the per-block runti...
Definition program_context.hpp:687
void solve_fields_from_state(const std::string &field, int b, MultiFab &u_stage) const
Named multi-elliptic field solve (ADC-428): re-solve the SECOND elliptic field field from block b's s...
Definition program_context.hpp:213
void neg_div_flux_default_into(int b, MultiFab &u, MultiFab &r) const
r <- -div F(u) for block b – the SAME flux divergence as rhs_into but WITHOUT the model's default/com...
Definition program_context.hpp:261
void rhs_into(int b, MultiFab &u, MultiFab &r) const
Definition program_context.hpp:249
void divergence(MultiFab &out, MultiFab &fx, MultiFab &fy) const
out = div(fx, fy) by centered differences: out = d fx/dx + d fy/dy (component 0).
Definition program_context.hpp:348
MultiFab scratch_state_like(const MultiFab &u) const
A zero-initialized scratch STATE with the same layout as u: an intermediate stage state of a multi-st...
Definition program_context.hpp:591
runtime::program::ProfileScope profile_node(const std::string &name) const
RAII timer for one node: pops::runtime::program::ProfileScope s = ctx.profile_node("node:x"); times i...
Definition program_context.hpp:702
void lincomb(MultiFab &z, Real a, const MultiFab &x, Real b, const MultiFab &y) const
z <- a x + b y over the valid cells (assignment, not accumulation; z may alias x or y).
Definition program_context.hpp:602
void gradient(MultiFab &out, MultiFab &phi) const
out = grad(phi) by centered differences: out(.,0) = d phi/dx, out(.,1) = d phi/dy (out needs >= 2 com...
Definition program_context.hpp:329
int sys_block(int b) const
Translate a PROGRAM block index b (P.state declaration order, what the codegen emits) to the SYSTEM b...
Definition program_context.hpp:187
void fill_boundary(MultiFab &x) const
Fill the ghost cells (halos) of x in place: the transport BC (periodic by default),...
Definition program_context.hpp:657
Real sum_component(const MultiFab &u, int comp) const
Definition program_context.hpp:646
void cache_store_scratch(int node_id, const MultiFab &scratch) const
Store a copy of a NAMED scratch MultiFab (a held rhs / source / linear_combine output) as node node_i...
Definition program_context.hpp:792
ProgramContext(System *sys)
Definition program_context.hpp:171
void cache_restore_scratch(int node_id, MultiFab &scratch) const
Restore node node_id's cached scratch into scratch (a held step: no recompute).
Definition program_context.hpp:796
MultiFab & aux() const
The System aux MultiFab (phi=0, grad_x=1, grad_y=2, B_z=3, T_e=4, named fields from kAuxNamedBase).
Definition program_context.hpp:296
void assemble_schur_rhs(MultiFab &rhs, MultiFab &phi_n, const MultiFab &state, Real th_dt, Real g, int c_mx, int c_my, int c_bz) const
rhs = -Lap(phi_n) - g*div(F), F = B^{-1}(mx, my) – the FUSED condensed-Schur right-hand side (the nat...
Definition program_context.hpp:479
Geometry geom() const
The System mesh geometry (index domain + physical bounds, dx/dy).
Definition program_context.hpp:310
ProgramContext(void *sys)
Wraps a System passed as a flat void* (what pops_install_program(void* sys) receives).
Definition program_context.hpp:173
Real min(const MultiFab &u) const
Definition program_context.hpp:651
void register_history(const std::string &name, int lag) const
Register (idempotent) the history name with maximum lag lag, allocating the ring buffer WITHOUT readi...
Definition program_context.hpp:612
void geometric_mg_precond_apply(MultiFab &out, const MultiFab &in) const
out <- M^{-1}(in): ONE geometric-multigrid V-cycle of the bare 5-point Laplacian, used as a matrix-fr...
Definition program_context.hpp:375
void install(std::function< void(double)> step) const
Register the macro-step body.
Definition program_context.hpp:177
void cache_accumulate_dt(int node_id, Real dt) const
Add a skipped step's dt to node node_id's accumulator (accumulate_dt policy): on a NOT-due step the h...
Definition program_context.hpp:805
void axpy(MultiFab &u, Real a, const MultiFab &r) const
u <- u + a r over the valid cells (linear combine; forwards to pops::saxpy).
Definition program_context.hpp:594
Real min_component(const MultiFab &u, int comp) const
Definition program_context.hpp:648
void assemble_schur_coeffs(MultiFab &eps_x, MultiFab &eps_y, MultiFab &a_xy, MultiFab &a_yx, const MultiFab &state, Real c, Real th_dt, int c_rho, int c_bz) const
Assemble the tensor coefficient A_op = I + c*rho*B^{-1} of the condensed-Schur operator per cell: eps...
Definition program_context.hpp:412
void profile_record(const std::string &name, std::chrono::steady_clock::time_point t0) const
Record one node's elapsed time (now() - t0) under name into the System Profiler.
Definition program_context.hpp:710
Real sum(const MultiFab &u) const
Definition program_context.hpp:649
void scheduler_error(const std::string &what) const
Fail loud: a node with an error policy was reached off its schedule cadence (a stale value would be r...
Definition program_context.hpp:816
Real max_component(const MultiFab &u, int comp) const
Definition program_context.hpp:647
void neg_div_flux_into(MultiFab &r, MultiFab &fx, MultiFab &fy) const
r <- -div(fx, fy) per conservative component (ADC-419 named fluxes): r(.,c) = -(d fx(....
Definition program_context.hpp:560
void schur_explicit_flux(MultiFab &out, const MultiFab &state, Real th_dt, int c_mx, int c_my, int c_bz) const
out = B^{-1} (mx, my) per cell – the EXPLICIT condensed-Schur flux F = rho*B^{-1}*v^n (= B^{-1} appli...
Definition program_context.hpp:455
DESCRIPTIVE types of the elliptic stage: EllipticProblem (problem definition) and FieldPostProcess (f...
Fab2D: single-grid data on a Box2D (in-house equivalent of AMReX's FArrayBox); Array4 / ConstArray4: ...
for_each_cell and reductions: the parallelism SEAM over the cells of a Box2D; sync_host / sync_device...
GeometricMG: in-house geometric multigrid (V-cycle) for the elliptic operator, Gauss-Seidel smoother ...
Geometry: index-space (Box2D) <-> Cartesian physical-space mapping; PolarGeometry: SIBLING for a glob...
Block grid context plus closures, shared between System (which installs them) and block_builder....
LorentzEliminator: 2x2 operator B of the Schur scheme for implicit velocity elimination.
MultiFab arithmetic (saxpy, lincomb, norm_inf, dot) over VALID cells.
MultiFab: a field DISTRIBUTED over a level (equivalent of AMReX's MultiFab).
Definition amr_hierarchy.hpp:29
void for_each_cell(const Box2D &b, F f)
Applies f to EACH cell (i, j) of box b (bounds inclusive), via Kokkos::parallel_for (Serial / OpenMP ...
Definition for_each.hpp:138
void saxpy(MultiFab &y, Real a, const MultiFab &x)
y <- y + a x over ALL components of the valid cells. Identical layouts required.
Definition mf_arith.hpp:102
Real reduce_min(const MultiFab &mf, int comp=0)
Signed minimum min_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_min) – t...
Definition mf_arith.hpp:223
void apply_laplacian(const MultiFab &phi, const Geometry &geom, MultiFab &lap, const MultiFab *coef=nullptr, const MultiFab *eps=nullptr, const MultiFab *kappa=nullptr, const MultiFab *eps_y=nullptr, const MultiFab *a_xy=nullptr, const MultiFab *a_yx=nullptr)
Definition poisson_operator.hpp:191
void lincomb(MultiFab &z, Real a, const MultiFab &x, Real b, const MultiFab &y)
z <- a x + b y over ALL components of the valid cells. Identical layouts; aliasing safe.
Definition mf_arith.hpp:133
void field_postprocess(const MultiFab &phi, MultiFab &out, Real cx, Real cy, FieldPostProcess spec)
Definition elliptic_problem.hpp:104
Real reduce_max(const MultiFab &mf, int comp=0)
Signed maximum max_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_max) – t...
Definition mf_arith.hpp:211
Real reduce_sum(const MultiFab &mf, int comp=0)
Sum Sum_cells f(.,.,comp) over component comp, reduced over ALL ranks (all_reduce_sum) – the compiled...
Definition mf_arith.hpp:198
void apply_divergence(const MultiFab &fx, const MultiFab &fy, const Geometry &geom, MultiFab &div_out, int cx=0, int cy=0)
Definition poisson_operator.hpp:256
BCType
Boundary condition type for a face: Periodic (handled by fill_boundary), Foextrap (zero gradient,...
Definition physical_bc.hpp:25
@ Foextrap
@ Periodic
void fill_ghosts(MultiFab &mf, const Box2D &domain, const BCRec &bc)
COMPLETE ghost filling: fill_boundary (interior + periodic, periodicity deduced from bc) THEN fill_ph...
Definition physical_bc.hpp:227
PHYSICAL boundary conditions at the domain edge (BCType, BCRec, fill_physical_bc, fill_ghosts).
Free functions of the elliptic operator: apply_laplacian (matvec), poisson_residual (residual),...
RuntimeParams: carrier for the RUNTIME PARAMETERS of a DSL model (P7-b).
BUILDER (NOT solver) of the Schur-condensed source stage of the implicit source coupling potential / ...
WRITE POD handle (raw pointer + strides) over a Fab2D buffer, indexed by (i, j, c) IN GLOBAL INDICES ...
Definition fab2d.hpp:29
Boundary conditions for the FOUR faces of the domain (type + associated Dirichlet value).
Definition physical_bc.hpp:29
READ-only handle (const counterpart of Array4): same layout and same contract (POD device-copyable,...
Definition fab2d.hpp:44
Definition elliptic_problem.hpp:73
Cartesian geometry of a level: index domain + physical bounds [xlo, xhi] x [ylo, yhi].
Definition geometry.hpp:20
POPS_HD Real dy() const
Grid spacing in y (= (yhi - ylo) / domain.ny()). POPS_HD.
Definition geometry.hpp:33
POPS_HD Real dx() const
Grid spacing in x (= (xhi - xlo) / domain.nx()). POPS_HD.
Definition geometry.hpp:31
Mesh + transport BC + aux shared by a block closures.
Definition grid_context.hpp:41
MultiFab * aux
System aux (phi, grad phi); NOT owned.
Definition grid_context.hpp:45
LorentzEliminator: operator B = [[1,-w],[w,1]] and its analytic inverse.
Definition lorentz_eliminator.hpp:55
POPS_HD void apply_Binv(Real vx, Real vy, Real &vxp, Real &vyp) const
apply_Binv: applies B^{-1} = (1/det)*[[1,w],[-w,1]] to (vx, vy), writes (vxp, vyp)....
Definition lorentz_eliminator.hpp:73
FLAT carrier (fixed size, by value) of the runtime parameter values of a block.
Definition runtime_params.hpp:38
neg(i,j) = -src(i,j) (negation of component 0). Device-clean NAMED functor.
Definition schur_condensation.hpp:126
Condensed-Schur kinetic-energy increment (ADC-427), mirroring the native detail::SchurEnergyKernel: E...
Definition program_context.hpp:150
int c_rho
Definition program_context.hpp:153
ConstArray4 st_old
U^n (READ mx, my = mom^n)
Definition program_context.hpp:152
Array4 st
updated state (READ rho, mx, my = mom^{n+1}; READ+WRITE E)
Definition program_context.hpp:151
POPS_HD void operator()(int i, int j) const
Definition program_context.hpp:154
out = B^{-1} (mx, my) at the center (Fx in comp 0, Fy in comp 1): the explicit flux F = rho*B^{-1}*v.
Definition program_context.hpp:87
Array4 out
output: Fx (comp 0), Fy (comp 1)
Definition program_context.hpp:90
POPS_HD void operator()(int i, int j) const
Definition program_context.hpp:93
Real th_dt
theta*dt (w = th_dt*B_z)
Definition program_context.hpp:91
int c_my
Definition program_context.hpp:92
int c_bz
Definition program_context.hpp:92
ConstArray4 s
fluid state (mx, my at c_mx / c_my)
Definition program_context.hpp:88
ConstArray4 aux
System aux (B_z at c_bz)
Definition program_context.hpp:89
int c_mx
Definition program_context.hpp:92
Aux-component-aware variants of the native Schur kernels (coupling/schur/core/schur_condensation....
Definition program_context.hpp:67
Array4 ex
Definition program_context.hpp:70
Real th_dt
theta*dt (w = th_dt*B_z)
Definition program_context.hpp:73
Array4 axy
Definition program_context.hpp:71
int c_rho
Definition program_context.hpp:74
ConstArray4 s
fluid state (rho at c_rho)
Definition program_context.hpp:68
POPS_HD void operator()(int i, int j) const
Definition program_context.hpp:75
Real c
c = theta^2 dt^2 alpha
Definition program_context.hpp:72
Array4 ayx
output: cross terms a_xy, a_yx
Definition program_context.hpp:71
ConstArray4 aux
System aux (B_z at c_bz)
Definition program_context.hpp:69
Array4 ey
output: eps_x, eps_y (diagonal of A)
Definition program_context.hpp:70
int c_bz
Definition program_context.hpp:74
Reconstruct v^{n+theta} = B^{-1}(v^n - theta*dt*grad phi) and write mom = rho^n*v (rho frozen).
Definition program_context.hpp:122
Real half_idy
1/(2 dx), 1/(2 dy) (centered gradient)
Definition program_context.hpp:127
int c_my
Definition program_context.hpp:128
Real th_dt
Definition program_context.hpp:126
int c_rho
Definition program_context.hpp:128
ConstArray4 phi
phi^{n+theta} (ghosts filled: centered grad reads i+-1, j+-1)
Definition program_context.hpp:123
POPS_HD void operator()(int i, int j) const
Definition program_context.hpp:129
Real half_idx
Definition program_context.hpp:127
int c_mx
Definition program_context.hpp:128
Array4 st
fluid state (READ rho, mx, my; WRITE mx, my)
Definition program_context.hpp:125
int c_bz
Definition program_context.hpp:128
ConstArray4 aux
System aux (B_z at c_bz)
Definition program_context.hpp:124
rhs = -Lap phi^n - g*div(F), the centered FV divergence of the explicit flux F packed in ONE 2-compon...
Definition program_context.hpp:106
ConstArray4 neg_lap
-Lap phi^n (already negated)
Definition program_context.hpp:107
ConstArray4 f
explicit flux F at the center (Fx comp 0, Fy comp 1; ghosts filled)
Definition program_context.hpp:108
POPS_HD void operator()(int i, int j) const
Definition program_context.hpp:112
Real half_idx
Definition program_context.hpp:111
Array4 rhs
output: condensed right-hand side
Definition program_context.hpp:109
Real g
theta dt alpha
Definition program_context.hpp:110
Real half_idy
1/(2 dx), 1/(2 dy)
Definition program_context.hpp:111
Runtime multi-species composition: one coupled system, block by block.
Base scalar types and the POPS_HD macro (host+device portability).
Generated by