Skip to content
Snippets Groups Projects
Commit feaf5b71 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

implemented levelNeighbor (returning true if neighbor on level exists)

and leafNeighbor (returning true, if neighbor exists and is leaf)

Added default implementations for this feature, using the old neighbor
method and inside and outside

[[Imported from SVN: r4466]]
parent ca684793
Branches
Tags
No related merge requests found
......@@ -205,10 +205,21 @@ namespace Dune
}
//! @brief return true if intersection is shared with another element.
bool neighbor () const
bool neighbor () const DUNE_DEPRECATED
{
return this->realIterator.neighbor();
}
//! @brief return true if intersection is shared with another element on the same level.
bool levelNeighbor () const
{
return this->realIterator.levelNeighbor();
}
//! @brief return true if intersection is shared with another leaf element.
bool leafNeighbor () const
{
return this->realIterator.leafNeighbor();
}
/*! @brief return EntityPointer to the Entity on the inside of this
intersection. That is the Entity where we started this Iterator.
......@@ -394,6 +405,21 @@ namespace Dune
n /= n.two_norm();
return n;
}
//! default using old neighbor method
bool levelNeighbor () const
{
return (asImp().neighbor()) ?
(asImp().outside()->level() == asImp().inside()->level()) : false;
}
//! default using old neighbor method
bool leafNeighbor () const
{
return (asImp().neighbor()) ?
(asImp().outside()->isLeaf()) : false;
}
private:
//! Barton-Nackman trick
IntersectionIteratorImp<GridImp>& asImp ()
......
......@@ -95,6 +95,12 @@ namespace Dune {
//! return true if across the intersection a neighbor on this level exists
bool neighbor () const { return it().neighbor(); }
//! return true if across the intersection a neighbor on this level exists
bool levelNeighbor () const { return it().levelNeighbor(); }
//! return true if across the intersection a neighbor on this level exists
bool leafNeighbor () const { return it().leafNeighbor(); }
//! return information about the Boundary
int boundaryId () const { return it().boundaryId(); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment