Grid Element ConceptGrid EntitiesGrid Entity Concept

Grid Entity Concept


The Grid Entity concept is rather abstract in that it gives rise to rather separate sub-concepts, notably Grid Element , Grid Sequence Iterator, and Grid Incidence Iterator. Its purpose is to bundle some fundamental properties, much like the STL concepts Assignable and Equality Comparable which it refines.

The fundamental property captured by Grid Entity is binding to a Grid (the anchor grid), and global identity, in contrast to Element Handles, which are unique only within a single grid.

Conceptually, a grid is the owner of its entities; an entities lifetime cannot exceed that of its anchor grid. Also, a grid entity needs not necessarily to be stored permanently, it may be constructed only temporarily, for example a Grid Iterator or a Grid Element obtained by dereferencing a Grid Iterator.

Refinement of

STL Assignable
STL Equality Comparable


E is a type which is a model of Grid Entity
e, e1, e2 are objects of type E


An anchor of e is a logically superior entity. It is either an object of a type which is a model of Grid or an object of a type which is a model of Grid Element, to which e is incident. This is defined more precisely depending on the subconcept involved. For example, for Grid Element the anchor is the underlying grid; for a Grid Sequence Iterator on a Grid Range, it is the grid range, and for a Grid Incidence Iterator, it is a grid element. So, the anchor of a Vertex-On-Cell Iterator, is the cell over whose incident vertices the iteration is performed.

A grid entity e is valid, if its anchor is valid (either refers to an existing grid, or is itself a valid Grid Entity), and its handle is a valid handle of that grid.

Associated types


Expression Description
Grid type E::grid_type type of the corresponding anchor grid
Anchor type E::anchor_type type of the corresponding anchor
handle type E::handle_type type of the corresponding element handle

Valid Expressions


Expression Type requirements return type
Anchor grid e.TheGrid()   grid_type const&
Anchor entity e.TheAnchor()   anchor_type const&
Handle e.handle()   handle_type

Expression semantics


Expression Precondition Semantics Postcondition
Copy constructor E e1(e2)     e1 == e2
Assignment e1 = e2   e1 is a copy of e2 e1 == e2
Anchor grid e.TheGrid() e is valid get the grid to which e is bound  
Equality comparison e1 == e2 e1.TheAnchor() == e2.TheAnchor() X true if e1 and e2 refer to the same element of e1.TheGrid() e1 == e2 is equivalent to e1.handle() == e2.handle() and e1.TheAnchor() == e2.TheAnchor()X  


Grid Element
Grid Sequence Iterator
Grid Incidence Iterator

  1. This does not imply that for grids, there is a real equality comparison required. Rather, equality of grids generally means physical identity of the corresponding objects, that is, their addresses. In contrast, equality for Grid Entities generally means logical rather than physical identity, because they might be created only temporarily.

    Put another way, for grid entities, e1 = e2 entails e1 == e2, which is not the case for grids.

  2. It can be discussed if this precondition is necessary. Formally, two entities compare as different if not e1.TheAnchor() == e2.TheAnchor(). However, requiring this equality allows to compare only the handles, which is faster.
See also

Grid   Element Handle

Guntram Berti

Grid Element ConceptGrid EntitiesGrid Entity Concept