include/pops/runtime/system/system_block_store.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
|
SystemBlockStore: the BLOCK MANAGEMENT responsibility extracted from the god-class System::Impl (audit Lot B.3, last P0 extraction; follows SystemFieldSolver #176 and SystemStepper). More...
#include <pops/core/state/state.hpp>#include <pops/core/foundation/types.hpp>#include <pops/core/state/variables.hpp>#include <pops/mesh/index/box2d.hpp>#include <pops/mesh/execution/for_each.hpp>#include <pops/mesh/storage/multifab.hpp>#include <functional>#include <map>#include <memory>#include <stdexcept>#include <string>#include <vector>
Include dependency graph for system_block_store.hpp:Go to the source code of this file.
Classes | |
| class | pops::SystemBlockStore |
| ORDERED registry of the System blocks + state marshaling helpers. More... | |
| struct | pops::SystemBlockStore::BlockState |
| Compiled closures frozen at block add time (composite model + spatial scheme + time). More... | |
Namespaces | |
| namespace | pops |
Detailed Description
SystemBlockStore: the BLOCK MANAGEMENT responsibility extracted from the god-class System::Impl (audit Lot B.3, last P0 extraction; follows SystemFieldSolver #176 and SystemStepper).
Extracted VERBATIM from python/system.cpp: no change to numerics, layout, iteration order, indexing, or error message. STRICTLY bit-identical – the code is moved as is.
CONTRACT / INVARIANTS
- OWNS: the BlockState struct (formerly Species: state U + descriptors + closures of the block) and the ordered registry of blocks (vector<BlockState>), the UNIQUE source of truth populated by all add paths (add_block / install_block; add_dynamic_block / add_compiled_block / add_native_block via native_loader).
- EXPOSES: index(name) (0-based index or error), find(name) (const + non const, reference to the block or error), and the state MARSHALING helpers copy_comp0 / copy_state / write_state (host <-> MultiFab copy, device_fence included). The insertion ORDER fixes indexing and thus iteration: it is PRESERVED (push_back at the tail, never sorted nor reshuffled).
- ERROR MESSAGES UNCHANGED: "System: bloc inconnu '...'" (index/find) and "System::set_state: taille != ncomp*n*n" (write_state) are kept VERBATIM (the non-regression of the facade tests depends on it).
- DOES NOT OWN: the domain (ba/dm/dom/geom/pgeom_), the aux and its width, the Poisson/elliptic, the couplings, t/macro_step_. These concerns stay in System::Impl (or in SystemFieldSolver / SystemStepper); the store knows nothing about them.
The blocks registry is PUBLIC: System::Impl exposes it as is via a reference member sp (alias), so that the already-extracted header templates (SystemFieldSolver, SystemStepper, native_loader) that iterate owner_->sp / P->sp and name Impl::Species stay UNCHANGED and bit-identical. The struct is named BlockState (clearer meaning than the historical "Species"); Impl keeps the alias using Species = SystemBlockStore::BlockState; for template compatibility.
Generated by