Dune::cpgrid::EntityRep< codim > Class Template Reference

Represents an entity of a given codim, with positive or negative orientation. More...

#include <EntityRep.hpp>

Inheritance diagram for Dune::cpgrid::EntityRep< codim >:
Dune::cpgrid::Entity< codim > Dune::cpgrid::EntityPointer< codim > Dune::cpgrid::EntityPointer< 0 > Dune::cpgrid::EntityPointer< cd > Dune::cpgrid::HierarchicIterator Dune::cpgrid::Iterator< cd, pitype >

Public Types

enum  { codimension =codim }
 
enum  { InvalidIndex = INT_MAX }
 

Public Member Functions

 EntityRep ()
 Default constructor.
 
 EntityRep (int index_arg, bool orientation_arg)
 Constructor taking an entity index and an orientation. More...
 
void setValue (int index_arg, bool orientation_arg)
 Set entity value. More...
 
int index () const
 The (positive) index of an entity. More...
 
bool orientation () const
 Returns true if the entity has positive orientation. More...
 
EntityRep opposite () const
 Returns an EntityRep with opposite orientation. More...
 
void increment ()
 Increments the entityrep's index() by one.
 
bool operator< (const EntityRep &other) const
 Ordering relation used for maps etc. More...
 
bool operator== (const EntityRep &other) const
 Equality operator. More...
 
bool operator!= (const EntityRep &other) const
 Inequality operator. More...
 

Detailed Description

template<int codim>
class Dune::cpgrid::EntityRep< codim >

Represents an entity of a given codim, with positive or negative orientation.

This class is not a part of the Dune interface, but of our implementation. Since this class has a few friends, and for aid in debugging, we document its interior representation here: The interior representation consists of an integer entityrep_ which, if positive or zero, indicates the index of the entity. In that case, the entity's orientation is positive. If entityrep_ is negative, the orientation is negative, and the index is given by ~entityrep_ (we cannot use -entityrep_, since 0 is a valid index). We may consider changing this representation to using something like a std::pair<int, bool> instead.

Template Parameters
codimCodimension

Constructor & Destructor Documentation

◆ EntityRep()

template<int codim>
Dune::cpgrid::EntityRep< codim >::EntityRep ( int  index_arg,
bool  orientation_arg 
)
inline

Constructor taking an entity index and an orientation.

Parameters
index_argEntity index
orientation_argTrue if the entity's orientations is positive.

Member Function Documentation

◆ index()

template<int codim>
int Dune::cpgrid::EntityRep< codim >::index ( ) const
inline

The (positive) index of an entity.

Not a Dune interface method.

Returns
the (positive) index of an entity.

◆ operator!=()

template<int codim>
bool Dune::cpgrid::EntityRep< codim >::operator!= ( const EntityRep< codim > &  other) const
inline

Inequality operator.

Parameters
otherThe other entity representation.
Returns
true if this and the other element are not equal.

◆ operator<()

template<int codim>
bool Dune::cpgrid::EntityRep< codim >::operator< ( const EntityRep< codim > &  other) const
inline

Ordering relation used for maps etc.

Sorting on index and then orientation, with positive orientations first.

Parameters
otherThe other entity representation.
Returns
true if this element is less than the other.

◆ operator==()

template<int codim>
bool Dune::cpgrid::EntityRep< codim >::operator== ( const EntityRep< codim > &  other) const
inline

Equality operator.

Parameters
otherThe other entity representation.
Returns
true if this and the other element are equal.

◆ opposite()

template<int codim>
EntityRep Dune::cpgrid::EntityRep< codim >::opposite ( ) const
inline

Returns an EntityRep with opposite orientation.

Returns
an EntityRep with opposite orientation.

◆ orientation()

template<int codim>
bool Dune::cpgrid::EntityRep< codim >::orientation ( ) const
inline

Returns true if the entity has positive orientation.

Not a Dune interface method.

Returns
true if the entity has positive orientation.

◆ setValue()

template<int codim>
void Dune::cpgrid::EntityRep< codim >::setValue ( int  index_arg,
bool  orientation_arg 
)
inline

Set entity value.

Parameters
indexEntity index
orientationTrue if the entity's orientations is positive.

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