Loading...
Searching...
No Matches
Dune::cpgrid::OrientedEntityTable< codim_from, codim_to > Class Template Reference

Represents the topological relationships between sets of entities, for example cells and faces. More...

`#include <OrientedEntityTable.hpp>`

Inheritance diagram for Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >:

## Public Types

typedef EntityRep< codim_from > | FromType
typedef EntityRep< codim_to > | ToType
typedef OrientedEntityRange< codim_to > | row_type
typedef Opm::SparseTable< ToType > | super_t
typedef super_t::mutable_row_type | mutable_row_type

## Public Member Functions

| OrientedEntityTable ()
| Default constructor.
template<typename DataIter, typename IntegerIter>
| OrientedEntityTable (DataIter data_beg, DataIter data_end, IntegerIter rowsize_beg, IntegerIter rowsize_end)
| Constructor taking iterators to a sequence of table data and a sequence of row size data.
int | rowSize (const FromType &e) const
| Given an entity e of codimension codim_from, returns the number of neighbours of codimension codim_to.
row_type | operator[] (const FromType &e) const
| Given an entity e of codimension codim_from, returns a row (an indirect container) containing its neighbour entities of codimension codim_to.
mutable_row_type | row (const FromType &e)
| Given an entity e of codimension codim_from, returns a row (an indirect container) containing its neighbour entities of codimension codim_to.
bool | operator== (const OrientedEntityTable &other) const
| Elementwise equality.
void | swap (OrientedEntityTable &other)
| Swap contents for other OrientedEntityTable.
void | printSparseRelationMatrix (std::ostream &os) const
| Prints the relation matrix corresponding to the table, sparse format.
void | printRelationMatrix (std::ostream &os) const
| Prints the full relation matrix corresponding to the table.
void | makeInverseRelation (OrientedEntityTable< codim_to, codim_from > &inv) const
| Makes the inverse relation, mapping codim_to entities to their codim_from neighbours.
bool | empty () const
| True if the table contains no rows.
int | size () const
| Returns the number of rows in the table.
int | dataSize () const
| Returns the number of data elements.
void | clear ()
| Makes the table empty().
void | appendRow (DataIter row_beg, DataIter row_end)
| Appends a row to the table.
void | allocate (IntegerIter rowsize_beg, IntegerIter rowsize_end)
| Request storage for table of given size.

## Friends

class | CpGridData

## Detailed Description

template<int codim_from, int codim_to>
class Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >

Represents the topological relationships between sets of entities, for example cells and faces.

The purpose of this class is to hide the intricacies of handling orientations from the client code, otherwise a straight Opm::SparseTable would do.

Template Parameters

  codim_from | Codimension of domain of relation mapping
  codim_to | Codimension of range of relation mapping

## Constructor & Destructor Documentation

## OrientedEntityTable()

template<int codim_from, int codim_to>
template<typename DataIter, typename IntegerIter>

Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >::OrientedEntityTable | ( | DataIter | data_beg,
|  | DataIter | data_end,
|  | IntegerIter | rowsize_beg,
|  | IntegerIter | rowsize_end )

inline

Constructor taking iterators to a sequence of table data and a sequence of row size data.

These table data are in the same format as the underlying Opm::SparseTable<int> constructor with the same signature.

Template Parameters

  DataIter | Iterator to table data.
  IntegerIter | Iterator to the row length data.

Parameters

  data_beg | The start of the table data.
  data_end | One-beyond-end of the table data.
  rowsize_beg | The start of the row length data.
  rowsize_end | One beyond the end of the row length data.

## Member Function Documentation

## allocate()

template<int codim_from, int codim_to>

void Opm::SparseTable< ToType >::allocate | ( | IntegerIter | rowsize_beg,
|  | IntegerIter | rowsize_end )

inline

Request storage for table of given size.

Parameters

  rowsize_beg | Start of row size data.
  rowsize_end | One beyond end of row size data.

## makeInverseRelation()

template<int codim_from, int codim_to>

void Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >::makeInverseRelation | ( | OrientedEntityTable< codim_to, codim_from > & | inv | ) | const

inline

Makes the inverse relation, mapping codim_to entities to their codim_from neighbours.

Implementation note: The algorithm has been changed to a three-pass O(n) algorithm.

Parameters

  inv | The OrientedEntityTable

## operator==()

template<int codim_from, int codim_to>

bool Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >::operator== | ( | const OrientedEntityTable< codim_from, codim_to > & | other | ) | const

inline

Elementwise equality.

Parameters

  other | The other element

Returns
  Returns true if this and the other element are equal.

## operator[]()

template<int codim_from, int codim_to>

row_type Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >::operator[] | ( | const FromType & | e | ) | const

inline

Given an entity e of codimension codim_from, returns a row (an indirect container) containing its neighbour entities of codimension codim_to.

Parameters

  e | Entity representation.

Returns
  A row of the table.

## printRelationMatrix()

template<int codim_from, int codim_to>

void Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >::printRelationMatrix | ( | std::ostream & | os | ) | const

inline

Prints the full relation matrix corresponding to the table.

Let the entities of codimensions f and t be given by the sets and . A relation matrix R is defined by

Warning: this method is suited only for tiny grids, use printSparseRelationMatrix() for other cases.

Parameters

  os | The output stream.

## printSparseRelationMatrix()

template<int codim_from, int codim_to>

void Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >::printSparseRelationMatrix | ( | std::ostream & | os | ) | const

inline

Prints the relation matrix corresponding to the table, sparse format.

Let the entities of codimensions f and t be given by the sets and . A relation matrix R is defined by

The output is written one entry to each line, in the format:

    row   column    entry (either 1 or -1)

The row and column numbers start from zero, so if using octave or matlab you should add 1 to those columns after loading, before calling spconvert().

Parameters

  os | The output stream.

## row()

template<int codim_from, int codim_to>

mutable_row_type Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >::row | ( | const FromType & | e | ) |

inline

Given an entity e of codimension codim_from, returns a row (an indirect container) containing its neighbour entities of codimension codim_to.

Parameters

  e | Entity representation.

Returns
  A row of the table.

## rowSize()

template<int codim_from, int codim_to>

int Dune::cpgrid::OrientedEntityTable< codim_from, codim_to >::rowSize | ( | const FromType & | e | ) | const

inline

Given an entity e of codimension codim_from, returns the number of neighbours of codimension codim_to.

Parameters

  e | Entity representation.

Returns
  the number of neighbours of codimension codim_to.

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

- opm/grid/cpgrid/OrientedEntityTable.hpp