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>
73 if(rule_.fullSet || rule_.emptySet)
75 while(this->
index()<noEntities_ && rule_.isInvalid(*
this))
120 OPM_THROW(std::runtime_error,
"Calling operator++() on HierarchicIterator for CpGrid, which has no refinement.");
147 template<
int codim, Dune::PartitionIteratorType pitype >
148 struct iterator_traits<
Dune::cpgrid::Iterator< codim, pitype > >
151 typedef ptrdiff_t difference_type;
152 typedef typename Iterator::Entity value_type;
153 typedef value_type* pointer;
154 typedef value_type& reference;
155 typedef forward_iterator_tag iterator_category;
159 struct iterator_traits<
Dune::cpgrid::HierarchicIterator >
161 typedef ptrdiff_t difference_type;
163 typedef value_type* pointer;
164 typedef value_type& reference;
165 typedef forward_iterator_tag iterator_category;
171 #include <opm/grid/cpgrid/CpGridData.hpp>
172 #include "Entity.hpp"
177 template<
int cd, PartitionIteratorType pitype>
183 noEntities_(grid.size(cd))
185 if(rule_.fullSet || rule_.emptySet)
188 while(this->
index()<noEntities_ && rule_.isInvalid(*
this))
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:123
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:64
Entity()
Constructor taking a grid and an integer entity representation.
Definition: Entity.hpp:108
Only needs to provide interface for doing nothing.
Definition: Iterators.hpp:104
HierarchicIterator & operator++()
Definition: Iterators.hpp:118
const Entity< 0 > & operator*() const
Const dereferencing operator.
Definition: Iterators.hpp:131
const Entity< 0 > * operator->() const
Const member by pointer operator.
Definition: Iterators.hpp:124
HierarchicIterator(const CpGridData &grid)
Definition: Iterators.hpp:110
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:70
const Entity< cd > & operator*() const
Const dereferencing operator.
Definition: Iterators.hpp:87
const Entity< cd > * operator->() const
Const member by pointer operator.
Definition: Iterators.hpp:80
Iterator(const CpGridData &grid, int index, bool orientation)
Definition: Iterators.hpp:178
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10
A rule at what entities to stop.
Definition: PartitionIteratorRule.hpp:42