![]() |
Block-Structured AMR Software Framework
|
Iterator over all IntVects in a Box. More...
#include <AMReX_BoxIterator.H>
Public Member Functions | |
| BoxIteratorND () noexcept=default | |
| Default constructor. Constructs an invalid iterator; call define() before use. | |
| BoxIteratorND (const BoxND< dim > &a_bx) noexcept | |
Construct a BoxIteratorND associated with Box a_bx. | |
| void | setBox (const BoxND< dim > &a_bx) noexcept |
Associate this iterator with Box a_bx (equivalent to define()). | |
| void | define (const BoxND< dim > &a_bx) noexcept |
Associate this iterator with Box a_bx. | |
| BoxIteratorND | begin () noexcept |
Reset to the first IntVect (smallEnd) and return *this for range-based for. | |
| BoxIteratorND | end () const noexcept |
| Return a past-the-end sentinel for use by range-based for loops. | |
| void | reset () noexcept |
| Reset to the first IntVect (smallEnd) of the Box. | |
| BoxIteratorND & | operator++ () noexcept |
| Advance to the next IntVect in the Box (pre-increment). | |
| void | next () noexcept |
| Advance to the next IntVect in the Box. | |
| const IntVectND< dim > & | operator() () const noexcept |
| Return the current IntVect. | |
| IntVectND< dim > | operator* () const noexcept |
| Dereference: return the current IntVect by value. | |
| bool | ok () const noexcept |
| Return true if the iterator is within the Box. | |
Friends | |
| bool | operator!= (const BoxIteratorND &b1, const BoxIteratorND &b2) noexcept |
| Inequality test used by range-based for loops (checks only the last dimension). | |
Iterator over all IntVects in a Box.
Iterates through the IntVects of a Box in the same order as a series of nested for loops, with the innermost loop over the first dimension.
Typical usage with a range-based for loop:
Using a traditional for loop:
Note that while regular iteration of the range-based version is reasonably performant, neither version is compatible with omp parallel for or simd autovectorization.
| dim | Spatial dimension. |
|
defaultnoexcept |
Default constructor. Constructs an invalid iterator; call define() before use.
|
inlineexplicitnoexcept |
Construct a BoxIteratorND associated with Box a_bx.
| a_bx | Box to iterate over. |
|
inlinenoexcept |
Reset to the first IntVect (smallEnd) and return *this for range-based for.
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
Return a past-the-end sentinel for use by range-based for loops.
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
Return true if the iterator is within the Box.
|
inlinenodiscardnoexcept |
Return the current IntVect.
|
inlinenodiscardnoexcept |
Dereference: return the current IntVect by value.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |
Inequality test used by range-based for loops (checks only the last dimension).