|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Adds spatial extents to an OctreeBase, allowing point location. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/spin/SpatialOctree.hpp>

Public Types | |
| using | GeometricBoundingBox = primal::BoundingBox< double, DIM > |
| using | SpacePt = primal::Point< double, DIM > |
| using | SpaceVector = primal::Vector< double, DIM > |
| using | BaseOctree = OctreeBase< DIM, BlockDataType > |
| using | GridPt = typename BaseOctree::GridPt |
| using | CoordType = typename GridPt::CoordType |
| using | BlockIndex = typename BaseOctree::BlockIndex |
| using | SpaceVectorLevelMap = slam::Map< SpaceVector > |
| using | GridVec = primal::Vector< CoordType, DIM > |
| using | MAX_LEVEL_SIZE = slam::policies::CompileTimeSize< CoordType, axom::numeric_limits< CoordType >::digits > |
| using | OctreeLevels = slam::OrderedSet< CoordType, CoordType, MAX_LEVEL_SIZE > |
| using | OctreeLevelType = OctreeLevel< DIM, BlockDataType > |
| using | LeafIndicesLevelMap = slam::Map< OctreeLevelType * > |
Public Member Functions | |
| SpatialOctree (const GeometricBoundingBox &bb) | |
| Construct a spatial octree from a spatial bounding box. More... | |
| const GeometricBoundingBox & | boundingBox () const |
| Returns a reference to the octree's bounding box (i.e. the bounding box of the root block) More... | |
| GeometricBoundingBox | blockBoundingBox (const BlockIndex &block) const |
| Return the spatial bounding box of a grid cell at the given level or resolution. More... | |
| GeometricBoundingBox | blockBoundingBox (const GridPt &gridPt, int level) const |
| Return the spatial bounding box of a grid cell at the given level or resolution. More... | |
| const SpaceVector & | spacingAtLevel (int level) const |
| BlockIndex | findLeafBlock (const SpacePt &pt, int startingLevel=-1) const |
| Finds the index of the leaf block covering the query point pt. More... | |
| GridPt | findGridCellAtLevel (const SpacePt &pt, int lev) const |
| Utility function to find the quantized grid cell at level lev for query point pt. More... | |
| int | maxLeafLevel () const |
| The max level for leaf blocks of the octree. More... | |
| int | maxInternalLevel () const |
| The max level for internal blocks of the octree. More... | |
| OctreeLevelType & | getOctreeLevel (int lev) |
| Accessor for a reference to the octree level instance at level lev. More... | |
| const OctreeLevelType & | getOctreeLevel (int lev) const |
| Const accessor for a reference to the octree level instance at level lev. More... | |
| bool | isLevelValid (int lev) const |
| Predicate to determine if level lev is in the range. More... | |
| bool | isLeaf (const GridPt &pt, int lev) const |
| Determine whether the octree contains a leaf block associated with grid point pt at level lev. More... | |
| bool | isLeaf (const BlockIndex &block) const |
| Determine whether the octree contains a leaf block associated with this BlockIndex. More... | |
| bool | isInternal (const GridPt &pt, int lev) const |
| Determine whether the octree contains an internal block associated with grid point pt at level lev. More... | |
| bool | isInternal (const BlockIndex &block) const |
| Determine whether the octree contains an internal block associated with this BlockIndex. More... | |
| bool | hasBlock (const GridPt &pt, int lev) const |
| Determine whether the octree contains a block (internal or leaf) associated with grid point pt at level lev. More... | |
| bool | hasBlock (const BlockIndex &block) const |
| Determine whether the octree contains a block (internal or leaf) associated with this BlockIndex. More... | |
| bool | inBounds (const GridPt &pt, int lev) const |
| Determine whether the octree block associated with grid point pt and level lev is a possible block in this octree. More... | |
| bool | inBounds (const BlockIndex &block) const |
| Determine whether the octree block associated with BlockIndex is a possible block in this octree. More... | |
| void | refineLeaf (const BlockIndex &leafBlock) |
| Refines the given leaf block in the octree. More... | |
| BlockDataType & | operator[] (const BlockIndex &block) |
| Accessor to the data associated with block. More... | |
| const BlockDataType & | operator[] (const BlockIndex &block) const |
| Const accessor to the data associated with block. More... | |
| BlockIndex | coveringLeafBlock (const BlockIndex &blk, bool checkInBounds=true) const |
| Finds the finest octree leaf covering BlockIndex blk. More... | |
| BlockIndex | parent (const GridPt &pt, int level) const |
| Finds the grid index and level of the current octree block's parent. More... | |
| BlockIndex | parent (const BlockIndex &block) const |
| Finds the BlockIndex of the given block's parent. More... | |
| BlockIndex | child (const GridPt &pt, int level, int childIndex) const |
| Finds the BlockIndex of the given block's child. More... | |
| BlockIndex | child (const BlockIndex &block, int childIndex) const |
| Finds the BlockIndex of the given block's child. More... | |
Static Public Member Functions | |
| static CoordType | maxCoordAtLevel (int level) |
| Utility function to find the number of (possible) grid cells at a given level or resolution. More... | |
| static BlockIndex | root () |
Protected Member Functions | |
| TreeBlockStatus | blockStatus (const GridPt &pt, int lev) const |
| Helper function to determine the status of a BlockIndex within an octree instance. More... | |
| TreeBlockStatus | blockStatus (const BlockIndex &blk) const |
| Helper function to determine the status of a BlockIndex within an octree instance. More... | |
Protected Attributes | |
| SpaceVectorLevelMap | m_deltaLevelMap |
| SpaceVectorLevelMap | m_invDeltaLevelMap |
| GeometricBoundingBox | m_boundingBox |
| OctreeLevels | m_levels |
| LeafIndicesLevelMap | m_leavesLevelMap |
Adds spatial extents to an OctreeBase, allowing point location.
| using axom::spin::SpatialOctree< DIM, BlockDataType >::GeometricBoundingBox = primal::BoundingBox<double, DIM> |
| using axom::spin::SpatialOctree< DIM, BlockDataType >::SpacePt = primal::Point<double, DIM> |
| using axom::spin::SpatialOctree< DIM, BlockDataType >::SpaceVector = primal::Vector<double, DIM> |
| using axom::spin::SpatialOctree< DIM, BlockDataType >::BaseOctree = OctreeBase<DIM, BlockDataType> |
| using axom::spin::SpatialOctree< DIM, BlockDataType >::GridPt = typename BaseOctree::GridPt |
| using axom::spin::SpatialOctree< DIM, BlockDataType >::CoordType = typename GridPt::CoordType |
| using axom::spin::SpatialOctree< DIM, BlockDataType >::BlockIndex = typename BaseOctree::BlockIndex |
| using axom::spin::SpatialOctree< DIM, BlockDataType >::SpaceVectorLevelMap = slam::Map<SpaceVector> |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inline |
Construct a spatial octree from a spatial bounding box.
| [in] | bb | The spatial extent to be indexed by the octree |
References axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox, axom::spin::SpatialOctree< DIM, BlockDataType >::m_deltaLevelMap, axom::spin::SpatialOctree< DIM, BlockDataType >::m_invDeltaLevelMap, axom::spin::OctreeBase< DIM, BlockDataType >::m_levels, axom::primal::BoundingBox< T, NDIMS >::range(), and axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy, InterfacePolicy >::size().
|
inline |
Returns a reference to the octree's bounding box (i.e. the bounding box of the root block)
References axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox.
|
inline |
Return the spatial bounding box of a grid cell at the given level or resolution.
|
inline |
Return the spatial bounding box of a grid cell at the given level or resolution.
References axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox, and axom::spin::SpatialOctree< DIM, BlockDataType >::m_deltaLevelMap.
|
inline |
Returns the width of an octree block at level of resolution level
| level | The level of resolution that we are checking |
References axom::spin::SpatialOctree< DIM, BlockDataType >::m_deltaLevelMap.
|
inline |
Finds the index of the leaf block covering the query point pt.
| [in] | pt | The query point in space |
| [in] | startingLevel | (Optional) starting level for the query |
References axom::spin::BlockNotInTree, axom::spin::OctreeBase< DIM, BlockDataType >::blockStatus(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::spin::SpatialOctree< DIM, BlockDataType >::findGridCellAtLevel(), axom::spin::InternalBlock, axom::spin::LeafBlock, axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox, axom::spin::OctreeBase< DIM, BlockDataType >::maxLeafLevel(), and SLIC_ASSERT_MSG.
|
inline |
Utility function to find the quantized grid cell at level lev for query point pt.
| [in] | pt | The point at which we are querying. |
| [in] | lev | The level or resolution. |
References axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::spin::SpatialOctree< DIM, BlockDataType >::m_boundingBox, axom::spin::SpatialOctree< DIM, BlockDataType >::m_invDeltaLevelMap, axom::spin::OctreeBase< DIM, BlockDataType >::maxCoordAtLevel(), and axom::utilities::min().
|
inlineinherited |
The max level for leaf blocks of the octree.
References axom::spin::OctreeBase< DIM, BlockDataType >::m_levels, and axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy, InterfacePolicy >::size().
|
inlineinherited |
The max level for internal blocks of the octree.
References axom::spin::OctreeBase< DIM, BlockDataType >::m_levels, and axom::slam::OrderedSet< PosType, ElemType, SizePolicy, OffsetPolicy, StridePolicy, IndirectionPolicy, SubsettingPolicy, InterfacePolicy >::size().
|
inlinestaticinherited |
Utility function to find the number of (possible) grid cells at a given level or resolution.
| [in] | level | The level or resolution. |
|
inlinestaticinherited |
Auxiliary function to return the root of the octree
|
inlineinherited |
Finds the grid index and level of the current octree block's parent.
| [in] | pt | The grid index of the block whose parent we want to find. |
| [in] | level | The level of the block whose parent we want to find. |
References axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::parent().
|
inlineinherited |
Finds the BlockIndex of the given block's parent.
| [in] | block | The block whose parent we want to find |
References axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::parent().
|
inlineinherited |
Finds the BlockIndex of the given block's child.
| [in] | pt | The grid index of the block whose child we want to find. |
| [in] | level | The level of the block whose child we want to find. |
| [in] | childIndex | The index of the child to find |
References axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::child().
|
inlineinherited |
Finds the BlockIndex of the given block's child.
| [in] | block | The block whose child we want to find |
| [in] | childIndex | The index of the child to find |
References axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::child().
|
inlineinherited |
Accessor for a reference to the octree level instance at level lev.
References axom::spin::OctreeBase< DIM, BlockDataType >::m_leavesLevelMap.
|
inlineinherited |
Const accessor for a reference to the octree level instance at level lev.
References axom::spin::OctreeBase< DIM, BlockDataType >::m_leavesLevelMap.
|
inlineinherited |
Predicate to determine if level lev is in the range.
References axom::spin::OctreeBase< DIM, BlockDataType >::maxLeafLevel().
|
inlineinherited |
Determine whether the octree contains a leaf block associated with grid point pt at level lev.
| [in] | pt | The grid point to check |
| [in] | lev | The level of the grid point |
References axom::spin::OctreeBase< DIM, BlockDataType >::getOctreeLevel(), axom::spin::OctreeLevel< DIM, BlockDataType >::isLeaf(), and axom::spin::OctreeBase< DIM, BlockDataType >::isLevelValid().
|
inlineinherited |
Determine whether the octree contains a leaf block associated with this BlockIndex.
| [in] | block | The BlockIndex of the tree to check |
References axom::spin::OctreeBase< DIM, BlockDataType >::getOctreeLevel(), axom::spin::OctreeLevel< DIM, BlockDataType >::isLeaf(), axom::spin::OctreeBase< DIM, BlockDataType >::isLevelValid(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level(), and axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::pt().
|
inlineinherited |
Determine whether the octree contains an internal block associated with grid point pt at level lev.
| [in] | pt | The grid point to check |
| [in] | lev | The level of the grid point |
References axom::spin::OctreeBase< DIM, BlockDataType >::getOctreeLevel(), axom::spin::OctreeLevel< DIM, BlockDataType >::isInternal(), and axom::spin::OctreeBase< DIM, BlockDataType >::isLevelValid().
|
inlineinherited |
Determine whether the octree contains an internal block associated with this BlockIndex.
| [in] | block | The BlockIndex of the tree to check |
References axom::spin::OctreeBase< DIM, BlockDataType >::getOctreeLevel(), axom::spin::OctreeLevel< DIM, BlockDataType >::isInternal(), axom::spin::OctreeBase< DIM, BlockDataType >::isLevelValid(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level(), and axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::pt().
|
inlineinherited |
Determine whether the octree contains a block (internal or leaf) associated with grid point pt at level lev.
| [in] | pt | The grid point to check |
| [in] | lev | The level of the grid point |
References axom::spin::OctreeBase< DIM, BlockDataType >::isLevelValid(), axom::spin::OctreeBase< DIM, BlockDataType >::m_leavesLevelMap, and SLIC_ASSERT.
|
inlineinherited |
Determine whether the octree contains a block (internal or leaf) associated with this BlockIndex.
| [in] | block | The BlockIndex of the tree to check |
References axom::spin::OctreeBase< DIM, BlockDataType >::hasBlock(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level(), and axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::pt().
|
inlineinherited |
Determine whether the octree block associated with grid point pt and level lev is a possible block in this octree.
References axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::inBounds(), and axom::spin::OctreeBase< DIM, BlockDataType >::isLevelValid().
|
inlineinherited |
Determine whether the octree block associated with BlockIndex is a possible block in this octree.
References axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::inBounds(), axom::spin::OctreeBase< DIM, BlockDataType >::isLevelValid(), and axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level().
|
inlineinherited |
Refines the given leaf block in the octree.
Marks leafBlock as internal (non-leaf) and adds its children to the tree
References axom::spin::OctreeLevel< DIM, BlockDataType >::addAllChildren(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::childLevel(), axom::spin::OctreeBase< DIM, BlockDataType >::getOctreeLevel(), axom::spin::OctreeBase< DIM, BlockDataType >::isLeaf(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::pt(), and SLIC_ASSERT.
|
inlineinherited |
Accessor to the data associated with block.
| block | A block (internal or leaf) in the tree |
References axom::spin::OctreeBase< DIM, BlockDataType >::hasBlock(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level(), axom::spin::OctreeBase< DIM, BlockDataType >::m_leavesLevelMap, axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::pt(), SLIC_ASSERT, and SLIC_ASSERT_MSG.
|
inlineinherited |
Const accessor to the data associated with block.
| block | A block (internal or leaf) in the tree |
References axom::spin::OctreeBase< DIM, BlockDataType >::hasBlock(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level(), axom::spin::OctreeBase< DIM, BlockDataType >::m_leavesLevelMap, axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::pt(), SLIC_ASSERT, and SLIC_ASSERT_MSG.
|
inlineinherited |
Finds the finest octree leaf covering BlockIndex blk.
| blk | A BlockIndex, not necessarily in the octree |
| checkInBounds | A flag to determine if we should check that the block lies within the octree bounds (default=true) |
References axom::spin::BlockNotInTree, axom::spin::OctreeBase< DIM, BlockDataType >::blockStatus(), axom::spin::OctreeBase< DIM, BlockDataType >::hasBlock(), axom::spin::OctreeBase< DIM, BlockDataType >::inBounds(), axom::spin::InternalBlock, axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::invalid_index(), axom::spin::OctreeBase< DIM, BlockDataType >::isLeaf(), axom::spin::LeafBlock, axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::parent(), SLIC_ASSERT, and SLIC_ASSERT_MSG.
|
inlineprotectedinherited |
Helper function to determine the status of a BlockIndex within an octree instance.
| pt | The grid point of the block index that we are testing |
| lev | The level of the block index that we are testing |
References axom::spin::BlockNotInTree, axom::spin::OctreeBase< DIM, BlockDataType >::isLevelValid(), axom::spin::OctreeBase< DIM, BlockDataType >::m_leavesLevelMap, and SLIC_ASSERT.
|
inlineprotectedinherited |
Helper function to determine the status of a BlockIndex within an octree instance.
| blk | The block index we are testing |
References axom::spin::OctreeBase< DIM, BlockDataType >::blockStatus(), axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::level(), and axom::spin::OctreeBase< DIM, BlockDataType >::BlockIndex::pt().
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |