Public Member Functions | List of all members
SliceIterator Class Reference

Iterate over a (dim-1)-dimensional slice. More...

#include <SliceIterator.hpp>

Public Member Functions

template<size_t Dim>
 SliceIterator (const Index< Dim > &extents, size_t fixed_dim, size_t fixed_index)
 
 operator bool () const noexcept
 Returns true if the iterator is valid.
 
SliceIteratoroperator++ ()
 Step to the next grid point.
 
size_t volume_offset () const noexcept
 Offset into a Dim-dimensional DataVector at the current gridpoint. Note that the size of the DataVector is assumed to be the product of the extents used to construct this SliceIterator.
 
size_t slice_offset () const noexcept
 Offset into a (Dim-1)-dimensional DataVector at the current gridpoint. Note that the size of the DataVector is assumed to be the product of the extents used to construct this SliceIterator divided by the extent in the fixed_dim used to construct this SliceIterator.
 
void reset ()
 Reset the iterator.
 

Detailed Description

Iterate over a (dim-1)-dimensional slice.

Constructor & Destructor Documentation

◆ SliceIterator()

template<size_t Dim>
SliceIterator::SliceIterator ( const Index< Dim > &  extents,
size_t  fixed_dim,
size_t  fixed_index 
)
Parameters
extentsthe number of grid points in each dimension
fixed_dimthe dimension to slice in
fixed_indexthe index of the fixed_dim to slice at

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