Prev Up
Go backward to Vertex (Edge, Cell, ...) Grid Range Concept
Go up to Grids and Grid Ranges

Grid-With-Boundary Concept

Description
A Grid-With-Boundary allows to query whether a facet is a boundary facet. Moreover, it defines a special cell handle for an `outside cell', and allows to query whether a cell is inside the grid.
Refinement of
Grid
Cell Grid Range
Facet Grid Range
The cell type of a Grid-With-Boundary is a model of Grid Cell and of Facet Grid Range.
Notation
G is a type which is a model of Grid-With-Boundary
g is an object of type G
c is an object of type G::Cell
h is an object of type G::cell_handle
f is an object of type G::Facet
fc is an object of type G::FacetOnCellIterator
Definitions
Associated types
No new ones, but the requirements on G::Cell are strengthened.
Name Expression Description
cell type G::Cell the cell element type of G

model of Grid Cell and of Facet Grid Range

Valid Expressions
Name Expression Type requirements return type
inside test g.IsInside(c)   bool
inside test g.IsInside(h)   bool
boundary test g.IsOnBoundary(fc)   bool
boundary test g.IsOnBoundary(f)   bool
outer cell handle g.outer_cell_handle()   G::cell_handle
Expression semantics
Name Expression Precondition Semantics Postcondition
inside test g.IsInside(c); c is bound to g

c is valid or c.handle() == g.outer_cell_handle()

Test if c is inside the grid true if c is valid for g.

false if c.handle() == g.outer_cell_handle()

inside test g.IsInside(h); h is valid or h == g.outer_cell_handle() Test if h is handle of a cell inside the grid true if h is valid for g.

false if h == g.outer_cell_handle()

boundary test g.IsOnBoundary(f) f is valid Returns true if f is a boundary facet of g  
boundary test g.IsOnBoundary(fc) fc is valid equivalent to g.IsOnBoundary(*fc).  
outer cell handle h = g.outer_cell_handle();   return a handle denoting an `outside' cell g.IsInside(h) is false
Invariants
g.IsInside(g.outer_cell_handle()) == false
g.IsInside(c) == g.IsInside(c.handle())
g.IsOnBoundary(fc) == ! g.IsInside(fc.OtherCell())X
g.IsOnBoundary(f) == (!g.IsInside(f.TheCell()) || !g.IsInside(f.OtherCell()))
g.IsInside() evaluates to true for all cells in the range [g.FirstCell(),g.EndCell()).
Refinements
Models
Complex2D
Notes
  1. It does however not follow that if ! g.IsInside(h), then h == g.outer_cell_handle(), because it is possible that there are many different handles denoting an outer cell. For example, when we consider Cartesian grids, cells with an logical index (i,j) outside the grid range would satisfy ! g.IsInside(c) but do not necessarily possess a handle equal to g.outer_cell_handle().
  2. It is possible to create a cell with the `outer' cell handle:
     Cell c = g.cell(g.outer_cell_handle())
    
    is possible, as is
    Cell c = fc.OtherCell()
    
    when g.IsOnBoundary(fc) is true. However, the only operation guaranteed to work with c is the query g.IsInside(c) which evaluates to false.
See also

Guntram Berti

Prev Up