AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Inner class encapsulating the index of an octree block. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.3.3/src/axom/spin/OctreeBase.hpp>
Public Types | |
enum | { NUM_CHILDREN = 1 << DIM, NUM_FACE_NEIGHBORS = 2 * DIM } |
using | ChildIndexSet = slam::OrderedSet< int, int, OCTREE_CHILDREN_SIZE > |
using | FaceNeighborIndexSet = slam::OrderedSet< int, int, OCTREE_FACE_NEIGHBORS_SIZE > |
Public Member Functions | |
BlockIndex () | |
Default constructor. More... | |
BlockIndex (const GridPt &pt, int level) | |
Constructor from a point and a level. More... | |
const GridPt & | pt () const |
Accessor for the BlockIndex instance's point. More... | |
GridPt & | pt () |
Accessor for the BlockIndex instance's point. More... | |
const int & | level () const |
Accessor for the BlockIndex instance's level. More... | |
int & | level () |
Accessor for the BlockIndex instance's level. More... | |
int | parentLevel () const |
The level of the block index's parent. More... | |
int | childLevel () const |
The level of the block index's child. More... | |
GridPt | parentPt () const |
Returns the grid point of the block's parent. More... | |
GridPt | childPt (int childIndex) const |
Returns the grid point of the block's child at index childIndex. More... | |
GridPt | neighborPt (const GridPt &offset) const |
Returns a grid point at the specified offset from the current block index's point. More... | |
BlockIndex | parent () const |
Returns the parent BlockIndex of this block. More... | |
BlockIndex | child (int childIndex) const |
Returns the child BlockIndex of this block. More... | |
BlockIndex | faceNeighbor (int neighborIndex) const |
Returns the face neighbor grid point of this block. More... | |
bool | operator== (const BlockIndex &other) const |
bool | operator!= (const BlockIndex &other) const |
bool | operator< (const BlockIndex &other) const |
bool | isValid () const |
Checks the validity of the index. More... | |
bool | inBounds () const |
Checks the if the block is in bounds for the level. More... | |
bool | isDescendantOf (const BlockIndex &ancestor) const |
Predicate to determine if the block instance is a descendant of ancestor block. More... | |
std::ostream & | print (std::ostream &os) const |
Static Public Member Functions | |
static BlockIndex | invalid_index () |
Helper function to generate an invalid block index. More... | |
static int | numChildren () |
The number of children that an octree block can have. More... | |
static int | numFaceNeighbors () |
The number of face neighbors that an octree block can have (ignoring boundaries) More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const BlockIndex &block) |
Inner class encapsulating the index of an octree block.
Each block index is represented as a point on an integer grid (the minimum point of the block's extent) at a given level of resolution.
Each level of resolution is a regular grid with \( 2^{level} \) grid points along each dimension. The root block (at level 0) covers the entire domain. An octree block at level \( \ell \) has \( 2^{DIM} \) children at level \( \ell + 1 \) covering its domain.
using axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::ChildIndexSet = slam::OrderedSet<int, int, OCTREE_CHILDREN_SIZE> |
using axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::FaceNeighborIndexSet = slam::OrderedSet<int, int, OCTREE_FACE_NEIGHBORS_SIZE> |
anonymous enum |
|
inline |
Default constructor.
|
inline |
Constructor from a point and a level.
|
inline |
Accessor for the BlockIndex instance's point.
Referenced by axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::isDescendantOf().
|
inline |
Accessor for the BlockIndex instance's point.
|
inline |
Accessor for the BlockIndex instance's level.
Referenced by axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::isDescendantOf().
|
inline |
Accessor for the BlockIndex instance's level.
|
inline |
The level of the block index's parent.
|
inline |
The level of the block index's child.
|
inline |
Returns the grid point of the block's parent.
|
inline |
Returns the grid point of the block's child at index childIndex.
[in] | childIndex | The index of the child whose grid point we are finding |
References SLIC_ASSERT.
|
inline |
Returns a grid point at the specified offset from the current block index's point.
|
inline |
Returns the parent BlockIndex of this block.
Referenced by axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::isDescendantOf().
|
inline |
Returns the child BlockIndex of this block.
[in] | childIndex | The index of the child whose grid point we are finding |
|
inline |
Returns the face neighbor grid point of this block.
References SLIC_ASSERT.
|
inline |
|
inline |
|
inline |
|
inline |
Checks the validity of the index.
A block index is valid when its level is \( \ge 0 \) and it is inBounds
|
inline |
Checks the if the block is in bounds for the level.
A block index is in bounds when each coordinate p[i] of its grid point is \( 0 \le p[i] < 2^{level()} \).
|
inline |
Predicate to determine if the block instance is a descendant of ancestor block.
ancestor | The potential ancestor of the block |
References axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::parent(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::pt(), and SLIC_ASSERT.
|
inline |
|
inlinestatic |
Helper function to generate an invalid block index.
|
inlinestatic |
The number of children that an octree block can have.
|
inlinestatic |
The number of face neighbors that an octree block can have (ignoring boundaries)
|
friend |