Loading...
Searching...
No Matches
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 >:

## 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.
void | setValue (int index_arg, bool orientation_arg)
| Set entity value.
int | index () const
| The (positive) index of an entity.
int | signedIndex () const
| The signed index that also tells us the orientation.
bool | orientation () const
| Returns true if the entity has positive orientation.
EntityRep | opposite () const
| Returns an EntityRep with opposite orientation.
void | increment ()
| Increments the entityrep's index() by one.
bool | operator< (const EntityRep &other) const
| Ordering relation used for maps etc.
bool | operator== (const EntityRep &other) const
| Equality operator.
bool | operator!= (const EntityRep &other) const
| Inequality operator.

## 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

  codim | Codimension

## 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_arg | Entity index
  orientation_arg | True if the entity's orientation 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

  other | The 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

  other | The 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

  other | The 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

  index_arg | Entity index
  orientation_arg | True if the entity's orientation is positive.

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

- opm/grid/cpgrid/CpGridData.hpp
- opm/grid/cpgrid/EntityRep.hpp