Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::BoxIndexerND< dim > Struct Template Reference

Utility that maps flattened point indices back to IntVectND coordinates. More...

#include <AMReX_Box.H>

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__ std::uint64_t numPts () const
 Return the number of points covered by the indexed box.
 

Public Attributes

std::uint64_t npts
 
Math::FastDivmodU64 fdm [dim-1]
 
IntVectND< dim > lo
 

Detailed Description

template<int dim>
struct amrex::BoxIndexerND< dim >

Utility that maps flattened point indices back to IntVectND coordinates.

The constructor captures a sequence of Math::FastDivmodU64 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.

Template Parameters
dimBox dimensionality.

Constructor & Destructor Documentation

◆ BoxIndexerND()

template<int dim>
amrex::BoxIndexerND< dim >::BoxIndexerND ( BoxND< dim > const &  box)
inline

Member Function Documentation

◆ intVect()

template<int dim>
__host__ __device__ IntVectND< dim > amrex::BoxIndexerND< dim >::intVect ( std::uint64_t  icell) const
inline

Convert flattened point index icell to its IntVectND coordinate.

Parameters
icellZero-based flattened point index.
Returns
Coordinate within the tracked box.

◆ numPts()

template<int dim>
__host__ __device__ std::uint64_t amrex::BoxIndexerND< dim >::numPts ( ) const
inline

Return the number of points covered by the indexed box.

Returns
Total number of points.

◆ operator()()

template<int dim>
__host__ __device__ Dim3 amrex::BoxIndexerND< dim >::operator() ( std::uint64_t  icell) const
inline

Functor returning the coordinate padded to Dim3.

Parameters
icellZero-based flattened point index.
Returns
Coordinate as Dim3.

Member Data Documentation

◆ fdm

template<int dim>
Math::FastDivmodU64 amrex::BoxIndexerND< dim >::fdm[dim-1]

◆ lo

template<int dim>
IntVectND<dim> amrex::BoxIndexerND< dim >::lo

◆ npts

template<int dim>
std::uint64_t amrex::BoxIndexerND< dim >::npts

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