Given a closed connected subdomain of , whose boundary is divided by characteristic points into distinct line segments, d06baf generates a boundary mesh on . Each line segment may be a straight line, a curve defined by the equation , or a polygonal curve defined by a set of given boundary mesh points.
This routine is primarily designed for use with either d06aaf (a simple incremental method) or d06abf (Delaunay–Voronoi method) or d06acf (Advancing Front method) to triangulate the interior of the domain . For more details about the boundary and interior mesh generation, consult the D06 Chapter Introduction as well as George and Borouchaki (1998).
This routine is derived from material in the MODULEF package from INRIA (Institut National de Recherche en Informatique et Automatique).
George P L and Borouchaki H (1998) Delaunay Triangulation and Meshing: Application to Finite Elements Editions HERMES, Paris
1: – IntegerInput
On entry: , the number of lines that define the boundary of the closed connected subdomain (this equals the number of characteristic points which separate the entire boundary into lines).
2: – Real (Kind=nag_wp) arrayInput
On entry: contains the coordinate of the th characteristic point, for ; while contains the corresponding coordinate.
3: – Integer arrayInput
On entry: the description of the lines that define the boundary domain. The line
, for , is defined as follows:
The number of points on the line, including two end points.
The first end point of the line. If , the coordinates of the first end point are those stored in .
The second end point of the line. If , the coordinates of the second end point are those stored in .
This defines the type of line segment connecting the end points. Additional information is conveyed by the numerical value of as follows:
, the line is described in fbnd with as the index. In this case, the line must be described in the trigonometric (anticlockwise) direction;
, the line is a straight line;
if , say (), then the line is a polygonal arc joining the end points and interior points specified in crus. In this case the line contains the points whose coordinates are stored in
, for .
For each line described by fbnd (lines with
, for ) the two end points ( and ) lie on the curve defined by index in fbnd, i.e.,
, for .
For all lines described as polygonal arcs (lines with
, for ) the sets of intermediate points (i.e., for all such that ) are not overlapping. This can be expressed as:
for a such that , and .
4: – real (Kind=nag_wp) Function, supplied by the user.External Procedure
fbnd must be supplied to calculate the value of the function which describes the curve on segments of the boundary for which .
If there are no boundaries for which fbnd will never be referenced by d06baf and fbnd may be the dummy function d06bad. (d06bad is included in the NAG Library.)
On entry: , the reference index of the line (portion of the contour) described.
2: – Real (Kind=nag_wp)Input
3: – Real (Kind=nag_wp)Input
On entry: the values of and at which is to be evaluated.
4: – Real (Kind=nag_wp) arrayUser Workspace
5: – Integer arrayUser Workspace
fbnd is called with the arguments ruser and iuser as supplied to d06baf. You should use the arrays ruser and iuser to supply information to fbnd.
fbnd must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d06baf is called. Arguments denoted as Input must not be changed by this procedure.
Note:fbnd should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d06baf. If your code inadvertently does return any NaNs or infinities, d06baf is likely to produce unexpected results.
5: – Real (Kind=nag_wp) arrayInput
On entry: the coordinates of the intermediate points for polygonal arc lines. For a line defined as a polygonal arc (i.e., ), if ,
, for , must contain the coordinate of the consecutive intermediate points for this line. Similarly
, for , must contain the corresponding coordinate.
6: – IntegerInput
On entry: the second dimension of the array crus as declared in the (sub)program from which d06baf is called.
7: – Real (Kind=nag_wp) arrayInput
On entry: is the geometric progression ratio between the points to be generated on the line , for and .
If , is not referenced.
if , , for .
8: – IntegerInput
On entry: , the number of separately connected components of the boundary.
9: – Integer arrayInput
On entry: is the number of line segments in component of the contour. The line of component runs in the direction to if , and in the opposite direction otherwise; for .
, for ;
10: – Integer arrayInput
On entry: lcomp must contain the list of line numbers for the each component of the boundary. Specifically, the line numbers for the th component of the boundary, for , must be in elements to of lcomp, where and
must hold a valid permutation of the integers .
11: – IntegerInput
On entry: the maximum number of the boundary mesh vertices to be generated.
12: – IntegerInput
On entry: the maximum number of boundary edges in the boundary mesh to be generated.
13: – IntegerOutput
On exit: the total number of boundary mesh vertices generated.
14: – Real (Kind=nag_wp) arrayOutput
On exit: will contain the coordinate of the th boundary mesh vertex generated, for ; while will contain the corresponding coordinate.
15: – IntegerOutput
On exit: the total number of boundary edges in the boundary mesh.
16: – Integer arrayOutput
On exit: the specification of the boundary edges. and will contain the vertex numbers of the two end points of the th boundary edge. is a reference number for the th boundary edge and
, where and are such that the th edges is part of the th line of the boundary and ;
, where and are such that the th edges is part of the th line of the boundary and .
17: – IntegerInput
On entry: the level of trace information required from d06baf.
No output is generated.
Output from the boundary mesh generator is printed on the current advisory message unit (see x04abf). This output contains the input information of each line and each connected component of the boundary.
An analysis of the output boundary mesh is printed on the current advisory message unit. This analysis includes the orientation (clockwise or anticlockwise) of each connected component of the boundary. This information could be of interest to you, especially if an interior meshing is carried out using the output of this routine, calling either d06aaf, d06abf or d06acf.
The output is similar to that produced when , but the coordinates of the generated vertices on the boundary are also output.
You are advised to set , unless you are experienced with finite element mesh generation.
18: – Integer arrayUser Workspace
19: – Real (Kind=nag_wp) arrayUser Workspace
iuser and ruser are not used by d06baf, but are passed directly to fbnd and may be used to pass information to this routine.
20: – Real (Kind=nag_wp) arrayWorkspace
21: – IntegerInput
On entry: the dimension of the array rwork as declared in the (sub)program from which d06baf is called.
22: – Integer arrayWorkspace
23: – IntegerInput
On entry: the dimension of the array iwork as declared in the (sub)program from which d06baf is called.
24: – IntegerInput/Output
On entry: ifail must be set to , . If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, if you are not familiar with this argument, the recommended value is . When the value is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
for some with ;
for some ;
or for some ;
or for some ;
for some ;
, or for a ;
lcomp does not represent a valid permutation of the integers in ;
one of the end points for a line described by the user-supplied function (lines with
, for ) does not belong to the corresponding curve in fbnd;
the intermediate points for the lines described as polygonal arcs (lines with , for ) are overlapping.
An error has occurred during the generation of the boundary mesh. It appears that nedmx is not large enough, so you are advised to increase the value of nedmx.
An error has occurred during the generation of the boundary mesh. It appears that nvmax is not large enough, so you are advised to increase the value of nvmax.
An error has occurred during the generation of the boundary mesh. Check the definition of each line (the argument lined) and each connected component of the boundary (the arguments nlcomp, and lcomp, as well as the coordinates of the characteristic points. Setting may provide more details.
An unexpected error has been triggered by this routine. Please
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.
Parallelism and Performance
d06baf is not threaded in any implementation.
The boundary mesh generation technique in this routine has a ‘tree’ structure. The boundary should be partitioned into geometrically simple segments (straight lines or curves) delimited by characteristic points. Then, the lines should be assembled into connected components of the boundary domain.
Using this strategy, the inputs to that routine can be built up, following the requirements stated in Section 5:
the characteristic and the user-supplied intermediate points:
The example below details the use of this strategy.
The NAG logo is taken as an example of a geometry with holes. The boundary has been partitioned in lines characteristic points; including for the exterior boundary and for the logo itself. All line geometry specifications have been considered, see the description of lined, including lines defined as polygonal arc, defined by fbnd and all the others are straight lines.