Prev Up Next
Go backward to CartesianGrid2D Grid Type
Go up to Grids and grid ranges
Go forward to IstreamComplex2DFmt Type

enumerated_subrange Type

Declaration
template<class G>
class enumerated_subrange;
Description
The class template enumerated_subrange implements a sub-range of a grid. Cells and vertices must be explicitly joined to the rangeX. Iteration over facets is provided.
Model of
Vertex Grid Range
Edge Grid RangeX
Facet Grid Range
Cell Grid Range
Definition
Defined in enumerated-subrange.h
Template parameters
Parameter Description Default
G the base grid  
Type requirements
G must be a model of Grid.
Public base classes
None.
Members
New members
Member Description
Types
vertex_range_ref reference to vertex range,

defined as vertex_range_ref<G,R>

cell_range_ref reference to cell range,

defined as cell_range_ref<G,R>

Functions
append_vertex(vertex_handle v) add a new vertex to r
append_cell(cell_handle c) add a new cell to r
vertex_range_ref vertices() reference to vertex range
cell_range_ref cells() reference to cell range
Example
  a_grid_type g;
  ...
  enumerated_subrange<a_grid_type>  r(g); // empty range
  // fill with cells
  for(gt::CellIterator c(g); ! c.IsDone(); ++c)
    if(predicate(*c)) // some predicate on cells
      r.append_cell(c.handle());
  // determine vertex set of r.cells()
   ConstructSubrangeFromCells(r,r.cells());
  
Notes
  1. The availability of these operations means that instances of enumerated_subrange do not ensure that their vertex range is the vertex set of the their cell range. It is the responsibility of the client to ensure this if it is needed. If this equality is not satisfied, it simply means that the range does not represent a dimension-homogeneous grid.

    Note, however, that there are components that can help in ensuring this property in a subrange, for example the ConstructSubrangeFromCells algorithm.

  2. The Edge Grid Range concept is supported in 2D only (when edges and facets coincide). The current implementation simply assumes that the template parameter G is two-dimensional; for future extension, a compile-time switch on the dimension should be performed here.
  3. The element types and incidence iterator types of enumerated_subrange are forwarded from the template parameter G. There is currently no mechanism implemented to determine at compile time which types are provided by G, therefore, some default assumption has to be made, excluding some simpler grid types from the set of possible parameters. This restriction is artificial and should be removed.
See also

enumerated_element_range   enumerated_subrange   enumerated_subrange_ref   Grid Range


Guntram Berti

Prev Up Next