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>
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 <opm/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))
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:123
Class representing a pointer to an entity.
Definition: Entity.hpp:283
Represents an entity of a given codim, with positive or negative orientation.
Definition: EntityRep.hpp:98
bool orientation() const
Returns true if the entity has positive orientation.
Definition: EntityRep.hpp:139
int index() const
The (positive) index of an entity.
Definition: EntityRep.hpp:125
void increment()
Increments the entityrep's index() by one.
Definition: EntityRep.hpp:152
Definition: Entity.hpp:70
Only needs to provide interface for doing nothing.
Definition: Iterators.hpp:89
HierarchicIterator & operator++()
Definition: Iterators.hpp:102
HierarchicIterator(const CpGridData &grid)
Definition: Iterators.hpp:94
Iterator intended to be used as LeafIterator and LevelIterator (no difference due to no adaptivity) f...
Definition: Iterators.hpp:56
Iterator & operator++()
Increment operator.
Definition: Iterators.hpp:69
Iterator(const CpGridData &grid, int index, bool orientation)
Definition: Iterators.hpp:149
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10
A rule at what entities to stop.
Definition: PartitionIteratorRule.hpp:42