24#ifndef DUMUX_SCV_AND_SCVF_ITERATORS_HH
25#define DUMUX_SCV_AND_SCVF_ITERATORS_HH
27#include <dune/common/iteratorrange.hh>
28#include <dune/common/iteratorfacades.hh>
37template<
class SubControlVolume,
class Vector,
class FVElementGeometry>
38class ScvIterator :
public Dune::ForwardIteratorFacade<ScvIterator<SubControlVolume,
41 const SubControlVolume>
44 using Iterator =
typename Vector::const_iterator;
46 ScvIterator(
const Iterator& it,
const FVElementGeometry& fvGeometry)
47 : it_(it), fvGeometryPtr_(&fvGeometry) {}
54 return fvGeometryPtr_->scv(*it_);
57 bool equals(
const ThisType& other)
const
59 return it_ == other.it_;
69 const FVElementGeometry* fvGeometryPtr_;
77template<
class SubControlVolumeFace,
class Vector,
class FVElementGeometry>
78class ScvfIterator :
public Dune::ForwardIteratorFacade<ScvfIterator<SubControlVolumeFace,
81 const SubControlVolumeFace>
84 using Iterator =
typename Vector::const_iterator;
86 ScvfIterator(
const Iterator& it,
const FVElementGeometry& fvGeometry)
87 : it_(it), fvGeometryPtr_(&fvGeometry) {}
94 return fvGeometryPtr_->scvf(*it_);
97 bool equals(
const ThisType& other)
const
99 return it_ == other.it_;
109 const FVElementGeometry* fvGeometryPtr_;
bool equals(const ThisType &other) const
Definition scvandscvfiterators.hh:57
ScvIterator(const Iterator &it, const FVElementGeometry &fvGeometry)
Definition scvandscvfiterators.hh:46
const SubControlVolume & dereference() const
dereferencing yields a subcontrol volume
Definition scvandscvfiterators.hh:52
void increment()
Definition scvandscvfiterators.hh:62
ScvIterator()
Definition scvandscvfiterators.hh:49
ScvfIterator()
Definition scvandscvfiterators.hh:89
void increment()
Definition scvandscvfiterators.hh:102
ScvfIterator(const Iterator &it, const FVElementGeometry &fvGeometry)
Definition scvandscvfiterators.hh:86
const SubControlVolumeFace & dereference() const
dereferencing yields a subcontrol volume face
Definition scvandscvfiterators.hh:92
bool equals(const ThisType &other) const
Definition scvandscvfiterators.hh:97