Block-Structured AMR Software Framework
amrex::BoxIterator Class Reference

iterates through the IntVects of a Box More...

#include <AMReX_BoxIterator.H>

Public Member Functions

 BoxIterator () noexcept=default
 
 BoxIterator (const Box &a_bx) noexcept
 
void setBox (const Box &a_bx) noexcept
 
void define (const Box &a_bx) noexcept
 
void begin () noexcept
 
void reset () noexcept
 
void operator++ () noexcept
 
void next () noexcept
 
const IntVectoperator() () const noexcept
 
bool ok () noexcept
 

Protected Attributes

IntVect m_current = IntVect::TheUnitVector()
 
IntVect m_boxLo = IntVect::TheUnitVector()
 
IntVect m_boxHi = IntVect::TheZeroVector()
 

Detailed Description

iterates through the IntVects of a Box

BoxIterator iterates through the IntVects of a box. The actual sequence of IntVects is implementation-specific. Typical usage:

Box b; ... BoxIterator bit (b); for (bit.begin(); bit.ok(); ++bit) { IntVect iv = bit(); (do operations involving iv) }

Constructor & Destructor Documentation

◆ BoxIterator() [1/2]

amrex::BoxIterator::BoxIterator ( )
defaultnoexcept

Default constructor. This constructs an invalid iterator. The user must call define before using.

◆ BoxIterator() [2/2]

amrex::BoxIterator::BoxIterator ( const Box a_bx)
inlineexplicitnoexcept

Constructs a BoxIterator and associates it with a Box. Arguments: a_bx (not modified) the Box to iterate over.

Member Function Documentation

◆ begin()

void amrex::BoxIterator::begin ( )
inlinenoexcept

Sets this BoxIterator to the first IntVect in its Box. The definition of the "first" IntVect is implementation-dependent.

◆ define()

void amrex::BoxIterator::define ( const Box a_bx)
noexcept

Associates a Box with this BoxIterator. Arguments: a_bx (not modified) the Box to iterate over.

◆ next()

void amrex::BoxIterator::next ( )
inlinenoexcept

◆ ok()

bool amrex::BoxIterator::ok ( )
inlinenoexcept

Returns true if this BoxIterator's location is within its Box.

◆ operator()()

const IntVect & amrex::BoxIterator::operator() ( ) const
inlinenoexcept

Returns the value of the InVect for the current location of this BoxIterator.

◆ operator++()

void amrex::BoxIterator::operator++ ( )
inlinenoexcept

Modifies this BoxIterator to set it to the next location in its Box. The definition of the "next location" of a Box is implementation-dependent.

◆ reset()

void amrex::BoxIterator::reset ( )
inlinenoexcept

Sets this BoxIterator to the first IntVect in its Box. The definition of the "first" IntVect is implementation-dependent.

◆ setBox()

void amrex::BoxIterator::setBox ( const Box a_bx)
noexcept

Member Data Documentation

◆ m_boxHi

IntVect amrex::BoxIterator::m_boxHi = IntVect::TheZeroVector()
protected

◆ m_boxLo

IntVect amrex::BoxIterator::m_boxLo = IntVect::TheUnitVector()
protected

◆ m_current

IntVect amrex::BoxIterator::m_current = IntVect::TheUnitVector()
protected

The documentation for this class was generated from the following files: