Prev Up Next
Go backward to Container Grid Function Concept
Go up to Grid Functions
Go forward to Partial Grid Function Concept

Total Grid Function Concept

Description

The Total Grid Function concept refines the Container Grid Function concept. A total grid function reserves storage to hold a value for each element in its range.

Refinement of
Container Grid Function
Notation
F is a type which is a model of Total Grid Function
f is an object of type F
G is shorthand for F::grid_type
g is an object of type G.
Associated types
None, exept those defined in Container Grid Function
Valid Expressions
None, exept those defined in Container Grid Function
Expression semantics
Name Expression Precondition Semantics Postcondition
construction from grid F f(g);   construct and bind f to g, allocate memory for f.size() values. f is bound to g

write access is allowed

read access is undefined

f.size() is equal to the cardinality of the range of f

construction and initialization F f(g,t);   construct and bind f to g,

allocate memory for f.size() values,

initialize all values to t

f is bound to g

write access is allowed

f(e) is equal to t for all elements e in the range of f.

f.size() is equal to the cardinality of the range of f

Binding to grid f.set_grid(g); f is unbound bind f to g,

allocate memory for f.size() values.

f is bound to g

write access is allowed,

read access is undefined

f.size() is equal to the cardinality of the range of f

Complexity Guarantees
Default construction takes constant time.
Construction from grid and construction with initalization both take time at O(f.size()), that is, the number of elements of type F::element_type of g.
Models
grid_function_vector<E,T> defined in grid-function-vector.h

Total grid functions for the Complex2D concrete grid, defined in grid-functions.h

For E = Complex2D::Vertex and E = Complex2D::Cell, the total grid functions are derived from grid_function_vector<E,T>; and for E = Complex2D::Edge, the total grid function is derived from grid_function_hash<E,T>. The reason is taht edges are not stored in the Complex2D data structure, and hence there is no consecutive index available for type Complex2D::Edge.

Notes
See also
Grid Element Function   Grid Function   Mutable Grid Function   Container Grid Function   Partial Grid Function  


Guntram Berti

Prev Up Next