Grid Function Concept

Grid Function Concept

Description

The Grid Function concept refines the Grid Element Function concept in that it bind the function to a particular grid. Evaluating a grid function without a valid grid set or with an element whose grid is different from that of the grid function is considered an error.

By binding to a particular grid, it is possible to treat both domain and range of a grid function as sequences with associated iterators.

Notation

F is a type which is a model of Grid Function
f is an object of type F
i is an object of F::const_iterator
e is an object of F::element_type
n is an object of F::size_type
G is shorthand for F::grid_type

Definitions

A grid function f is bound to a grid g, if &g == &f.TheGrid(). Else f is unbound.

The range of a grid function f is the set of all elements of type F::element_type in f.TheGrid().

The domain of a grid function is the set of all values of the form f(e) where e is in the range of f.

Associated types
 Name Expression Description Grid type F::grid_type type of the corresponding associated grid, model of Grid value iterator F::const_iterator iterator over the values of f model of STL Forward Iterator size type F::size_type integral type capable of representing the possible sizes of the value sequence.

Valid Expressions
 Name Expression Type requirements return type Grid reference f.TheGrid(); F::grid_type const& start of value sequence f.begin(); F::const_iterator end of value sequence f.end(); F::const_iterator size of value sequence f.size(); F::size_type

Expression semantics
 Name Expression Precondition Semantics Postcondition Grid reference G& g = f.TheGrid(); f is bound to a grid get reference to the underlying grid &(g.TheGrid()) == &(f.TheGrid()) start of value sequence i = f.begin(); f is bound to a grid return iterator to start of value sequence distance (i,f.end()) == f.size() end of value sequence i = f.end(); f is bound to a grid return iterator to past-the-end of value sequence i is past-the-end, i == f.end() size of value sequence n = f.size(); f is bound to a grid return size of value sequence f.size() == distance (f.begin(),f.end())

Models

cell2handle_map defined in grid-functors.h (X)
vertex2coord_map defined in geometry-functors.h (X)

Notes
1. Currently, iteration and size is not supported in these examples.