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: NLINES – 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: COORCH(,NLINES) – REAL (KIND=nag_wp) arrayInput
On entry: contains the coordinate of the th characteristic point, for ; while contains the corresponding coordinate.
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 , then the coordinates of the first end point are those stored in .
The second end point of the line. If , then 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 ,where , , and .
, 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: FBND – 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: X – REAL (KIND=nag_wp)Input
3: Y – REAL (KIND=nag_wp)Input
On entry: the values of and at which is to be evaluated.
4: RUSER() – REAL (KIND=nag_wp) arrayUser Workspace
5: IUSER() – INTEGER arrayUser Workspace
FBND is called with the parameters RUSER and IUSER as supplied to D06BAF. You are free to use the arrays RUSER and IUSER to supply information to FBND as an alternative to using COMMON global variables.
FBND must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which D06BAF is called. Parameters denoted as Input must not be changed by this procedure.
On entry: the coordinates of the intermediate points for polygonal arc lines. For a line defined as a polygonal arc (i.e., ), if , then
, for , must contain the coordinate of the consecutive intermediate points for this line. Similarly
, for , must contain the corresponding coordinate.
6: SDCRUS – INTEGERInput
On entry: the second dimension of the array CRUS as declared in the (sub)program from which D06BAF is called.
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: ITRACE – 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: RUSER() – REAL (KIND=nag_wp) arrayUser Workspace
19: IUSER() – INTEGER arrayUser Workspace
RUSER and IUSER are not used by D06BAF, but are passed directly to FBND and may be used to pass information to this routine as an alternative to using COMMON global variables.
20: RWORK(LRWORK) – REAL (KIND=nag_wp) arrayWorkspace
21: LRWORK – INTEGERInput
On entry: the dimension of the array RWORK as declared in the (sub)program from which D06BAF is called.
On entry: the dimension of the array IWORK as declared in the (sub)program from which D06BAF is called.
24: IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to , . If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction 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 parameter, 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).
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 parameter 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.
8 Further Comments
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.