ORDERED registry of the System blocks + state marshaling helpers.
More...
#include <system_block_store.hpp>
|
| struct | BlockState |
| | Compiled closures frozen at block add time (composite model + spatial scheme + time). More...
|
| |
|
| using | CellConvert = std::function< void(const double *in, double *out)> |
| | Type-erase of the POINTWISE (one cell) cons <-> prim conversion of a block: in/out are arrays of ncomp doubles.
|
| |
|
| BlockState & | find (const std::string &name) |
| | Reference to block name (for writing).
|
| |
| const BlockState & | find (const std::string &name) const |
| | Reference to block name (for reading).
|
| |
| int | index (const std::string &name) const |
| | 0-based index of block name (insertion order).
|
| |
| int | size () const |
| | Number of registered blocks.
|
| |
| std::vector< std::string > | names () const |
| | Block names, in insertion order (UNIQUE source: all add paths appear here).
|
| |
| std::vector< double > | copy_comp0 (const MultiFab &mf) const |
| | Copies component 0 of fab(0) (density) in row-major (j slow, i fast).
|
| |
| std::vector< double > | copy_state (const MultiFab &mf, int ncomp) const |
| | Copies the ncomp components of fab(0) in component-major layout (c slow, then j, then i).
|
| |
| void | write_state (MultiFab &mf, int ncomp, const std::vector< double > &in) |
| | Writes the ncomp components into fab(0) from a component-major buffer (same layout as copy_state).
|
| |
|
| std::vector< BlockState > | blocks |
| | ORDERED registry of the blocks (UNIQUE source of truth).
|
| |
ORDERED registry of the System blocks + state marshaling helpers.
See contract above (OWNS BlockState + the vector; EXPOSES index/find + copy/write_state; DOES NOT OWN the domain/aux/Poisson).
◆ CellConvert
Type-erase of the POINTWISE (one cell) cons <-> prim conversion of a block: in/out are arrays of ncomp doubles.
SAME type as System::CellConvert (identical std::function): assignment from set_block_conversion / native_loader stays a trivial move.
◆ copy_comp0()
| std::vector< double > pops::SystemBlockStore::copy_comp0 |
( |
const MultiFab & |
mf | ) |
const |
|
inline |
Copies component 0 of fab(0) (density) in row-major (j slow, i fast).
device_fence beforehand: the marshaling reads the host, so the device must have finished writing U.
◆ copy_state()
| std::vector< double > pops::SystemBlockStore::copy_state |
( |
const MultiFab & |
mf, |
|
|
int |
ncomp |
|
) |
| const |
|
inline |
Copies the ncomp components of fab(0) in component-major layout (c slow, then j, then i).
◆ find() [1/2]
| BlockState & pops::SystemBlockStore::find |
( |
const std::string & |
name | ) |
|
|
inline |
Reference to block name (for writing).
- Exceptions
-
| std::runtime_error | "System: bloc inconnu '...'". |
◆ find() [2/2]
| const BlockState & pops::SystemBlockStore::find |
( |
const std::string & |
name | ) |
const |
|
inline |
Reference to block name (for reading).
- Exceptions
-
| std::runtime_error | "System: bloc inconnu '...'". |
◆ index()
| int pops::SystemBlockStore::index |
( |
const std::string & |
name | ) |
const |
|
inline |
0-based index of block name (insertion order).
- Exceptions
-
| std::runtime_error | if unknown. |
◆ names()
| std::vector< std::string > pops::SystemBlockStore::names |
( |
| ) |
const |
|
inline |
Block names, in insertion order (UNIQUE source: all add paths appear here).
◆ size()
| int pops::SystemBlockStore::size |
( |
| ) |
const |
|
inline |
Number of registered blocks.
◆ write_state()
| void pops::SystemBlockStore::write_state |
( |
MultiFab & |
mf, |
|
|
int |
ncomp, |
|
|
const std::vector< double > & |
in |
|
) |
| |
|
inline |
Writes the ncomp components into fab(0) from a component-major buffer (same layout as copy_state).
- Exceptions
-
| std::runtime_error | "System::set_state: taille != ncomp*n*n" if the size does not match ncomp*nx*ny (message unchanged). |
◆ blocks
| std::vector<BlockState> pops::SystemBlockStore::blocks |
ORDERED registry of the blocks (UNIQUE source of truth).
PUBLIC: Impl aliases it as sp for the already-extracted templates (SystemFieldSolver / SystemStepper / native_loader) that iterate owner_->sp.
The documentation for this class was generated from the following file: