AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::spin::OctreeLevel< DIM, BlockDataType > Class Template Referenceabstract

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/spin/OctreeLevel.hpp>

Inheritance diagram for axom::spin::OctreeLevel< DIM, BlockDataType >:

Classes

class  BlockIterator
 
class  BlockIteratorHelper
 A virtual base class to help with iteration of an OctreeLevel's blocks. More...
 
class  ConstBlockIteratorHelper
 A virtual base class to help with constant iteration of an OctreeLevel's blocks. More...
 

Public Types

enum  { BROOD_SIZE = 1 << DIM }
 
using CoordType = axom::IndexType
 
using GridPt = primal::Point< CoordType, DIM >
 A type for the grid points of the octree. More...
 
using BroodData = primal::NumericArray< BlockDataType, BROOD_SIZE >
 
using BlockIter = BlockIterator< OctreeLevel, BlockIteratorHelper, BlockDataType >
 
using ConstBlockIter = BlockIterator< const OctreeLevel, ConstBlockIteratorHelper, const BlockDataType >
 

Public Member Functions

 OctreeLevel (int level=-1)
 Constructor of an OctreeLevel at level lev. More...
 
virtual ~OctreeLevel ()
 Virtual destructor of an OctreeLevel. More...
 
CoordType maxCoord () const
 Returns the maximum coordinate value in the level. More...
 
GridPt maxGridCell () const
 Returns a GridPt whose coordinates are set to maxCoord. More...
 
int level () const
 
bool inBounds (const GridPt &pt) const
 Predicate to check whether the block associated with the given GridPt pt is an allowed block in the level. More...
 
bool isLeaf (const GridPt &pt) const
 Predicate to check whether the block associated with the given GridPt pt is a leaf block. More...
 
bool isInternal (const GridPt &pt) const
 Predicate to check whether the block associated with the given GridPt pt is an internal block. More...
 
BlockIter begin ()
 Begin iterator to points and data in tree level. More...
 
ConstBlockIter begin () const
 Const begin iterator to points and data in tree level. More...
 
BlockIter end ()
 End iterator to points and data in tree level. More...
 
ConstBlockIter end () const
 Const end iterator to points and data in tree level. More...
 
virtual TreeBlockStatus blockStatus (const GridPt &pt) const =0
 Virtual function to check the status of a block (e.g. Leaf, Internal, NotInTree) More...
 
virtual bool empty () const =0
 Virtual predicate to determine if the OctreeLevel is empty. More...
 
virtual bool hasBlock (const GridPt &pt) const =0
 Virtual predicate to determine if the OctreeLevel has a block with the given grid point pt. More...
 
virtual void addAllChildren (const GridPt &pt)=0
 Virtual function to add all children of the given grid point pt to the OctreeLevel. More...
 
virtual const BlockDataType & operator[] (const GridPt &pt) const =0
 Virtual const accessor for the data associated with grid point pt. More...
 
virtual BlockDataType & operator[] (const GridPt &pt)=0
 Virtual accessor for the data associated with grid point pt. More...
 
virtual BroodDatagetBroodData (const GridPt &pt)=0
 Virtual accessor for the data associated with all children of the given grid point (i.e. the brood) More...
 
virtual const BroodDatagetBroodData (const GridPt &pt) const =0
 Virtual const accessor for the data associated with all children of the given grid point (i.e. the brood) More...
 
virtual BlockIteratorHelpergetIteratorHelper (bool)=0
 Virtual factory function to create an iterator helper. More...
 
virtual ConstBlockIteratorHelpergetIteratorHelper (bool) const =0
 Virtual factory function to create a const iterator helper. More...
 
virtual int numBlocks () const =0
 Virtual function to compute the number of blocks (internal and leaf) in the level. More...
 
virtual int numInternalBlocks () const =0
 Virtual function to compute the number of internal blocks in the level. More...
 
virtual int numLeafBlocks () const =0
 Virtual function to compute the number of leaf blocks in the level. More...
 

Protected Attributes

int m_level
 

Member Typedef Documentation

◆ CoordType

template<int DIM, typename BlockDataType >
using axom::spin::OctreeLevel< DIM, BlockDataType >::CoordType = axom::IndexType

The coordinate type of a block in the octree

◆ GridPt

template<int DIM, typename BlockDataType >
using axom::spin::OctreeLevel< DIM, BlockDataType >::GridPt = primal::Point<CoordType, DIM>

A type for the grid points of the octree.

Note
CoordType must be an integral type

◆ BroodData

template<int DIM, typename BlockDataType >
using axom::spin::OctreeLevel< DIM, BlockDataType >::BroodData = primal::NumericArray<BlockDataType, BROOD_SIZE>

A brood is a collection of sibling blocks that are generated simultaneously

◆ BlockIter

template<int DIM, typename BlockDataType >
using axom::spin::OctreeLevel< DIM, BlockDataType >::BlockIter = BlockIterator<OctreeLevel, BlockIteratorHelper, BlockDataType>

◆ ConstBlockIter

template<int DIM, typename BlockDataType >
using axom::spin::OctreeLevel< DIM, BlockDataType >::ConstBlockIter = BlockIterator<const OctreeLevel, ConstBlockIteratorHelper, const BlockDataType>

Member Enumeration Documentation

◆ anonymous enum

template<int DIM, typename BlockDataType >
anonymous enum
Enumerator
BROOD_SIZE 

Constructor & Destructor Documentation

◆ OctreeLevel()

template<int DIM, typename BlockDataType >
axom::spin::OctreeLevel< DIM, BlockDataType >::OctreeLevel ( int  level = -1)
inline

Constructor of an OctreeLevel at level lev.

◆ ~OctreeLevel()

template<int DIM, typename BlockDataType >
virtual axom::spin::OctreeLevel< DIM, BlockDataType >::~OctreeLevel ( )
inlinevirtual

Virtual destructor of an OctreeLevel.

Member Function Documentation

◆ maxCoord()

template<int DIM, typename BlockDataType >
CoordType axom::spin::OctreeLevel< DIM, BlockDataType >::maxCoord ( ) const
inline

Returns the maximum coordinate value in the level.

Note
This is (2^l -1), where L is the current level

References axom::spin::OctreeLevel< DIM, BlockDataType >::m_level.

◆ maxGridCell()

template<int DIM, typename BlockDataType >
GridPt axom::spin::OctreeLevel< DIM, BlockDataType >::maxGridCell ( ) const
inline

Returns a GridPt whose coordinates are set to maxCoord.

See also
maxCoord()

References axom::spin::OctreeLevel< DIM, BlockDataType >::maxCoord().

◆ level()

template<int DIM, typename BlockDataType >
int axom::spin::OctreeLevel< DIM, BlockDataType >::level ( ) const
inline

Accessor for the instance's level

References axom::spin::OctreeLevel< DIM, BlockDataType >::m_level.

◆ inBounds()

template<int DIM, typename BlockDataType >
bool axom::spin::OctreeLevel< DIM, BlockDataType >::inBounds ( const GridPt pt) const
inline

Predicate to check whether the block associated with the given GridPt pt is an allowed block in the level.

Parameters
[in]ptThe gridpoint of the block to check
Note
pt is inBounds if each of its coordinates is a non-negative integer less than maxCoord()
See also
maxCoord()

References axom::spin::OctreeLevel< DIM, BlockDataType >::maxCoord().

◆ isLeaf()

template<int DIM, typename BlockDataType >
bool axom::spin::OctreeLevel< DIM, BlockDataType >::isLeaf ( const GridPt pt) const
inline

Predicate to check whether the block associated with the given GridPt pt is a leaf block.

References axom::spin::OctreeLevel< DIM, BlockDataType >::blockStatus(), and axom::spin::LeafBlock.

◆ isInternal()

template<int DIM, typename BlockDataType >
bool axom::spin::OctreeLevel< DIM, BlockDataType >::isInternal ( const GridPt pt) const
inline

Predicate to check whether the block associated with the given GridPt pt is an internal block.

References axom::spin::OctreeLevel< DIM, BlockDataType >::blockStatus(), and axom::spin::InternalBlock.

◆ begin() [1/2]

template<int DIM, typename BlockDataType >
BlockIter axom::spin::OctreeLevel< DIM, BlockDataType >::begin ( )
inline

Begin iterator to points and data in tree level.

◆ begin() [2/2]

template<int DIM, typename BlockDataType >
ConstBlockIter axom::spin::OctreeLevel< DIM, BlockDataType >::begin ( ) const
inline

Const begin iterator to points and data in tree level.

◆ end() [1/2]

template<int DIM, typename BlockDataType >
BlockIter axom::spin::OctreeLevel< DIM, BlockDataType >::end ( )
inline

End iterator to points and data in tree level.

◆ end() [2/2]

template<int DIM, typename BlockDataType >
ConstBlockIter axom::spin::OctreeLevel< DIM, BlockDataType >::end ( ) const
inline

Const end iterator to points and data in tree level.

◆ blockStatus()

template<int DIM, typename BlockDataType >
virtual TreeBlockStatus axom::spin::OctreeLevel< DIM, BlockDataType >::blockStatus ( const GridPt pt) const
pure virtual

Virtual function to check the status of a block (e.g. Leaf, Internal, NotInTree)

Implemented in axom::spin::SparseOctreeLevel< DIM, BlockDataType, PointRepresenationType >, and axom::spin::DenseOctreeLevel< DIM, BlockDataType, MortonIndexType >.

◆ empty()

template<int DIM, typename BlockDataType >
virtual bool axom::spin::OctreeLevel< DIM, BlockDataType >::empty ( ) const
pure virtual

◆ hasBlock()

template<int DIM, typename BlockDataType >
virtual bool axom::spin::OctreeLevel< DIM, BlockDataType >::hasBlock ( const GridPt pt) const
pure virtual

Virtual predicate to determine if the OctreeLevel has a block with the given grid point pt.

Implemented in axom::spin::SparseOctreeLevel< DIM, BlockDataType, PointRepresenationType >, and axom::spin::DenseOctreeLevel< DIM, BlockDataType, MortonIndexType >.

◆ addAllChildren()

template<int DIM, typename BlockDataType >
virtual void axom::spin::OctreeLevel< DIM, BlockDataType >::addAllChildren ( const GridPt pt)
pure virtual

◆ operator[]() [1/2]

template<int DIM, typename BlockDataType >
virtual const BlockDataType& axom::spin::OctreeLevel< DIM, BlockDataType >::operator[] ( const GridPt pt) const
pure virtual

◆ operator[]() [2/2]

template<int DIM, typename BlockDataType >
virtual BlockDataType& axom::spin::OctreeLevel< DIM, BlockDataType >::operator[] ( const GridPt pt)
pure virtual

◆ getBroodData() [1/2]

template<int DIM, typename BlockDataType >
virtual BroodData& axom::spin::OctreeLevel< DIM, BlockDataType >::getBroodData ( const GridPt pt)
pure virtual

Virtual accessor for the data associated with all children of the given grid point (i.e. the brood)

Implemented in axom::spin::SparseOctreeLevel< DIM, BlockDataType, PointRepresenationType >, and axom::spin::DenseOctreeLevel< DIM, BlockDataType, MortonIndexType >.

◆ getBroodData() [2/2]

template<int DIM, typename BlockDataType >
virtual const BroodData& axom::spin::OctreeLevel< DIM, BlockDataType >::getBroodData ( const GridPt pt) const
pure virtual

Virtual const accessor for the data associated with all children of the given grid point (i.e. the brood)

Implemented in axom::spin::SparseOctreeLevel< DIM, BlockDataType, PointRepresenationType >, and axom::spin::DenseOctreeLevel< DIM, BlockDataType, MortonIndexType >.

◆ getIteratorHelper() [1/2]

template<int DIM, typename BlockDataType >
virtual BlockIteratorHelper* axom::spin::OctreeLevel< DIM, BlockDataType >::getIteratorHelper ( bool  )
pure virtual

Virtual factory function to create an iterator helper.

Parameters
Aboolean to determine if the iterator should be a begin iterator (true) or an end iterator (false)

Implemented in axom::spin::SparseOctreeLevel< DIM, BlockDataType, PointRepresenationType >, and axom::spin::DenseOctreeLevel< DIM, BlockDataType, MortonIndexType >.

◆ getIteratorHelper() [2/2]

template<int DIM, typename BlockDataType >
virtual ConstBlockIteratorHelper* axom::spin::OctreeLevel< DIM, BlockDataType >::getIteratorHelper ( bool  ) const
pure virtual

Virtual factory function to create a const iterator helper.

Parameters
Aboolean to determine if the iterator should be a begin iterator (true) or an end iterator (false)

Implemented in axom::spin::SparseOctreeLevel< DIM, BlockDataType, PointRepresenationType >, and axom::spin::DenseOctreeLevel< DIM, BlockDataType, MortonIndexType >.

◆ numBlocks()

template<int DIM, typename BlockDataType >
virtual int axom::spin::OctreeLevel< DIM, BlockDataType >::numBlocks ( ) const
pure virtual

Virtual function to compute the number of blocks (internal and leaf) in the level.

Implemented in axom::spin::SparseOctreeLevel< DIM, BlockDataType, PointRepresenationType >, and axom::spin::DenseOctreeLevel< DIM, BlockDataType, MortonIndexType >.

◆ numInternalBlocks()

template<int DIM, typename BlockDataType >
virtual int axom::spin::OctreeLevel< DIM, BlockDataType >::numInternalBlocks ( ) const
pure virtual

Virtual function to compute the number of internal blocks in the level.

Implemented in axom::spin::SparseOctreeLevel< DIM, BlockDataType, PointRepresenationType >, and axom::spin::DenseOctreeLevel< DIM, BlockDataType, MortonIndexType >.

◆ numLeafBlocks()

template<int DIM, typename BlockDataType >
virtual int axom::spin::OctreeLevel< DIM, BlockDataType >::numLeafBlocks ( ) const
pure virtual

Member Data Documentation

◆ m_level

template<int DIM, typename BlockDataType >
int axom::spin::OctreeLevel< DIM, BlockDataType >::m_level
protected

The documentation for this class was generated from the following file: