GFem language documentation -- 3.3.4 Regions

Previous: 3.3.3 Geometric variables, inner and region bdy, normal
Up: 3.3 Building a mesh

### 3.3.4 Regions

A sub-domain is a piece of the domain which is simply connected and delimited by boundaries.

Each sub-domain has a region number assigned to it. This is done by Gfem, not by the user. Every time `border` is called, an internal number `ngt` is incremented by 1. Then when the key word `border` is invoked the last edge of this portion of boundary assigns this number to the triangle which lies on its left. Finally all triangles which are in this subdomain are reassigned this number.

At the end of the triangulation process, each triangle has a well defined number `ngt`. The number region is a piecewise linear continuous interpolation at the vertices of `ngt`. To be exact, the value of region at a vertex (x0,y0) is the value of `ngt` at (x0,y0-10-6), except if `precise` is set in which case region is equal to `ngt`.