1#ifndef DUNE_INTERSECTIONITERATORWRAPPER_HH
2#define DUNE_INTERSECTIONITERATORWRAPPER_HH
4#include <dune/common/version.hh>
6#include <dune/grid/common/intersectioniterator.hh>
21template <
class Gr
idImp,
class IntersectionIteratorImpl>
24 enum { dim = GridImp :: dimension };
25 enum { dimworld = GridImp :: dimensionworld };
29 typedef IntersectionIteratorImpl IntersectionIteratorImp;
38 typedef typename GridImp :: ctype
ctype;
41 typedef typename GridImp::template Codim<0>::Entity
Entity;
44 typedef typename GridImp::template Codim<1>::Geometry
Geometry;
46 typedef typename GridImp::template Codim<1>::LocalGeometry
LocalGeometry;
51 typedef typename IntersectionIteratorImpl::Twists
Twists;
52 typedef typename Twists::Twist
Twist;
57 template <
class EntityImp>
64 it().first( en, wLevel, grid );
67 operator bool ()
const {
return bool( itPtr_ ); }
72 return (itPtr_ && other.itPtr_ ) ?
it().equals( other.
it() ) : itPtr_ == other.itPtr_;
87 ALU3DSPACE SharedPointer< IntersectionIteratorImp > copy( itPtr_ );
122 return it().geometryInInside();
131 return it().geometry();
144 return it().indexInInside();
152 return it().geometryInOutside();
159 return it().indexInOutside();
172 return it().unitOuterNormal( local );
179 const auto& refElement = GridImp::faceReferenceElement();
180 assert( refElement.type() ==
type() );
188 return it().outerNormal( local );
195 return it().integrationOuterNormal( local );
205 IntersectionIteratorImp &
it() {
return *itPtr_; }
206 const IntersectionIteratorImp &
it()
const {
return *itPtr_; }
211 return it().weight();
215 mutable ALU3DSPACE SharedPointer< IntersectionIteratorImp > itPtr_;
218template <
class Gr
idImp>
228 template <
class EntityImp>
244template <
class Gr
idImp>
259 typedef typename GridImp :: ctype
ctype;
262 typedef typename GridImp::template Codim<0>::Entity
Entity;
265 typedef typename GridImp::template Codim<1>::Geometry
Geometry;
276 template <
class EntityImp>
319template <
class Gr
idImp>
329 template <
class EntityImp>
344template <
class Gr
idImp>
358 typedef typename GridImp :: ctype
ctype;
361 typedef typename GridImp::template Codim<0>::Entity
Entity;
364 typedef typename GridImp::template Codim<1>::Geometry
Geometry;
374 template <
class EntityImp>
378 if( wLevel > 0 && grid.conformingRefinement() )
383 DUNE_THROW( NotImplemented,
"LevelIntersectionIterator does not work for bisection refinement type grids on higher levels!");
#define ALU3DSPACE
Definition: alu3dinclude.hh:7
Definition: alu3dinclude.hh:63
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:23
const NormalType centerUnitOuterNormal() const
Definition: intersectioniteratorwrapper.hh:177
Geometry geometry() const
Definition: intersectioniteratorwrapper.hh:129
const NormalType outerNormal(const FieldVector< ctype, dim-1 > &local) const
Definition: intersectioniteratorwrapper.hh:186
size_t boundarySegmentIndex() const
return the boundary segment index
Definition: intersectioniteratorwrapper.hh:111
int weight() const
return weight associated with graph edge between the neighboring elements
Definition: intersectioniteratorwrapper.hh:209
bool boundary() const
Definition: intersectioniteratorwrapper.hh:102
Entity inside() const
access entity where iteration started
Definition: intersectioniteratorwrapper.hh:98
IntersectionIteratorImpl::Twists Twists
Definition: intersectioniteratorwrapper.hh:51
int segmentId() const
return the segment index (non-consecutive)
Definition: intersectioniteratorwrapper.hh:114
void increment()
increment iterator
Definition: intersectioniteratorwrapper.hh:76
IntersectionIteratorImp & it()
returns reference to underlying intersection iterator implementation
Definition: intersectioniteratorwrapper.hh:205
@ dimensionworld
Definition: intersectioniteratorwrapper.hh:35
IntersectionIteratorWrapper()
Definition: intersectioniteratorwrapper.hh:54
bool conforming() const
return true if intersection is conform (i.e. only one neighbor)
Definition: intersectioniteratorwrapper.hh:202
Entity outside() const
access neighbor
Definition: intersectioniteratorwrapper.hh:95
int boundaryId() const
return information about the Boundary
Definition: intersectioniteratorwrapper.hh:108
GridImp::template Codim< 0 >::Entity Entity
Entity type.
Definition: intersectioniteratorwrapper.hh:41
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: intersectioniteratorwrapper.hh:38
Twists::Twist Twist
Definition: intersectioniteratorwrapper.hh:52
GeometryType type() const
obtain the type of reference element for this intersection
Definition: intersectioniteratorwrapper.hh:135
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
type of intersection*Local
Definition: intersectioniteratorwrapper.hh:46
const IntersectionIteratorImp & it() const
Definition: intersectioniteratorwrapper.hh:206
const NormalType integrationOuterNormal(const FieldVector< ctype, dim-1 > &local) const
Definition: intersectioniteratorwrapper.hh:193
IntersectionIteratorWrapper(const GridImp &grid, const EntityImp &en, int wLevel, bool end)
constructor called from the ibegin and iend method
Definition: intersectioniteratorwrapper.hh:58
LocalGeometry geometryInInside() const
Definition: intersectioniteratorwrapper.hh:120
int level() const
return level of iterator
Definition: intersectioniteratorwrapper.hh:199
@ dimension
Definition: intersectioniteratorwrapper.hh:33
FieldVector< ctype, dimworld > NormalType
type of normal vector
Definition: intersectioniteratorwrapper.hh:49
LocalGeometry geometryInOutside() const
Definition: intersectioniteratorwrapper.hh:150
GridImp::template Codim< 1 >::Geometry Geometry
type of intersectionGlobal
Definition: intersectioniteratorwrapper.hh:44
Twist twistInOutside() const
twist of the face seen from the outer element
Definition: intersectioniteratorwrapper.hh:166
Twist twistInInside() const
twist of the face seen from the inner element
Definition: intersectioniteratorwrapper.hh:163
int indexInInside() const
Definition: intersectioniteratorwrapper.hh:142
int indexInOutside() const
Definition: intersectioniteratorwrapper.hh:157
bool neighbor() const
return true if across the intersection a neighbor on this level exists
Definition: intersectioniteratorwrapper.hh:105
const NormalType unitOuterNormal(const FieldVector< ctype, dim-1 > &local) const
Definition: intersectioniteratorwrapper.hh:170
bool equals(const ThisType &other) const
the equality method
Definition: intersectioniteratorwrapper.hh:70
Definition: intersectioniteratorwrapper.hh:221
LeafIntersectionWrapper(const ThisType &org)
The copy constructor.
Definition: intersectioniteratorwrapper.hh:235
LeafIntersectionWrapper(const GridImp &grid, const EntityImp &en, int wLevel, bool end)
constructor called from the ibegin and iend method
Definition: intersectioniteratorwrapper.hh:229
LeafIntersectionWrapper()
Definition: intersectioniteratorwrapper.hh:225
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:246
bool equals(const ThisType &i) const
the equality method
Definition: intersectioniteratorwrapper.hh:300
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
type of intersection*Local
Definition: intersectioniteratorwrapper.hh:267
GridImp::template Codim< 0 >::Entity Entity
Entity type.
Definition: intersectioniteratorwrapper.hh:262
Intersection intersection_
Definition: intersectioniteratorwrapper.hh:309
const Intersection & dereference() const
return reference to intersection
Definition: intersectioniteratorwrapper.hh:294
LeafIntersectionIteratorWrapper(const ThisType &org)
The copy constructor.
Definition: intersectioniteratorwrapper.hh:282
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: intersectioniteratorwrapper.hh:259
const IntersectionImp & impl() const
Definition: intersectioniteratorwrapper.hh:314
ThisType & operator=(const ThisType &org)
the f*cking assignment operator
Definition: intersectioniteratorwrapper.hh:287
Dune::Intersection< GridImp, IntersectionImp > Intersection
Definition: intersectioniteratorwrapper.hh:251
@ dimension
Definition: intersectioniteratorwrapper.hh:254
LeafIntersectionIteratorWrapper(const GridImp &grid, const EntityImp &en, int wLevel, bool end)
constructor called from the ibegin and iend method
Definition: intersectioniteratorwrapper.hh:277
void increment()
increment iterator
Definition: intersectioniteratorwrapper.hh:303
GridImp::template Codim< 1 >::Geometry Geometry
type of intersectionGlobal
Definition: intersectioniteratorwrapper.hh:265
IntersectionImp & impl()
Definition: intersectioniteratorwrapper.hh:312
LeafIntersectionIteratorWrapper()
default constructor
Definition: intersectioniteratorwrapper.hh:273
@ dimensionworld
Definition: intersectioniteratorwrapper.hh:256
FieldVector< ctype, dimensionworld > NormalType
type of normal vector
Definition: intersectioniteratorwrapper.hh:270
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:322
LevelIntersectionWrapper()
Definition: intersectioniteratorwrapper.hh:326
LevelIntersectionWrapper(const ThisType &org)
The copy constructor.
Definition: intersectioniteratorwrapper.hh:336
LevelIntersectionWrapper(const GridImp &grid, const EntityImp &en, int wLevel, bool end)
constructor called from the ibegin and iend method
Definition: intersectioniteratorwrapper.hh:330
Class that wraps IntersectionIteratorImp of a grid and gets it's internal object from a object stack ...
Definition: intersectioniteratorwrapper.hh:346
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: intersectioniteratorwrapper.hh:358
const IntersectionImp & impl() const
Definition: intersectioniteratorwrapper.hh:422
@ dimension
Definition: intersectioniteratorwrapper.hh:353
Intersection intersection_
Definition: intersectioniteratorwrapper.hh:417
GridImp::template Codim< 0 >::Entity Entity
Entity type.
Definition: intersectioniteratorwrapper.hh:361
LevelIntersectionIteratorWrapper()
Definition: intersectioniteratorwrapper.hh:371
bool equals(const ThisType &i) const
the equality method
Definition: intersectioniteratorwrapper.hh:406
IntersectionImp & impl()
Definition: intersectioniteratorwrapper.hh:420
GridImp::template Codim< 1 >::Geometry Geometry
type of intersectionGlobal
Definition: intersectioniteratorwrapper.hh:364
FieldVector< ctype, dimensionworld > NormalType
type of normal vector
Definition: intersectioniteratorwrapper.hh:369
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
type of intersection*Local
Definition: intersectioniteratorwrapper.hh:366
void increment()
increment iterator
Definition: intersectioniteratorwrapper.hh:409
ThisType & operator=(const ThisType &org)
the f*cking assignment operator
Definition: intersectioniteratorwrapper.hh:393
@ dimensionworld
Definition: intersectioniteratorwrapper.hh:355
LevelIntersectionIteratorWrapper(const ThisType &org)
The copy constructor.
Definition: intersectioniteratorwrapper.hh:388
LevelIntersectionIteratorWrapper(const GridImp &grid, const EntityImp &en, int wLevel, bool end)
constructor called from the ibegin and iend method
Definition: intersectioniteratorwrapper.hh:375
Dune::Intersection< GridImp, IntersectionImp > Intersection
Definition: intersectioniteratorwrapper.hh:350
const Intersection & dereference() const
return reference to intersection
Definition: intersectioniteratorwrapper.hh:400