AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
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... | |
Device-copyable query object for running implicit grid queries on the GPU.
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::SpacePoint = primal::Point<double, NDIMS> |
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::SpatialBoundingBox = primal::BoundingBox<double, NDIMS> |
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::LatticeType = RectangularLattice<NDIMS, double, IndexType> |
using axom::spin::ImplicitGrid< NDIMS, ExecSpace, TheIndexType >::QueryObject::BitsetType = slam::BitSet |
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> > |
|
inline |
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.
[in] | pt | the point to query the implicit grid against. |
References axom::utilities::clampUpper(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::spin::RectangularLattice< NDIMS, SpaceCoordType, CellCoordType >::gridCell(), and axom::utilities::popcount().
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.
[in] | bbox | the bounding box to query the implicit grid against. |
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().
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.
[in] | pt | the point to query the implicit grid against. |
[in] | candidateFunc | the function object to be called for each intersection candidate |
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().
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.
[in] | bbox | the bounding box to query the implicit grid against. |
[in] | candidateFunc | the function object to be called for each intersection candidate |
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().