Chombo + EB + MF  3.2
Public Member Functions | Private Attributes | List of all members
ShiftIterator Class Reference

Class to manage box-shifting used to enforce periodic BC's. More...

#include <ProblemDomain.H>

Public Member Functions

 ShiftIterator ()
 Basic constructor. More...
 
 ShiftIterator (const bool *a_isPeriodic)
 Defining Constructor. More...
 
 ShiftIterator (const bool *a_isPeriodic, const IntVect &a_numWraps)
 Defining Constructor. More...
 
 ShiftIterator (const ShiftIterator &a_shiftIt)
 Copy constructor. More...
 
 ~ShiftIterator ()
 Destructor. More...
 
ShiftIteratoroperator= (const ShiftIterator &a_src)
 Assignment operator. More...
 
void computeShifts (const bool *a_isPeriodic)
 Recompute shift vectors based on periodic directions. More...
 
void computeShifts (const bool *a_isPeriodic, const IntVect &a_numWraps)
 Recompute shift vectors based on periodic directions. More...
 
IntVect operator() () const
 Returns the current shift unit vector. More...
 
IntVect i () const
 Equivalent to the () operator. More...
 
void operator++ ()
 Increment to the next shift unit vector. More...
 
void incr ()
 Equivalent to the ++ operator. More...
 
bool ok () const
 Is the iterator still within its range of shift vectors? More...
 
unsigned int index () const
 which periodic image is this More...
 
const IntVectoperator[] (int index) const
 
void reset ()
 Reset to first shift unit vector. More...
 
void begin ()
 Equivalent to reset() More...
 
void end ()
 Skip the iterator to the end. More...
 

Private Attributes

unsigned int m_index
 
Vector< IntVectm_shift_vectors
 

Detailed Description

Class to manage box-shifting used to enforce periodic BC's.

The ShiftIterator class contains a list of shift vectors necessary to enforce periodic boundary conditions (enforced by shifting the Box of each Fab, then copying any overlapping valid cells with ghost cells of the shifted Fab. Depending on the number of periodic directions, the list of shift vectors over which to iterate differs.

Constructor & Destructor Documentation

◆ ShiftIterator() [1/4]

ShiftIterator::ShiftIterator ( )
inline

Basic constructor.

◆ ShiftIterator() [2/4]

ShiftIterator::ShiftIterator ( const bool *  a_isPeriodic)

Defining Constructor.

Builds a ShiftIterator based on the periodicity in a_isPeriodic

◆ ShiftIterator() [3/4]

ShiftIterator::ShiftIterator ( const bool *  a_isPeriodic,
const IntVect a_numWraps 
)

Defining Constructor.

Builds a ShiftIterator based on the periodicity in a_isPeriodic and also allows for multiple wraps

◆ ShiftIterator() [4/4]

ShiftIterator::ShiftIterator ( const ShiftIterator a_shiftIt)
inline

Copy constructor.

References m_index, and m_shift_vectors.

◆ ~ShiftIterator()

ShiftIterator::~ShiftIterator ( )

Destructor.

Member Function Documentation

◆ operator=()

ShiftIterator & ShiftIterator::operator= ( const ShiftIterator a_src)
inline

Assignment operator.

References m_index, and m_shift_vectors.

Referenced by ProblemDomain::contains_box().

◆ computeShifts() [1/2]

void ShiftIterator::computeShifts ( const bool *  a_isPeriodic)

Recompute shift vectors based on periodic directions.

◆ computeShifts() [2/2]

void ShiftIterator::computeShifts ( const bool *  a_isPeriodic,
const IntVect a_numWraps 
)

Recompute shift vectors based on periodic directions.

◆ operator()()

IntVect ShiftIterator::operator() ( ) const
inline

Returns the current shift unit vector.

References CH_assert, m_index, m_shift_vectors, and ok().

Referenced by i().

◆ i()

IntVect ShiftIterator::i ( ) const
inline

Equivalent to the () operator.

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

Referenced by ProblemDomain::contains_box().

◆ operator++()

void ShiftIterator::operator++ ( )
inline

Increment to the next shift unit vector.

References m_index.

Referenced by ImageIterator::begin(), and i().

◆ incr()

void ShiftIterator::incr ( )
inline

Equivalent to the ++ operator.

References ok().

◆ ok()

bool ShiftIterator::ok ( ) const
inline

Is the iterator still within its range of shift vectors?

References m_index, m_shift_vectors, and Vector< T >::size().

Referenced by incr(), and operator()().

◆ index()

unsigned int ShiftIterator::index ( ) const
inline

which periodic image is this

References m_index.

Referenced by operator[]().

◆ operator[]()

const IntVect& ShiftIterator::operator[] ( int  index) const
inline

◆ reset()

void ShiftIterator::reset ( )
inline

Reset to first shift unit vector.

References m_index.

Referenced by operator[]().

◆ begin()

void ShiftIterator::begin ( )
inline

Equivalent to reset()

References m_index.

Referenced by operator[]().

◆ end()

void ShiftIterator::end ( )
inline

Skip the iterator to the end.

ok() will return false after this method is called.

References m_index, m_shift_vectors, and Vector< T >::size().

Referenced by operator[]().

Member Data Documentation

◆ m_index

unsigned int ShiftIterator::m_index
private

◆ m_shift_vectors

Vector<IntVect> ShiftIterator::m_shift_vectors
private

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