dune-grid 2.9.0
Public Types | Public Member Functions | Protected Attributes | List of all members
Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp > Class Template Reference

Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" elements and with the domain boundary. More...

#include <dune/grid/common/intersectioniterator.hh>

Public Types

typedef IntersectionIteratorImp Implementation
 type of underlying implementation More...
 
typedef Dune::Intersection< GridImp, IntersectionImp > Intersection
 Type of Intersection this IntersectionIterator points to. More...
 

Public Member Functions

Implementationimpl ()
 access to the underlying implementation More...
 
const Implementationimpl () const
 access to the underlying implementation More...
 
Dereferencing
Intersection operator* () const
 Dereferencing operator. More...
 
const Intersectionoperator-> () const
 Pointer operator. More...
 
Compare methods
bool operator== (const IntersectionIterator &rhs) const
 Checks for equality. Only Iterators pointing to the same intersection from the same Entity are equal. Pointing to the same intersection from neighbor is unequal as inside and outside are permuted. More...
 
bool operator!= (const IntersectionIterator &rhs) const
 Checks for inequality. Only Iterators pointing to the same intersection from the same Entity are equal. Pointing to the same intersection from neighbor is unequal as inside and outside are permuted. More...
 
IntersectionIteratoroperator++ ()
 Preincrement operator. Proceed to next intersection. More...
 
IntersectionIterator operator++ (int)
 Postincrement operator. Proceed to next intersection. More...
 
 IntersectionIterator ()
 Default constructor. More...
 
Implementor interface
bool equals (const IntersectionIterator &rhs) const
 forward equality check to realIterator More...
 
 IntersectionIterator (const Implementation &impl)
 

Protected Attributes

Implementation realIterator
 

Detailed Description

template<class GridImp, class IntersectionIteratorImp, class IntersectionImp>
class Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >

Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" elements and with the domain boundary.

Template Parameters
GridImpType that is a model of Dune::Grid
IntersectionIteratorImpClass template that is a model of Dune::IntersectionIterator
Warning
The number of neigbors may be different from the number of faces/edges of an element!

Overview

Intersections are codimension 1 objects. These intersections are accessed via an IntersectionIterator. This allows the implementation of non-matching grids, as one face can now consist of several intersections. In a conforming mesh such an intersection corresponds to an entity of codimension 1 but in the general non-conforming case there will be no entity in the mesh that directly corresponds to the intersection. Thus, the IntersectionIterator describes these intersections implicitly.

Engine Concept

The IntersectionIterator class template wraps an object of type IntersectionIteratorImp and forwards all member function calls to corresponding members of this class. In that sense IntersectionIterator defines the interface and IntersectionIteratorImp supplies the implementation.

Intersections, leaf grid and level grid

On an entity e of codimension zero there are two ways to create IntersectionIterators by either using ilevelbegin() / ilevelend() or ileafbegin()/ileafend(). In the first case intersections with neighboring entities having the same level as e are traversed; in the second case ileafbegin()==ileafend() if e is not a leaf otherwise all intersections with neighboring leaf entities are traversed.

Consider a situation where two elements a and b have a common intersection. Element b has been refined into an element c and d, while a has not been refined. In one space dimension this situation is depicted in the figure below.

IntersectionIterator in a locally refined mesh.

Here the rule is the following: The LevelIntersectionIterator delivers all intersections with elements on the same level, the LeafIntersectionIterator delivers the intersections with all leaf elements if it has been started on a leaf element. Both iterators also stop at intersections with the grid boundary. According to this rule the level intersection iterator started at element a in the example above delivers an intersection with b and the left grid boundary, whereas the leaf intersection iterator returns c instead of b. Starting on entity c the level intersection iterator returns d and the intersection with the left boundary of the level 1 grid, but the leaf intersection iterator returns both d and a. Finally, starting on b the level intersection iterator returns a and the right boundary, but the leaf intersection iterator is empty since b is not a leaf entity of the grid. Starting on d both the level and the leaf intersection iterators will return the element c together with the right grid boundary.

Member Typedef Documentation

◆ Implementation

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
typedef IntersectionIteratorImp Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::Implementation

type of underlying implementation

Warning
Implementation details may change without prior notification.

◆ Intersection

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
typedef Dune::Intersection< GridImp, IntersectionImp > Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::Intersection

Type of Intersection this IntersectionIterator points to.

Constructor & Destructor Documentation

◆ IntersectionIterator() [1/2]

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::IntersectionIterator ( )
inline

Default constructor.

◆ IntersectionIterator() [2/2]

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::IntersectionIterator ( const Implementation impl)
inline

Copy Constructor from IntersectionIteratorImp

Member Function Documentation

◆ equals()

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
bool Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::equals ( const IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp > &  rhs) const
inline

forward equality check to realIterator

◆ impl() [1/2]

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
Implementation & Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::impl ( )
inline

access to the underlying implementation

Warning
Implementation details may change without prior notification.

◆ impl() [2/2]

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
const Implementation & Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::impl ( ) const
inline

access to the underlying implementation

Warning
Implementation details may change without prior notification.

◆ operator!=()

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
bool Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::operator!= ( const IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp > &  rhs) const
inline

Checks for inequality. Only Iterators pointing to the same intersection from the same Entity are equal. Pointing to the same intersection from neighbor is unequal as inside and outside are permuted.

◆ operator*()

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
Intersection Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::operator* ( ) const

Dereferencing operator.

◆ operator++() [1/2]

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
IntersectionIterator & Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::operator++ ( )
inline

Preincrement operator. Proceed to next intersection.

◆ operator++() [2/2]

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
IntersectionIterator Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::operator++ ( int  )
inline

Postincrement operator. Proceed to next intersection.

◆ operator->()

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
const Intersection * Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::operator-> ( ) const

Pointer operator.

◆ operator==()

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
bool Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::operator== ( const IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp > &  rhs) const
inline

Checks for equality. Only Iterators pointing to the same intersection from the same Entity are equal. Pointing to the same intersection from neighbor is unequal as inside and outside are permuted.

Member Data Documentation

◆ realIterator

template<class GridImp , class IntersectionIteratorImp , class IntersectionImp >
Implementation Dune::IntersectionIterator< GridImp, IntersectionIteratorImp, IntersectionImp >::realIterator
protected

The documentation for this class was generated from the following files: