Represents an entity of a given codim, with positive or negative orientation. More...
#include <EntityRep.hpp>
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... | |
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.
codim | Codimension |
|
inline |
Constructor taking an entity index and an orientation.
index_arg | Entity index |
orientation_arg | True if the entity's orientations is positive. |
|
inline |
The (positive) index of an entity.
Not a Dune interface method.
|
inline |
Inequality operator.
other | The other entity representation. |
|
inline |
Ordering relation used for maps etc.
Sorting on index and then orientation, with positive orientations first.
other | The other entity representation. |
|
inline |
Equality operator.
other | The other entity representation. |
|
inline |
|
inline |
Returns true if the entity has positive orientation.
Not a Dune interface method.
|
inline |
Set entity value.
index | Entity index |
orientation | True if the entity's orientations is positive. |