1#ifndef PSCF_MESH_ITERATOR_H
2#define PSCF_MESH_ITERATOR_H
11#include <pscf/math/IntVec.h>
103 void increment(
int i);
123 {
return position_; }
142 {
return (
bool)(rank_ == size_); }
150 if (position_[0] == dimensions_[0]) {
160 if (position_[1] == dimensions_[1]) {
171 if (position_[2] == dimensions_[2]) {
178 #ifndef PSCF_MESH_ITERATOR_TPP
180 extern template class MeshIterator<1>;
181 extern template class MeshIterator<2>;
182 extern template class MeshIterator<3>;
An IntVec<D, T> is a D-component vector of elements of integer type T.
Iterator over points in a Mesh<D>.
void operator++()
Increment iterator to next mesh point.
int rank() const
Get the rank of current element.
void begin()
Set iterator to the first point in the mesh.
MeshIterator()
Default constructor.
bool atEnd() const
Is this the end (i.e., one past the last point)?
void setDimensions(const IntVec< D > &dimensions)
Set the grid dimensions in all directions.
IntVec< D > position() const
Get current position in the grid, as integer vector.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.