1#ifndef PSCF_MESH_ITERATOR_FORTRAN_TPP
2#define PSCF_MESH_ITERATOR_FORTRAN_TPP
11#include "MeshIteratorFortran.h"
49 for (
int i = 0; i < D; ++i) {
54 dimensions_ = dimensions;
56 for (
int i = 0; i < D; ++i) {
57 size_ *= dimensions_[i];
62 for (
int i = D - 1 ; i > 0; --i ) {
63 offsets_[i - 1] = offsets_[i] * dimensions_[i];
77 for (
int i = 0; i < D; ++i) {
99 if (position_[k] == dimensions_[k]) {
114 for (
int dim = 0; dim < D; ++dim) {
115 rank_ += offsets_[dim] * position_[dim];
An IntVec<D, T> is a D-component vector of elements of integer type T.
MeshIteratorFortran()
Default constructor.
void setDimensions(IntVec< D > const &dimensions)
Set or reset the mesh dimensions, and initialize iterator.
void begin()
Initialize the iterator to the first grid point.
IntVec< D > const & dimensions() const
Return the mesh dimensions as an vector of integers.
void operator++()
Increment the iterator to the next grid point.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
PSCF package top-level namespace.