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 >:
Inheritance graph

Public Types

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

Public Member Functions

 EntityRep ()
 Default constructor. More...
 
 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. Not a Dune interface method. More...
 
int signedIndex () const
 The signed index that also tells us the orientation. More...
 
bool orientation () const
 Returns true if the entity has positive orientation. Not a Dune interface method. More...
 
EntityRep opposite () const
 Returns an EntityRep with opposite orientation. More...
 
void increment ()
 Increments the entityrep's index() by one. More...
 
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

Member Enumeration Documentation

◆ anonymous enum

template<int codim>
anonymous enum
Enumerator
InvalidIndex 

◆ anonymous enum

template<int codim>
anonymous enum
Enumerator
codimension 

Constructor & Destructor Documentation

◆ EntityRep() [1/2]

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

Default constructor.

Referenced by Dune::cpgrid::EntityRep< codim >::opposite().

◆ EntityRep() [2/2]

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 orientation is positive.

Member Function Documentation

◆ increment()

template<int codim>
void Dune::cpgrid::EntityRep< codim >::increment ( )
inline

◆ index()

◆ 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.

References Dune::cpgrid::EntityRep< codim >::operator==().

◆ 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.

References Dune::cpgrid::EntityRep< codim >::index(), and Dune::cpgrid::EntityRep< codim >::orientation().

◆ 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.

Referenced by Dune::cpgrid::EntityRep< codim >::operator!=(), and Dune::cpgrid::Entity< codim >::operator==().

◆ opposite()

◆ 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 orientation is positive.

◆ signedIndex()

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

The signed index that also tells us the orientation.


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