Per-box CSR lookup from a source cell to the destination boxes whose ghosted region covers it.
More...
|
|
| ParticleGhostMask ()=default |
| | Default constructor. Leaves the table undefined; call define() before use.
|
| |
|
| ~ParticleGhostMask ()=default |
| | Destructor.
|
| |
| void | define (const Box &a_box) noexcept |
| | Reset to an empty table over a box (every cell has zero targets).
|
| |
| void | incrementCount (const IntVect &a_iv) noexcept |
| | Build pass 1: register that cell a_iv gains one more target.
|
| |
|
void | allocate () noexcept |
| | Build step between the passes: turn the per-cell counts into CSR offsets and size the packed target array. Must be called after all incrementCount() and before any addTarget().
|
| |
| void | allocateTargetBoxes () noexcept |
| | Optional build step: size the per-target acceptance-box array to match the packed target array.
|
| |
| void | addTarget (const IntVect &a_iv, const LevelTiles::BoxIDs &a_target) noexcept |
| | Build pass 2: append one target for cell a_iv.
|
| |
| void | addTarget (const IntVect &a_iv, const LevelTiles::BoxIDs &a_target, const Box &a_targetBox) noexcept |
| | Build pass 2 with an acceptance box: append one target and its acceptance box for cell a_iv.
|
| |
|
void | finalize () noexcept |
| | Finish the build: rewind m_start (advanced by addTarget) back to the CSR start offsets.
|
| |
| const Box & | box () const noexcept |
| | Get the box that the source cells live on.
|
| |
| int | numTargets (const IntVect &a_iv) const noexcept |
| | Get the number of scatter targets for a cell.
|
| |
| const LevelTiles::BoxIDs & | target (const IntVect &a_iv, const int a_i) const noexcept |
| | Get the i-th scatter target for a cell.
|
| |
| unsigned int | targetGridIndex (const IntVect &a_iv, const int a_i) const noexcept |
| | Get the destination grid index of the i-th target for a cell.
|
| |
| unsigned int | targetRank (const IntVect &a_iv, const int a_i) const noexcept |
| | Get the receiving rank of the i-th target for a cell.
|
| |
| const Box & | targetBox (const IntVect &a_iv, const int a_i) const noexcept |
| | Get the acceptance box of the i-th target for a cell.
|
| |
| bool | hasTargetBoxes () const noexcept |
| | Whether this mask carries per-target acceptance boxes.
|
| |
Per-box CSR lookup from a source cell to the destination boxes whose ghosted region covers it.
Each cell of the box maps to zero or more scatter targets, a target being a LevelTiles::BoxIDs pair = (grid index on the destination level, rank that owns and will receive that box). Storage is compressed-sparse-row: for a cell, m_start holds the offset into the packed target array m_flat and m_count the number of targets. A cell may map to several targets (overlapping ghosted boxes, e.g. diagonal coarse-fine cells) with no fixed cap; the sending rank is not stored.
Optionally (coarse-to-fine only) each target also carries an acceptance box: the destination box's ghost region measured in DESTINATION cells (grown by the ghost width). It lets the scatter prune whole-coarse-cell over-communication down to the exact sub-cell shell – a candidate particle is scattered only if its destination cell lies in the acceptance box. This parallel array m_flatBox is populated only when allocateTargetBoxes()/addTarget(...,box) are used; same-level and fine-to-coarse masks leave it empty (no per-target box, no memory cost).
The build API is a two-pass fill (define -> incrementCount per contribution -> allocate [-> allocateTargetBoxes] -> addTarget per contribution -> finalize). The query API (numTargets/target/ targetGridIndex/targetRank[/targetBox]) is inlined so downstream scatter code never touches the CSR internals.