Commit 76045b1f authored by Martin Nolte's avatar Martin Nolte

[bugfix][albertagrid] fix failing assertion on comparison of intersection iterators

When comparing two default-constructed intersection iterators for AlbertaGrid,
this would result in an assertion to fail (in debug mode only). Otherwise, the
code worked perfectly fine.
parent a17b7dda
Pipeline #5204 passed with stage
in 46 minutes and 39 seconds
......@@ -350,39 +350,6 @@ namespace Dune
// AlbertaGridLeafIntersection
// ---------------------------
template< class GridImp >
inline AlbertaGridLeafIntersection< GridImp >
::AlbertaGridLeafIntersection ( const EntityImp &entity, const int n )
: Base( entity, n ),
neighborInfo_()
{}
template< class GridImp >
inline AlbertaGridLeafIntersection< GridImp >
::AlbertaGridLeafIntersection ( const This &other )
: Base( other ),
neighborInfo_()
{}
template< class GridImp >
inline AlbertaGridLeafIntersection< GridImp > &
AlbertaGridLeafIntersection< GridImp >::operator= ( const This &other )
{
*((Base *)this) = other;
neighborInfo_ = ElementInfo();
return *this;
}
template< class GridImp >
inline bool
AlbertaGridLeafIntersection< GridImp >::operator== ( const This &other ) const
{
return ((elementInfo() == other.elementInfo()) && (oppVertex_ == other.oppVertex_));
}
template< class GridImp >
inline void AlbertaGridLeafIntersection<GridImp>::next ()
{
......@@ -409,12 +376,6 @@ namespace Dune
return EntityImp( grid(), neighborInfo_, 0 );
}
template< class GridImp >
inline bool AlbertaGridLeafIntersection<GridImp>::conforming() const
{
return true;
}
template< class GridImp >
inline bool AlbertaGridLeafIntersection< GridImp >::neighbor () const
{
......@@ -468,22 +429,6 @@ namespace Dune
return grid().alberta2generic( 1, face );
}
template< class GridImp >
inline int
AlbertaGridLeafIntersection< GridImp >::twistInInside () const
{
return elementInfo().template twist< 1 >( oppVertex_ );
}
template< class GridImp >
inline int
AlbertaGridLeafIntersection< GridImp >::twistInOutside () const
{
return elementInfo().twistInNeighbor( oppVertex_ );
}
} // namespace Dune
#endif // #ifndef DUNE_ALBERTA_INTERSECTION_CC
......@@ -137,30 +137,31 @@ namespace Dune
using Base::inside;
AlbertaGridLeafIntersection ()
{}
AlbertaGridLeafIntersection () = default;
AlbertaGridLeafIntersection ( const EntityImp &entity, const int n );
AlbertaGridLeafIntersection ( const EntityImp &entity, int n ) : Base( entity, n ) {}
AlbertaGridLeafIntersection ( const This &other );
AlbertaGridLeafIntersection ( const This &other ) : Base( other ) {}
bool equals( const AlbertaGridLeafIntersection& other ) const
This &operator= ( const This &other )
{
return (*this) == other;
*static_cast< Base * >( this ) = other;
neighborInfo_ = ElementInfo();
return *this;
}
This &operator= ( const This &other );
bool operator== ( const This &other ) const { return (oppVertex_ == other.oppVertex_) && (elementInfo_ == other.elementInfo_); }
bool operator!= ( const This &other ) const { return (oppVertex_ != other.oppVertex_) || (elementInfo_ != other.elementInfo_); }
bool operator== ( const This &other ) const;
bool equals ( const AlbertaGridLeafIntersection& other ) const { return (*this) == other; }
void next ();
typename GridImp::template Codim< 0 >::Entity
outside () const;
typename GridImp::template Codim< 0 >::Entity outside () const;
bool neighbor () const;
bool conforming () const;
bool conforming () const { return true; }
LocalGeometry geometryInInside () const;
LocalGeometry geometryInOutside () const;
......@@ -169,11 +170,11 @@ namespace Dune
int indexInOutside () const;
int twistInInside () const;
int twistInOutside () const;
int twistInInside () const { return elementInfo().template twist< 1 >( oppVertex_ ); }
int twistInOutside () const { return elementInfo().twistInNeighbor( oppVertex_ ); }
protected:
using Base::elementInfo_;
using Base::oppVertex_;
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment