|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
This class encapsulates a structured mesh size and contains methods to help with indexing into it. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/bump/views/StructuredIndexing.hpp>

Public Types | |
| using | IndexType = IndexT |
| using | LogicalIndex = axom::StackArray< IndexType, NDIMS > |
Public Member Functions | |
| AXOM_HOST_DEVICE | StructuredIndexing () |
| constructor More... | |
| AXOM_HOST_DEVICE | StructuredIndexing (const LogicalIndex &dims) |
| AXOM_HOST_DEVICE IndexType | size () const |
| Return the number of points in the index space. More... | |
| AXOM_HOST_DEVICE const LogicalIndex & | logicalDimensions () const |
| Return the logical dimensions. More... | |
| AXOM_HOST_DEVICE IndexType ::type | jStride () const |
| template<int _ndims = NDIMS> | |
| AXOM_HOST_DEVICE std::enable_if< _ndims==3, IndexType >::type | kStride () const |
| Return the k stride. More... | |
| AXOM_HOST_DEVICE IndexType | globalToGlobal (const LogicalIndex &global) const |
| Turn a global logical index into an index. More... | |
| AXOM_HOST_DEVICE LogicalIndex | globalToGlobal (IndexType global) const |
| Turn a global index into a global logical index. More... | |
| AXOM_HOST_DEVICE LogicalIndex | globalToLocal (const LogicalIndex &index) const |
| Turn global logical index to local logical index. no-op. More... | |
| AXOM_HOST_DEVICE IndexType | globalToLocal (IndexType index) const |
| Turn global index to local index. no-op. More... | |
| AXOM_HOST_DEVICE LogicalIndex | localToGlobal (const LogicalIndex &index) const |
| Turn local logical index to global logical index. no-op. More... | |
| AXOM_HOST_DEVICE IndexType | localToGlobal (IndexType index) const |
| Turn local index to global index. no-op. More... | |
| AXOM_HOST_DEVICE bool | contains (const LogicalIndex &logical) const |
| Determines whether the indexing contains the supplied logical index. More... | |
| AXOM_HOST_DEVICE bool | contains (IndexType index) const |
| Determines whether the indexing contains the supplied index. More... | |
| AXOM_HOST_DEVICE StructuredIndexing | expand () const |
| Expand the current StructuredIndexing by one in each dimension. More... | |
| template<int _ndims = NDIMS> | |
| AXOM_HOST_DEVICE std::enable_if< _ndims==1, LogicalIndex >::type | indexToLogicalIndex (IndexType index) const |
| Turn an index into a logical index. More... | |
| template<int _ndims = NDIMS> | |
| AXOM_HOST_DEVICE std::enable_if< _ndims==2, LogicalIndex >::type | indexToLogicalIndex (IndexType index) const |
| template<int _ndims = NDIMS> | |
| AXOM_HOST_DEVICE std::enable_if< _ndims==3, LogicalIndex >::type | indexToLogicalIndex (IndexType index) const |
| template<int _ndims = NDIMS> | |
| AXOM_HOST_DEVICE std::enable_if< _ndims==1, IndexType >::type | logicalIndexToIndex (const LogicalIndex &logical) const |
| Turn a logical index into a flat index. More... | |
| template<int _ndims = NDIMS> | |
| AXOM_HOST_DEVICE std::enable_if< _ndims==2, IndexType >::type | logicalIndexToIndex (const LogicalIndex &logical) const |
| template<int _ndims = NDIMS> | |
| AXOM_HOST_DEVICE std::enable_if< _ndims==3, IndexType >::type | logicalIndexToIndex (const LogicalIndex &logical) const |
| AXOM_HOST_DEVICE LogicalIndex | clamp (const LogicalIndex &logical) const |
| Given a logical index that may or may not be in the index space, return a clamped logical index that is in the index space. The logical indices are clamped to [0, dimensions-1] in each dimension. More... | |
| IndexType | clamp (IndexType index) const |
Static Public Member Functions | |
| constexpr static AXOM_HOST_DEVICE int | dimension () |
| static constexpr AXOM_HOST_DEVICE bool | supports_strided_structured_indexing () |
| Return whether the view supports strided structured indexing. More... | |
This class encapsulates a structured mesh size and contains methods to help with indexing into it.
| IndexT | The type used for indices. |
| NDIMS | The number of dimensions. |
| using axom::bump::views::StructuredIndexing< IndexT, NDIMS >::IndexType = IndexT |
| using axom::bump::views::StructuredIndexing< IndexT, NDIMS >::LogicalIndex = axom::StackArray<IndexType, NDIMS> |
|
inline |
constructor
| dims | The dimensions we're indexing. |
|
inline |
References SLIC_ERROR_IF.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Return whether the view supports strided structured indexing.
|
inline |
Return the number of points in the index space.
|
inline |
Return the logical dimensions.
|
inline |
|
inline |
Return the k stride.
|
inline |
Turn a global logical index into an index.
| global | The global logical index to convert. |
References axom::bump::views::StructuredIndexing< IndexT, NDIMS >::logicalIndexToIndex().
|
inline |
Turn a global index into a global logical index.
| global | The global index to convert. |
References axom::bump::views::StructuredIndexing< IndexT, NDIMS >::indexToLogicalIndex().
|
inline |
Turn global logical index to local logical index. no-op.
| index | The index to convert. |
|
inline |
Turn global index to local index. no-op.
| index | The index to convert. |
|
inline |
Turn local logical index to global logical index. no-op.
| index | The index to convert. |
|
inline |
Turn local index to global index. no-op.
| index | The index to convert. |
|
inline |
Turn an index into a logical index.
| index | The index to convert. |
|
inline |
|
inline |
|
inline |
Turn a logical index into a flat index.
| logical | The logical indexto convert to a flat index. |
|
inline |
|
inline |
|
inline |
Determines whether the indexing contains the supplied logical index.
| logical | The logical index being tested. |
References axom::bump::views::StructuredIndexing< IndexT, NDIMS >::dimension().
|
inline |
Determines whether the indexing contains the supplied index.
| index | The index being tested. |
References axom::bump::views::StructuredIndexing< IndexT, NDIMS >::contains(), and axom::bump::views::StructuredIndexing< IndexT, NDIMS >::indexToLogicalIndex().
|
inline |
Expand the current StructuredIndexing by one in each dimension.
References axom::bump::views::StructuredIndexing< IndexT, NDIMS >::dimension().
|
inline |
Given a logical index that may or may not be in the index space, return a clamped logical index that is in the index space. The logical indices are clamped to [0, dimensions-1] in each dimension.
| logical | The input logical index being clamped. |
| A | new LogicalIndex that is in the index space. |
References axom::utilities::clampVal(), and axom::bump::views::StructuredIndexing< IndexT, NDIMS >::dimension().
|
inline |