waLBerla 7.2
Loading...
Searching...
No Matches
walberla::field::ReverseFieldIterator< T, fieldFSize > Class Template Reference

#include <FieldIterator.h>

+ Inheritance diagram for walberla::field::ReverseFieldIterator< T, fieldFSize >:

Public Types

using Parent = FieldIterator<T, fieldFSize>
 
using FieldType = Field<std::remove_const_t<T>, fieldFSize>
 
- Public Types inherited from walberla::field::FieldIterator< T, fieldFSize >
using iterator_category = std::forward_iterator_tag
 
using value_type = T
 
using difference_type = std::ptrdiff_t
 
using pointer = T*
 
using reference = T&
 
using FieldType = Field<std::remove_const_t<T>, fieldFSize>
 

Public Member Functions

Constructor/Destructor
 ReverseFieldIterator (const FieldType *field, cell_idx_t xBeg, cell_idx_t yBeg, cell_idx_t zBeg, cell_idx_t fBeg, uint_t xs, uint_t ys, uint_t zs, uint_t fs)
 
 ReverseFieldIterator ()
 
Operators
ReverseFieldIteratoroperator++ ()
 Pre-decrement operator.
 
ReverseFieldIteratoroperator-- ()
 Pre-increment operator.
 
Fast Iteration
void incrOuter ()
 
void incrInner ()
 
bool testInner () const
 
- Public Member Functions inherited from walberla::field::FieldIterator< T, fieldFSize >
 FieldIterator (const FieldIterator< T, fieldFSize > &other)
 
FieldIterator< T, fieldFSize > & operator= (const FieldIterator< T, fieldFSize > &other)
 Assignment operator.
 
bool operator== (const FieldIterator &it) const
 Equal operator.
 
bool operator!= (const FieldIterator &it) const
 Unequal operator.
 
 operator const FieldIterator< const T, fieldFSize > & () const
 
T & operator* () const
 
T * operator-> () const
 
T & getF (cell_idx_t cf) const
 For beginXYZ iterators, one often needs a specific f Assumes that iterator stands at f==0.
 
T & getF (uint_t cf) const
 Equivalent to neighbor(cell_idx_t) see above.
 
T & operator[] (cell_idx_t cf) const
 
T & operator[] (uint_t cf) const
 
T & neighbor (stencil::Direction d, cell_idx_t cf=0) const
 Neighbor access relative to current position.
 
T & neighbor (stencil::Direction d, uint_t cf) const
 uint_t variant of above function
 
T & neighbor (cell_idx_t cx, cell_idx_t cy, cell_idx_t cz, cell_idx_t cf=0) const
 Neighbor access relative to current position.
 
T & neighbor (cell_idx_t cx, cell_idx_t cy, cell_idx_t cz, uint_t cf) const
 Neighbor variant that takes unsigned int as f parameter, needed since the stencil toIdx() is an unsigned int.
 
cell_idx_t x () const
 In order to get x(), y(), z(), f() function as fast a possible, no if clause for the layout was introduced.
 
cell_idx_t y () const
 
cell_idx_t z () const
 
cell_idx_t f () const
 
Cell cell () const
 
void print (std::ostream &str) const
 
const FieldTypegetField () const
 

Additional Inherited Members

- Static Public Attributes inherited from walberla::field::FieldIterator< T, fieldFSize >
static const uint_t F_SIZE = fieldFSize
 
- Protected Member Functions inherited from walberla::field::FieldIterator< T, fieldFSize >
 FieldIterator ()
 Constructs an end iterator, which is represented by NULL pointers.
 
 FieldIterator (const FieldType *f, cell_idx_t xBeg, cell_idx_t yBeg, cell_idx_t zBeg, cell_idx_t fBeg, uint_t xSize, uint_t ySize, uint_t zSize, uint_t fSize, bool forward)
 
void incrementLine ()
 Increments the slower 3 coordinates, if innermost coordinate is at end.
 
void decrementLine ()
 Decrements the slower 3 coordinates, if innermost coordinate is at beginning.
 
void initCoordinateAccessOptimizationPointers ()
 Initializes pointers required for the optimized x(),y(),z(),f() functions See documentation of fastestCoord_, curX_, curY_, curZ_ and curF_.
 
- Protected Attributes inherited from walberla::field::FieldIterator< T, fieldFSize >
T * lineBegin_
 Points to begin of fastest coordinate line.
 
T * linePtr_
 Point to current element.
 
T * lineEnd_
 Points to end of current line.
 
std::array< cell_idx_t, 3 > cur_
 In the following vectors [0] is the slowest and [3] the fastest coordinate Current values of the coordinates, forth coordinate implicitly stored in linePtr_ and if needed written to fastestCoord_.
 
std::array< uint_t, 4 > skips_
 Number of elements to skip when coordinate wraps around.
 
std::array< uint_t, 4 > sizes_
 Size of each coordinate.
 
const FieldTypef_
 Field where iterator belongs to.
 
cell_idx_t xBegin_
 Following offset values are only used in functions x(),y(),z(),f()
 
cell_idx_t yBegin_
 
cell_idx_t zBegin_
 
cell_idx_t fBegin_
 
cell_idx_t fastestCoord_
 
cell_idx_tcurX_
 
cell_idx_tcurY_
 
cell_idx_tcurZ_
 
cell_idx_tcurF_
 

Member Typedef Documentation

◆ FieldType

template<typename T , uint_t fieldFSize>
using walberla::field::ReverseFieldIterator< T, fieldFSize >::FieldType = Field<std::remove_const_t<T>, fieldFSize>

◆ Parent

template<typename T , uint_t fieldFSize>
using walberla::field::ReverseFieldIterator< T, fieldFSize >::Parent = FieldIterator<T, fieldFSize>

Constructor & Destructor Documentation

◆ ReverseFieldIterator() [1/2]

template<typename T , uint_t fieldFSize>
walberla::field::ReverseFieldIterator< T, fieldFSize >::ReverseFieldIterator ( const FieldType * field,
cell_idx_t xBeg,
cell_idx_t yBeg,
cell_idx_t zBeg,
cell_idx_t fBeg,
uint_t xs,
uint_t ys,
uint_t zs,
uint_t fs )
inlineexplicit

◆ ReverseFieldIterator() [2/2]

template<typename T , uint_t fieldFSize>
walberla::field::ReverseFieldIterator< T, fieldFSize >::ReverseFieldIterator ( )
inlineexplicit

Member Function Documentation

◆ incrInner()

template<typename T , uint_t fieldFSize>
void walberla::field::ReverseFieldIterator< T, fieldFSize >::incrInner ( )
inline

◆ incrOuter()

template<typename T , uint_t fieldFSize>
void walberla::field::ReverseFieldIterator< T, fieldFSize >::incrOuter ( )
inline

◆ operator++()

template<typename T , uint_t fs>
ReverseFieldIterator< T, fs > & walberla::field::ReverseFieldIterator< T, fs >::operator++ ( )
inline

Pre-decrement operator.

Returns
Reference to the decremented pointer iterator.

◆ operator--()

template<typename T , uint_t fs>
ReverseFieldIterator< T, fs > & walberla::field::ReverseFieldIterator< T, fs >::operator-- ( )
inline

Pre-increment operator.

Returns
Reference to the incremented pointer iterator.

◆ testInner()

template<typename T , uint_t fieldFSize>
bool walberla::field::ReverseFieldIterator< T, fieldFSize >::testInner ( ) const
inline

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