1#ifndef AMREX_BOXITERATOR_H_
2#define AMREX_BOXITERATOR_H_
3#include <AMReX_Config.H>
84 m_current = a_bx.smallEnd();
85 m_boxLo = a_bx.smallEnd();
86 m_boxHi = a_bx.bigEnd();
104 ret.m_current = m_boxLo;
105 if (m_boxLo.allLE(m_boxHi)) {
106 ret.m_current[dim-1] = m_boxHi[dim-1] + 1;
124 for (
int i=0; i<dim; ++i) {
126 if ((i+1<dim) && m_current[i] > m_boxHi[i]) {
127 m_current[i] = m_boxLo[i];
150 [[nodiscard]]
bool ok () const noexcept {
151 return m_current.allLE(m_boxHi);
158 return b1.m_current[dim-1] != b2.m_current[dim-1];
Assertion macros used across AMReX for runtime consistency checks.
#define AMREX_ASSERT(EX)
Definition AMReX_BLassert.H:38
Iterator over all IntVects in a Box.
Definition AMReX_BoxIterator.H:59
friend bool operator!=(const BoxIteratorND &b1, const BoxIteratorND &b2) noexcept
Inequality test used by range-based for loops (checks only the last dimension).
Definition AMReX_BoxIterator.H:156
BoxIteratorND() noexcept=default
Default constructor. Constructs an invalid iterator; call define() before use.
BoxIteratorND begin() noexcept
Reset to the first IntVect (smallEnd) and return *this for range-based for.
Definition AMReX_BoxIterator.H:95
IntVectND< dim > operator*() const noexcept
Dereference: return the current IntVect by value.
Definition AMReX_BoxIterator.H:142
void next() noexcept
Advance to the next IntVect in the Box.
Definition AMReX_BoxIterator.H:123
void setBox(const BoxND< dim > &a_bx) noexcept
Associate this iterator with Box a_bx (equivalent to define()).
Definition AMReX_BoxIterator.H:74
void define(const BoxND< dim > &a_bx) noexcept
Associate this iterator with Box a_bx.
Definition AMReX_BoxIterator.H:82
const IntVectND< dim > & operator()() const noexcept
Return the current IntVect.
Definition AMReX_BoxIterator.H:135
bool ok() const noexcept
Return true if the iterator is within the Box.
Definition AMReX_BoxIterator.H:150
BoxIteratorND end() const noexcept
Return a past-the-end sentinel for use by range-based for loops.
Definition AMReX_BoxIterator.H:101
BoxIteratorND & operator++() noexcept
Advance to the next IntVect in the Box (pre-increment).
Definition AMReX_BoxIterator.H:117
void reset() noexcept
Reset to the first IntVect (smallEnd) of the Box.
Definition AMReX_BoxIterator.H:112
A Rectangular Domain on an Integer Lattice.
Definition AMReX_Box.H:54
An Integer Vector in dim-Dimensional Space.
Definition AMReX_IntVect.H:149
__host__ static __device__ constexpr IntVectND< dim > TheUnitVector() noexcept
This static member function returns a reference to a constant IntVectND object, all of whose dim argu...
Definition AMReX_IntVect.H:781
__host__ static __device__ constexpr IntVectND< dim > TheZeroVector() noexcept
This static member function returns a reference to a constant IntVectND object, all of whose dim argu...
Definition AMReX_IntVect.H:771
Definition AMReX_Amr.cpp:50