Go up to Grids and Grid Ranges
Go forward to Grid Concept
Grid Range Concept
A Grid Range is a part of a grid, its base grid.
The underlying mathematical concept
is that of (a subset of) a (finite)
CW-complex.
Some well-known specializations of this concept are
triangulations
boundary complexes of convex
polytopes
and regular Cartesian grids.
A Grid Range behaves in most circumstances like a
Grid
The main difference is that a Grid Range has reference semantics with respect to
its underlying base grid, that is, the incidence relationship is determined by the
base grid.
This influences the behaviour of
Incidence Iterators
associated with a Grid Range,
which may visit
grid elements
that are contained in the base grid,
but not in the grid range
X
A Grid is a special case of a Grid
Range X
NOTE: A grid range as such does offer almost no functionality at all.
Any useful model will be a specialization of one or more
element ranges
X
like
Grid Vertex Range.
STL Assignable
R is a type which is a model of grid range
r is an object of type R
G is R::grid_type
|
Name | Expression | Description |
base grid |
R::grid_type |
type of the ranges' base grid X
|
|
|
|
Name | Expression | Type requirements | return type |
base grid reference |
r.TheGrid() |
|
grid_type const& |
|
|
|
Name |
Expression |
Precondition |
Semantics |
Postcondition
|
base grid reference |
G const& g = r.TheGrid() |
r has not been default constructed |
get the grid r references |
&g == &(g.TheGrid()) == &(r.TheGrid()) |
|
|
Vertex Grid Range
Edge Grid Range
Facet Grid Range
Cell Grid Range
enumerated_subrange
Complex2D
IstreamComplex2DFmt
-
If R is a model of
Grid,
then R::grid_type is identical to R.
An object r of type R
then references itself via r.TheGrid(),
that is, it has value semantics.
-
Technically, these types are bundled in a struct grid_types<R>
which is used by the algorithms to access these types. This opens up the possibility
to parameterize algorithms by such a traits class like grid_types<R>,
thereby introducing different iterator and element types, for example counting iterators
or debug iterators producing graphical output.
In this case, it would be more precise to say that one
"associates types with R",
instead of speaking of "types associated with R".
-
This may seem as an odd behaviour. However, this faithfully reflects what many
locally operating grid-based algorithms are intuitively expected to do when
given a proper subrange of a grid: The range restricts the region where some
work is to be done, but on each element, the algorithm accesses also some
meighboring elements via incidence iterators, which may or may not belong to the
range. The most striking example for this occurs if grids are distributed with
some overlap: On each part, the algorithm works only on the locally owned range,
but it accesses also elements in the overlap which are copied from other parts.
-
It is not necessary to require all possible element types to be defined.
Useful examples are Input Grids,
such as IstreamComplex2DFmt
which are used just to read a grid from
a specific file format.
Grid
Grid Element
Sequence Iterator
Incidence Iterator
Guntram Berti