# The domain

FEAT2 has a build-in support for analytical descriptions of domains, in particular in 2D. Such analytical descriptions are necessary if parts of the boundary are not given by line but by curves. The analytical description ensures that during the refinement of a mesh, new vertices are generated at the correct place. If the mesh is more and more refined, it converges to the analytical description of the boundary.

A domain is described by the structure `t_boundary` and has the following properties:

• It can be imported from a `.PRM` file.
• It consists of a number of "boundary components".
• Each "boundary component" represents an "outer wall" of the domain.
• The domain must be simply connected.
• "Outer" boundary components (outer walls) are oriented counterclockwise.
• "Inner" boudary components (holes) are oriented clockwise
• Each boundary component consists of a set of boundary segments, e.g.
• Lines
• Circles or arcs
• Splines
• Analytical descriptions entered via a formula
• Points on the 2D boundary are identified by a tuple `(ibct,dlambda)` with
• `ibct` defining the boundary component and
• `dlambda` defining a parameter value.
• The following important routines can be used with such a tuple:
• `boundary_getCoords`: Convert a parameter value to the (x/y) coordinate
• `boundary_getNormal2D`: Calculate the normal vector in the point.

Example: The following picture shows the very common Flow-Around-Cylinder domain. This domain is of length 2.2, height 0.41 with a circle with radius 0.05 at position (0.2,0.2). The domain has two "boundary components", i.e., "outer walls". The first is the outer box that defines a channel. The second is the inner circle which represents an obstacle/hole. The outer box is oriented counterclockwise while the inner circle is oriented clockwise: The outer box has 4 boundary segments, marked as (1,1..4) in the following picture. The circle consists only of one boundary segment (marked as (2,1)) describing it completely: ## Parametrisation

There are two types of parametrisations available:

### 0-1 parametrisation (default)

This is the default parametrisation and has the following properties:

• Integer parameter values `dlambda = 0.0, 1.0, 2.0, ...` identify the endpoints of the boundary segments. Numbers inbetween define the ratio in which the boundary segment is divided.
• As a consequence, e.g., "half" numbers `dlambda = 0.5, 1.5, 2.5, ...` identify the midpoints of the segments.
• The maximum possible parameter value on a boundary component coincides with the maximum number of segments.

The following picture demonstrates this approach based on the above example. The corners of the box as well as the start/endpoint of the bow describing the circle have integer parameter values. The highest parameter value (4.0 for the box and 1.0 for the circle) close the domain and coincides with the point with parameter value 0.0. ### Arc length parametrisation

This alternative parametrisation works based on the arc length:

• The parameter value `dlambda` defines the distance from the starting point of a boundary component.
• The maximum possible parameter value is the length of the boundary component.

In the following picture, this approach is shown. The parameter values of the endpoints of the segments are calculated by the sum of the lengths of the segments. 