|
core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
|
Z-order (Morton) indexer over an axis-origin-relative cell block. More...
#include <morton_indexer.hpp>
Public Types | |
| using | M = morton::Morton< Dim, Bits > |
| using | Code = typename M::code_type |
| using | Coord = typename M::coord_type |
Public Member Functions | |
| MortonIndexer ()=default | |
| MortonIndexer (IVec< Dim > origin, IVec< Dim > size) | |
| void | init (IVec< Dim > origin, IVec< Dim > size) |
| const IVec< Dim > & | origin () const |
| const IVec< Dim > & | size () const |
| MORTON_HD Code | codeOf (const IVec< Dim > &g) const |
| Global multi-index → Z-order code (origin-relative). | |
| MORTON_HD IVec< Dim > | multiIndex (Code c) const |
| Z-order code → global multi-index (inverse of codeOf). | |
| MORTON_HD Code | neighborCode (Code c, int axis, int dir) const |
Neighbour code one cell along ±axis, computed directly in Morton space (the headline O(1) morton arithmetic — no decode/re-encode). | |
Static Public Member Functions | |
| static constexpr unsigned | bits () |
Z-order (Morton) indexer over an axis-origin-relative cell block.
Bits is the per-axis code width; the default keeps the code in a built-in 64-bit integer (3D: 21 bits/axis → 96-bit codes use __uint128, so we cap the default at 21 for a 64-bit code_type in 3D and 32 in 2D). A block extent must satisfy size[i] <= 2^Bits. Codes are origin-relative: codeOf subtracts the origin so the curve starts at the block corner.
Definition at line 33 of file morton_indexer.hpp.
| using peclet::core::decomp::MortonIndexer< Dim, Bits >::M = morton::Morton<Dim, Bits> |
Definition at line 35 of file morton_indexer.hpp.
| using peclet::core::decomp::MortonIndexer< Dim, Bits >::Code = typename M::code_type |
Definition at line 36 of file morton_indexer.hpp.
| using peclet::core::decomp::MortonIndexer< Dim, Bits >::Coord = typename M::coord_type |
Definition at line 37 of file morton_indexer.hpp.
|
default |
|
inline |
Definition at line 40 of file morton_indexer.hpp.
References peclet::core::decomp::MortonIndexer< Dim, Bits >::init(), peclet::core::decomp::MortonIndexer< Dim, Bits >::origin(), and peclet::core::decomp::MortonIndexer< Dim, Bits >::size().
|
inline |
Definition at line 42 of file morton_indexer.hpp.
References peclet::core::decomp::MortonIndexer< Dim, Bits >::origin(), and peclet::core::decomp::MortonIndexer< Dim, Bits >::size().
Referenced by peclet::core::decomp::MortonIndexer< Dim, Bits >::MortonIndexer().
|
inlinestaticconstexpr |
Definition at line 47 of file morton_indexer.hpp.
|
inline |
Definition at line 48 of file morton_indexer.hpp.
Referenced by peclet::core::decomp::MortonIndexer< Dim, Bits >::init(), and peclet::core::decomp::MortonIndexer< Dim, Bits >::MortonIndexer().
|
inline |
Definition at line 49 of file morton_indexer.hpp.
Referenced by peclet::core::decomp::MortonIndexer< Dim, Bits >::init(), and peclet::core::decomp::MortonIndexer< Dim, Bits >::MortonIndexer().
|
inline |
Global multi-index → Z-order code (origin-relative).
Precondition: every g[i] - origin[i] is in [0, 2^Bits).
Definition at line 53 of file morton_indexer.hpp.
|
inline |
Z-order code → global multi-index (inverse of codeOf).
Definition at line 61 of file morton_indexer.hpp.
|
inline |
Neighbour code one cell along ±axis, computed directly in Morton space (the headline O(1) morton arithmetic — no decode/re-encode).
dir>=0 → +1. Wraps mod 2^Bits per axis, like morton's neighbor.
Definition at line 72 of file morton_indexer.hpp.