36 #ifndef OPM_ITERATORS_HEADER 37 #define OPM_ITERATORS_HEADER 39 #include <dune/grid/common/gridenums.hh> 40 #include "PartitionIteratorRule.hpp" 41 #include <opm/grid/utility/ErrorMacros.hpp> 54 template<
int cd, PartitionIteratorType pitype>
55 class Iterator :
public EntityPointer<cd>
72 if(rule_.fullSet || rule_.emptySet)
74 while(this->
index()<noEntities_ && rule_.isInvalid(*
this))
104 OPM_THROW(std::runtime_error,
"Calling operator++() on HierarchicIterator for CpGrid, which has no refinement.");
118 template<
int codim, Dune::PartitionIteratorType pitype >
119 struct iterator_traits<
Dune::cpgrid::Iterator< codim, pitype > >
122 typedef ptrdiff_t difference_type;
126 typedef forward_iterator_tag iterator_category;
130 struct iterator_traits<
Dune::cpgrid::HierarchicIterator >
132 typedef ptrdiff_t difference_type;
136 typedef forward_iterator_tag iterator_category;
142 #include <dune/grid/cpgrid/CpGridData.hpp> 143 #include "Entity.hpp" 148 template<
int cd, PartitionIteratorType pitype>
154 noEntities_(grid.size(cd))
156 if(rule_.fullSet || rule_.emptySet)
159 while(this->
index()<noEntities_ && rule_.isInvalid(*
this))
165 #endif // OPM_ITERATORS_HEADER Definition: CpGridData.hpp:93
int index() const
The (positive) index of an entity.
Definition: EntityRep.hpp:126
bool orientation() const
Returns true if the entity has positive orientation.
Definition: EntityRep.hpp:135
HierarchicIterator(const CpGridData &grid)
Definition: Iterators.hpp:94
Holds the implementation of the CpGrid as a pimple.
Definition: OpmParserIncludes.hpp:42
Definition: Iterators.hpp:116
HierarchicIterator & operator++()
Definition: Iterators.hpp:102
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:105
Iterator intended to be used as LeafIterator and LevelIterator (no difference due to no adaptivity) f...
Definition: Entity.hpp:52
Iterator & operator++()
Increment operator.
Definition: Iterators.hpp:69
Class representing a pointer to an entity.
Definition: Entity.hpp:50
Only needs to provide interface for doing nothing.
Definition: Iterators.hpp:88
Iterator(const CpGridData &grid, int index, bool orientation)
Definition: Iterators.hpp:149
A rule at what entities to stop.
Definition: PartitionIteratorRule.hpp:41
Represents an entity of a given codim, with positive or negative orientation.
Definition: CpGridData.hpp:94
void increment()
Increments the entityrep's index() by one.
Definition: EntityRep.hpp:148