![]() |
Block-Structured AMR Software Framework
|
Utility that maps flattened point indices back to IntVectND coordinates. More...
#include <AMReX_Box.H>
Public Types | |
| using | UInt = UIntT |
| using | Divmod = std::conditional_t<sizeof(UInt) == 4, Math::FastDivmodU32, Math::FastDivmodU64> |
Public Member Functions | |
| BoxIndexerND (BoxND< dim > const &box) | |
| __host__ __device__ IntVectND< dim > | intVect (std::uint64_t icell) const |
Convert flattened point index icell to its IntVectND coordinate. | |
| __host__ __device__ Dim3 | operator() (std::uint64_t icell) const |
| Functor returning the coordinate padded to Dim3. | |
| __host__ __device__ UInt | numPts () const |
| Return the number of points covered by the indexed box. | |
Public Attributes | |
| UInt | npts |
| Divmod | fdm [dim-1] |
| IntVectND< dim > | lo |
Utility that maps flattened point indices back to IntVectND coordinates.
The constructor captures a sequence of fast divmod helpers that implement fast division by the running products of box lengths, so repeated calls to intVect or the Dim3 functor avoid costly integer divisions while walking a BoxND.
| dim | Box dimensionality. |
| UIntT | Index type, std::uint32_t or std::uint64_t. The 32-bit version is much cheaper on GPUs, but limits the box to fewer than 2^31 points. The default is 32-bit in GPU builds unless AMREX_ARRAY4_64BIT_INDEX is defined, and 64-bit in CPU builds. Use std::uint64_t for a large box that is not a fab box, e.g., a domain. |
| using amrex::BoxIndexerND< dim, UIntT >::Divmod = std::conditional_t<sizeof(UInt) == 4, Math::FastDivmodU32, Math::FastDivmodU64> |
| using amrex::BoxIndexerND< dim, UIntT >::UInt = UIntT |
|
inline |
|
inlinenodiscard |
Convert flattened point index icell to its IntVectND coordinate.
| icell | Zero-based flattened point index. |
|
inlinenodiscard |
Return the number of points covered by the indexed box.
|
inlinenodiscard |
| Divmod amrex::BoxIndexerND< dim, UIntT >::fdm[dim-1] |
| IntVectND<dim> amrex::BoxIndexerND< dim, UIntT >::lo |
| UInt amrex::BoxIndexerND< dim, UIntT >::npts |