Chombo + EB  3.2
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
LayoutIterator Class Reference

An Iterator based on a BoxLayout object. More...

#include <LayoutIterator.H>

Inheritance diagram for LayoutIterator:
Inheritance graph
[legend]

Public Member Functions

 LayoutIterator ()
 a null constructed LayoutIterator will return false on ok() More...
 
virtual ~LayoutIterator ()
 
const LayoutIndexoperator() () const
 return the index that this iterator is at More...
 
LayoutIndex i () const
 return a copy of the index that this iterator is at More...
 
virtual void operator++ ()
 move the iterator to the next Box in the layout More...
 
void incr ()
 move the iterator to the next Box in the layout More...
 
virtual bool ok () const
 return true if this iterator is still in its Layout More...
 
void begin ()
 initialize this iterator to the first Box in its Layout More...
 
void reset ()
 same as begin() More...
 
void end ()
 move this iterator to after the last Box in the layout More...
 
const LayoutIndexoperator[] (int ivec) const
 
LayoutIndexoperator[] (int ivec)
 

Protected Member Functions

 LayoutIterator (const BoxLayout &a_boxlayout, const int *a_layoutID)
 

Protected Attributes

BoxLayout m_layout
 
RefCountedPtr< Vector< LayoutIndex > > m_indicies
 
unsigned int m_current
 

Friends

class BoxLayout
 
class DisjointBoxLayout
 
class TimedDataIterator
 

Detailed Description

An Iterator based on a BoxLayout object.

An Iterator based on a BoxLayout object. It does not support a dereferencing operation(1), since it is intended to work with all of BoxLayouts, DisjointBoxLayouts, BoxLayoutDatas LevelData's, and any object that is built on top of a BoxLayout object. LayoutIterator accesses the data in a BoxLayout-based object in a NON-data-parallel manner (i.e. every processor iterates through all the Boxes in the BoxLayout). This differs from the DataIterator class.

BoxLayout-based objects can act as the Factory for the LayoutIterator.

(1) STL-speak. not critical for comprehension, but can help people familiar with STL iterators and expecting similar behaviour.

Constructor & Destructor Documentation

◆ LayoutIterator() [1/2]

LayoutIterator::LayoutIterator ( )
inline

a null constructed LayoutIterator will return false on ok()

◆ ~LayoutIterator()

virtual LayoutIterator::~LayoutIterator ( )
inlinevirtual

References operator()().

◆ LayoutIterator() [2/2]

LayoutIterator::LayoutIterator ( const BoxLayout a_boxlayout,
const int *  a_layoutID 
)
protected

Member Function Documentation

◆ operator()()

const LayoutIndex & LayoutIterator::operator() ( ) const
inline

return the index that this iterator is at

References CH_assert, m_current, m_indicies, and ok().

Referenced by i(), DataIterator::operator()(), and ~LayoutIterator().

◆ i()

LayoutIndex LayoutIterator::i ( ) const
inline

return a copy of the index that this iterator is at

References operator()(), and operator++().

◆ operator++()

void LayoutIterator::operator++ ( )
inlinevirtual

move the iterator to the next Box in the layout

Reimplemented in TimedDataIterator.

References m_current.

Referenced by i().

◆ incr()

void LayoutIterator::incr ( )
inline

move the iterator to the next Box in the layout

References begin(), end(), ok(), and reset().

◆ ok()

bool LayoutIterator::ok ( ) const
inlinevirtual

return true if this iterator is still in its Layout

Reimplemented in TimedDataIterator.

References m_current, m_layout, and BoxLayout::size().

Referenced by LayoutData< Vector< IntVectSet > >::allocate(), BaseIFFactory< T >::BaseIFFactory(), BaseIVFactory< T >::BaseIVFactory(), blockWriteToBuffer(), BaseLevelTGA< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::computeDiffusion(), PetscSolver< LevelData< FArrayBox > >::create_mat_vec(), LevelData< BaseFab< int > >::degenerateLocalOnly(), ViscousTensorOp::diagonalScale(), NWOViscousTensorOp::diagonalScale(), VCAMRPoissonOp2::diagonalScale(), EBViscousTensorOp::diagonalScale(), NWOEBViscousTensorOp::diagonalScale(), ViscousTensorOp::divideByIdentityCoef(), NWOViscousTensorOp::divideByIdentityCoef(), VCAMRPoissonOp2::divideByIdentityCoef(), EBViscousTensorOp::divideByIdentityCoef(), NWOEBViscousTensorOp::divideByIdentityCoef(), MultilevelLinearOp< T >::dotProduct(), BCFunction::fillGhostCells(), getOffsets(), incr(), EBLevelRedist::increment(), BaseLevelHeatSolver< LevelData< FArrayBox >, FluxBox, LevelFluxRegister >::incrementFlux(), CoefficientInterpolator< LevelData< FluxBox >, LevelData< FArrayBox > >::interpolatePrime(), IVSFABFactory< T >::IVSFABFactory(), CoefficientInterpolator< LevelData< FluxBox >, LevelData< FArrayBox > >::NewtonRaphson(), operator()(), EBFastFR::reflux(), regionGather(), PetscSolver< LevelData< FArrayBox > >::setup_solver(), MergeSolver< T >::solve(), PetscSolver< LevelData< FArrayBox > >::solve_mfree_private(), write(), WriteMultiData< T >::writeData(), and LayoutData< Vector< IntVectSet > >::~LayoutData().

◆ begin()

void LayoutIterator::begin ( )
inline

initialize this iterator to the first Box in its Layout

References m_current.

Referenced by LevelData< BaseFab< int > >::degenerateLocalOnly(), MultilevelLinearOp< T >::dotProduct(), incr(), and regionGather().

◆ reset()

void LayoutIterator::reset ( )

same as begin()

Referenced by incr().

◆ end()

void LayoutIterator::end ( )

move this iterator to after the last Box in the layout

The iterator will be !ok() afterwards.

Referenced by incr().

◆ operator[]() [1/2]

const LayoutIndex& LayoutIterator::operator[] ( int  ivec) const
inline

References m_indicies.

◆ operator[]() [2/2]

LayoutIndex& LayoutIterator::operator[] ( int  ivec)
inline

References m_indicies.

Friends And Related Function Documentation

◆ BoxLayout

friend class BoxLayout
friend

◆ DisjointBoxLayout

friend class DisjointBoxLayout
friend

◆ TimedDataIterator

friend class TimedDataIterator
friend

Member Data Documentation

◆ m_layout

BoxLayout LayoutIterator::m_layout
protected

◆ m_indicies

RefCountedPtr<Vector<LayoutIndex> > LayoutIterator::m_indicies
protected

Referenced by operator()(), and operator[]().

◆ m_current

unsigned int LayoutIterator::m_current
protected

Referenced by begin(), ok(), operator()(), and operator++().


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