AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject Struct Reference

Device-copyable query object for running implicit grid queries on the GPU. More...

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

Public Types

using SpacePoint = primal::Point< double, NDIMS >
 
using SpatialBoundingBox = primal::BoundingBox< double, NDIMS >
 
using LatticeType = RectangularLattice< NDIMS, double, IndexType >
 
using BitsetType = slam::BitSet
 
using BinBitMap = slam::Map< BitsetType, slam::Set< IndexType, IndexType >, slam::policies::ArrayIndirection< IndexType, BitsetType >, slam::policies::StrideOne< IndexType > >
 

Public Member Functions

 QueryObject (const SpatialBoundingBox &spaceBb, const LatticeType &lattice, const BinBitMap(&binData)[NDIMS], const axom::Array< IndexType >(&minBlkBins)[NDIMS], const axom::Array< IndexType >(&maxBlkBins)[NDIMS])
 
AXOM_HOST_DEVICE IndexType countCandidates (const SpacePoint &pt) const
 Counts the number of elements in the implicit grid which may intersect with the given point. More...
 
AXOM_HOST_DEVICE IndexType countCandidates (const SpatialBoundingBox &bbox) const
 Counts the number of elements in the implicit grid which may intersect with the given bounding box. More...
 
template<typename FuncType >
AXOM_HOST_DEVICE void visitCandidates (const SpacePoint &pt, FuncType &&candidateFunc) const
 Iterates through the implicit grid, calling a given function for each candidate element which potentially intersects the given point. More...
 
template<typename FuncType >
AXOM_HOST_DEVICE void visitCandidates (const SpatialBoundingBox &bbox, FuncType &&candidateFunc) const
 Iterates through the implicit grid, calling a given function for each candidate element which potentially intersects the given bounding box. More...
 

Detailed Description

template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC, typename TheIndexType = int>
struct axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject

Device-copyable query object for running implicit grid queries on the GPU.

Member Typedef Documentation

◆ SpacePoint

template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC, typename TheIndexType = int>
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::SpacePoint = primal::Point<double, NDIMS>

◆ SpatialBoundingBox

template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC, typename TheIndexType = int>
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::SpatialBoundingBox = primal::BoundingBox<double, NDIMS>

◆ LatticeType

template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC, typename TheIndexType = int>
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::LatticeType = RectangularLattice<NDIMS, double, IndexType>

◆ BitsetType

template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC, typename TheIndexType = int>
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::BitsetType = slam::BitSet

◆ BinBitMap

template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC, typename TheIndexType = int>
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::BinBitMap = slam::Map<BitsetType, slam::Set<IndexType, IndexType>, slam::policies::ArrayIndirection<IndexType, BitsetType>, slam::policies::StrideOne<IndexType> >

Constructor & Destructor Documentation

◆ QueryObject()

template<int NDIMS, typename ExecSpace = axom::SEQ_EXEC, typename TheIndexType = int>
axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::QueryObject ( const SpatialBoundingBox spaceBb,
const LatticeType lattice,
const BinBitMap(&)  binData[NDIMS],
const axom::Array< IndexType >(&)  minBlkBins[NDIMS],
const axom::Array< IndexType >(&)  maxBlkBins[NDIMS] 
)
inline

Member Function Documentation

◆ countCandidates() [1/2]

template<int NDIMS, typename ExecSpace , typename IndexType >
AXOM_HOST_DEVICE IndexType axom::spin::ImplicitGrid< NDIMS, ExecSpace, IndexType >::QueryObject::countCandidates ( const SpacePoint pt) const

Counts the number of elements in the implicit grid which may intersect with the given point.

Parameters
[in]ptthe point to query the implicit grid against.
Returns
numCandidates the number of candidates for the given point.

References axom::utilities::clampUpper(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::spin::RectangularLattice< NDIMS, SpaceCoordType, CellCoordType >::gridCell(), and axom::utilities::popcount().

◆ countCandidates() [2/2]

template<int NDIMS, typename ExecSpace , typename IndexType >
AXOM_HOST_DEVICE IndexType axom::spin::ImplicitGrid< NDIMS, ExecSpace, IndexType >::QueryObject::countCandidates ( const SpatialBoundingBox bbox) const

Counts the number of elements in the implicit grid which may intersect with the given bounding box.

Parameters
[in]bboxthe bounding box to query the implicit grid against.
Returns
numCandidates the number of candidates for the given bounding box.

References axom::utilities::clampLower(), axom::utilities::clampUpper(), axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::data(), axom::primal::BoundingBox< T, NDIMS >::getMax(), axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::spin::RectangularLattice< NDIMS, SpaceCoordType, CellCoordType >::gridCell(), axom::primal::BoundingBox< T, NDIMS >::intersectsWith(), and axom::utilities::popcount().

◆ visitCandidates() [1/2]

template<int NDIMS, typename ExecSpace , typename IndexType >
template<typename FuncType >
AXOM_HOST_DEVICE void axom::spin::ImplicitGrid< NDIMS, ExecSpace, IndexType >::QueryObject::visitCandidates ( const SpacePoint pt,
FuncType &&  candidateFunc 
) const

Iterates through the implicit grid, calling a given function for each candidate element which potentially intersects the given point.

Parameters
[in]ptthe point to query the implicit grid against.
[in]candidateFuncthe function object to be called for each intersection candidate
Note
The supplied functor candidateFunc is expected to take one argument, the index of the candidate element. The functor may optionally return a boolean, where a value of true terminates the candidate search early.

References axom::slam::BitSet::BitsPerWord, axom::utilities::clampUpper(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::utilities::countr_zero(), axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::data(), axom::spin::RectangularLattice< NDIMS, SpaceCoordType, CellCoordType >::gridCell(), axom::utilities::min(), and axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::size().

◆ visitCandidates() [2/2]

template<int NDIMS, typename ExecSpace , typename IndexType >
template<typename FuncType >
AXOM_HOST_DEVICE void axom::spin::ImplicitGrid< NDIMS, ExecSpace, IndexType >::QueryObject::visitCandidates ( const SpatialBoundingBox bbox,
FuncType &&  candidateFunc 
) const

Iterates through the implicit grid, calling a given function for each candidate element which potentially intersects the given bounding box.

Parameters
[in]bboxthe bounding box to query the implicit grid against.
[in]candidateFuncthe function object to be called for each intersection candidate
Note
The supplied functor candidateFunc is expected to take one argument, the index of the candidate element. The functor may optionally return a boolean, where a value of true terminates the candidate search early.

References axom::slam::BitSet::BitsPerWord, axom::utilities::clampLower(), axom::utilities::clampUpper(), axom::utilities::countr_zero(), axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::data(), axom::primal::BoundingBox< T, NDIMS >::getMax(), axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::spin::RectangularLattice< NDIMS, SpaceCoordType, CellCoordType >::gridCell(), axom::primal::BoundingBox< T, NDIMS >::intersectsWith(), axom::utilities::min(), and axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::size().


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