Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
Dune::Fufem::IntersectionSetIterator< IS > Class Template Reference

An iterator iterating over all intersections of an intersection set. More...

#include <dune/fufem/domains/intersectionsetiterator.hh>

Inheritance diagram for Dune::Fufem::IntersectionSetIterator< IS >:
Inheritance graph

Classes

class  SentinelIterator
 Empty sentinel type. More...
 

Public Types

using reference = const Intersection &
 Type returned when dereferencing.
 
typedef C iterator_category
 
typedef typename std::remove_const< V >::type value_type
 
typedef P pointer
 
typedef D difference_type
 
typedef value_type Value
 
typedef reference Reference
 
typedef pointer Pointer
 
typedef difference_type DifferenceType
 

Public Member Functions

 IntersectionSetIterator ()=default
 Default constructor.
 
 IntersectionSetIterator (const IntersectionSet &intersectionSet, ElementIterator elementBegin, ElementIterator elementEnd)
 Construct for given intersection set, element iterator and element end iterator.
 
 IntersectionSetIterator (const IntersectionSet &intersectionSet, ElementIterator elementBegin)
 Construct for given intersection set and element iterator.
 
 IntersectionSetIterator (const IntersectionSet &intersectionSet)
 Construct for given intersection set and element iterator.
 
reference operator* () const
 Dereference the iterator and obtain current reference.
 
IntersectionSetIteratoroperator++ ()
 Increment the iterator.
 
constexpr pointer operator-> () const
 
constexpr DerivedIterator operator++ (int)
 
constexpr decltype(auto) operator-- ()
 
constexpr DerivedIterator operator-- (int)
 
constexpr reference operator[] (difference_type n) const
 
constexpr decltype(auto) operator+= (difference_type n)
 
constexpr DerivedIterator operator+ (difference_type n) const
 
constexpr DerivedIteratoroperator-= (difference_type n)
 
constexpr DerivedIterator operator- (difference_type n) const
 

Protected Types

typedef It DerivedIterator
 

Protected Member Functions

constexpr const DerivedIteratorderived () const
 
constexpr DerivedIteratorderived ()
 

Friends

bool operator== (const IntersectionSetIterator &it1, const IntersectionSetIterator &it2)
 Equality comparison between two iterators.
 
bool operator== (const IntersectionSetIterator &it1, const SentinelIterator &it2)
 Equality comparison between two iterator and sentinel.
 

Detailed Description

template<class IS>
class Dune::Fufem::IntersectionSetIterator< IS >

An iterator iterating over all intersections of an intersection set.

Template Parameters
ISThe IntersectionSet the iterator should iterate over

The class IntersectionSet provided as template parameter IS should provide the following interface:

class IntersectionSet
{
public:
using GridView = ...;
const GridView& gridView() const {...};
bool contains (const GridView::Intersection& intersection) const {...};
bool containsFaceOf (const GridView::Codim<0>::Element& element) const {...};
}
constexpr std::bool_constant<((II==value)||...)> contains(std::integer_sequence< T, II... >, std::integral_constant< T, value >)

The iterator will loop over all intersections of the GridView the IntersectionSet is associated to for which intersectionSet.contains(intersection) is true. Intersections on elements where intersectionSet.containsFaceOf(element) is false will be skipped.

Member Typedef Documentation

◆ reference

template<class IS >
using Dune::Fufem::IntersectionSetIterator< IS >::reference = const Intersection&

Type returned when dereferencing.

Constructor & Destructor Documentation

◆ IntersectionSetIterator() [1/4]

template<class IS >
Dune::Fufem::IntersectionSetIterator< IS >::IntersectionSetIterator ( )
default

Default constructor.

◆ IntersectionSetIterator() [2/4]

template<class IS >
Dune::Fufem::IntersectionSetIterator< IS >::IntersectionSetIterator ( const IntersectionSet &  intersectionSet,
ElementIterator  elementBegin,
ElementIterator  elementEnd 
)
inline

Construct for given intersection set, element iterator and element end iterator.

Parameters
intersectionSetThe intersection set this iterator should loop over (will be stored by reference)
elementBeginIterator to the first element to consider
elementEndIterator past the last element to consider

◆ IntersectionSetIterator() [3/4]

template<class IS >
Dune::Fufem::IntersectionSetIterator< IS >::IntersectionSetIterator ( const IntersectionSet &  intersectionSet,
ElementIterator  elementBegin 
)
inline

Construct for given intersection set and element iterator.

Parameters
intersectionSetThe intersection set this iterator should loop over (will be stored by reference)
elementBeginIterator to the first element to consider

This will use intersectionSet.gridView().end<0>() as element end iterator. Use the values elementBegin = intersectionSet.gridView().begin<0>() and elementBegin = intersectionSet.gridView().end<0>() to create a begin and end iterator for the intersection set.

◆ IntersectionSetIterator() [4/4]

template<class IS >
Dune::Fufem::IntersectionSetIterator< IS >::IntersectionSetIterator ( const IntersectionSet &  intersectionSet)
inline

Construct for given intersection set and element iterator.

Parameters
intersectionSetThe intersection set this iterator should loop over (will be stored by reference)

This will use intersectionSet.gridView().begin<0>() and intersectionSet.gridView().end<0>() as element begin and end iterator. Use this method to create a begin iterator.

Member Function Documentation

◆ operator*()

template<class IS >
reference Dune::Fufem::IntersectionSetIterator< IS >::operator* ( ) const
inline

Dereference the iterator and obtain current reference.

◆ operator++()

template<class IS >
IntersectionSetIterator & Dune::Fufem::IntersectionSetIterator< IS >::operator++ ( )
inline

Increment the iterator.

Friends And Related Symbol Documentation

◆ operator== [1/2]

template<class IS >
bool operator== ( const IntersectionSetIterator< IS > &  it1,
const IntersectionSetIterator< IS > &  it2 
)
friend

Equality comparison between two iterators.

◆ operator== [2/2]

template<class IS >
bool operator== ( const IntersectionSetIterator< IS > &  it1,
const SentinelIterator it2 
)
friend

Equality comparison between two iterator and sentinel.


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