36
INTERNATIONAL JOURNAL FOR NUMERICAL METHODS IN ENGINEERING, VOL. 24,1043- 1078 (19 87) ROBUST, GEOMETRICALLY BASED, AUTOMATIC TWO- DIMENSIONAL MESH GENERATION PEGGY L. BAEHMANN, SCOTT I-. WITTCHEW, MARK S. SHEPHARD, KURT R. GRICE AND MARK A. YERRY Centev.for Interattixr Coinpuler Graphics. Kcnssclaer Po/ytechnic Institute, Troy, NY 12180-3590. U.S.A. SUMMARY A technical description of the algorithms employed in the modified quadtree mesh generator is .given. Although the basis of the mesh generator is the same as the original version developed by Yerry and Shephard,'.2 the actual algorithms on which it is built have been entirely changed for the purpose of ensuring the robustness of the technique. As demonstrated in the paper the algorithmic changes made do ensure the robustness of the approach, but introduce additional algorithmic difficulties, the solutions of which are also presented. In addition to examples showing the capability of the mesh generator, the linear computational growth rate of the mesh generator is demonstrated. 1. INTRODUCTION Rcccntly there has been an increased interest in the development of automatic mesh generation algorithms capable of discretizing any geometry into a valid finite element mesh without user intervention. The key factor pushing this development is the need to develop finite element models for complex three-dimensional geometries. A number of algorithmic approaches for two- dimensional geometries have been with approaches for general three-dimensional geometries appearing more recently.'0p' The availability of a complete geometric represent- ation in terms of solid m ~ d e l l e r s ' ~ ~ ' ~ makes the use of these new approaches feasible. This paper presents the algorithms recently developed to ensure the robustness and efficiency of thc two-dimensional modified quadtree mesh generator. The procedurcs used were specifically selected so that they are directly extendible to thrcc dimensions for use in the modified octree mesh generator. 'Opl' Thc modified quadtree mesh generator is based on a spatial decomposition procedure that represents the domain of an object as a sct of disjoint squares, referred to as quadrants, that are stored in a hierarchic The basic tree structure used to define the modified quadtree IS Gmilar to the original quadtree representations.'"~'' The object to be meshed is placed in a square universe that entirely encloses it. This square represents the root of the tree, and is then subdivided into four quadrants that are represented as the children of the root in the tree. The remainder of the tree is then defined in a recursive manner by subdividing the boundary and interior quadrants until all quadrants are at the desired level, as dictated by the geometry of the object and the mesh control information applied to the object. With the information stored for the boundary quadrants, it is possible to determine which portions of the domain are in the quadrant. After the quadtree has been defined, all terminal quadrants arc checked to ensure that only one tree level difference exists 0029 5981 /87,'061043-36$18.00 {c) 1987 by John Wiley & Sons. Ltd. Receiwd 25 April 1986 Revised 25 August 1986

Robust, geometrically based, automatic two-dimensional mesh generation

Embed Size (px)

Citation preview

Page 1: Robust, geometrically based, automatic two-dimensional mesh generation

INTERNATIONAL JOURNAL FOR NUMERICAL METHODS IN ENGINEERING, VOL. 24,1043- 1078 (19 87)

ROBUST, GEOMETRICALLY BASED, AUTOMATIC TWO- DIMENSIONAL MESH GENERATION

PEGGY L. BAEHMANN, SCOTT I-. WITTCHEW, MARK S. SHEPHARD, KURT R. GRICE AND MARK A. YERRY

Centev.for Interattixr Coinpuler Graphics. Kcnssclaer Po/ytechnic Institute, Troy, N Y 12180-3590. U.S.A.

SUMMARY

A technical description of the algorithms employed in the modified quadtree mesh generator is .given. Although the basis of the mesh generator is the same as the original version developed by Yerry and Shephard,'.2 the actual algorithms on which it is built have been entirely changed for the purpose of ensuring the robustness of the technique. As demonstrated in the paper the algorithmic changes made do ensure the robustness of the approach, but introduce additional algorithmic difficulties, the solutions of which are also presented. In addition to examples showing the capability of the mesh generator, the linear computational growth rate of the mesh generator is demonstrated.

1. INTRODUCTION

Rcccntly there has been an increased interest in the development of automatic mesh generation algorithms capable of discretizing any geometry into a valid finite element mesh without user intervention. The key factor pushing this development is the need to develop finite element models for complex three-dimensional geometries. A number of algorithmic approaches for two- dimensional geometries have been with approaches for general three-dimensional geometries appearing more recently.'0p' The availability of a complete geometric represent- ation in terms of solid m ~ d e l l e r s ' ~ ~ ' ~ makes the use of these new approaches feasible.

This paper presents the algorithms recently developed to ensure the robustness and efficiency of thc two-dimensional modified quadtree mesh generator. The procedurcs used were specifically selected so that they are directly extendible to thrcc dimensions for use in the modified octree mesh generator. 'Opl'

Thc modified quadtree mesh generator is based on a spatial decomposition procedure that represents the domain of an object as a sct of disjoint squares, referred to as quadrants, that are stored in a hierarchic The basic tree structure used to define the modified quadtree IS

Gmilar to the original quadtree representations.'"~'' The object to be meshed is placed in a square universe that entirely encloses it. This square represents the root of the tree, and is then subdivided into four quadrants that are represented as the children of the root in the tree. The remainder of the tree is then defined in a recursive manner by subdividing the boundary and interior quadrants until all quadrants are at the desired level, as dictated by the geometry of the object and the mesh control information applied to the object. With the information stored for the boundary quadrants, i t is possible to determine which portions of the domain are in the quadrant. After the quadtree has been defined, all terminal quadrants arc checked to ensure that only one tree level difference exists

0029 5981 /87,'061043-36$18.00 {c) 1987 by John Wiley & Sons. Ltd.

Receiwd 25 April 1986 Revised 25 August 1986

Page 2: Robust, geometrically based, automatic two-dimensional mesh generation

1044 P. L. BAEHMANN li'TAL.

between them and their ncighbours so that there is not a large size difference between adjacent finite elements in the final mesh.

The mesh topology within the discretization defined by the modified quadtree is defined on a quadrant-by-quadrant basis using the information available in the tree to ensure that a proper mesh topology is created. The original modified quadtree mesh generator1T2 used only a fixed number of quadrant topologies. which allowed the mesh topology to be quickly created using a set of mesh templates. The mesh was finalized by first pulling the integer end-points of the discretized edge segments that represented the boundary to the actual boundary of the object and repositioning the nodes on the interior of the mesh to improve the shapes of the resulting elements.''2

A critical step of the process of defining the modified quadtree representation of an object IS the geometric representation of the boundary quadrants. The primary deficiency of the original modified quadtree mesh generator was the limited geometric representation of the boundary quadrants, namely the use of only a limited number of specific locations on the edges of the boundary quadrants to represent the geometry. Specifically, the cutting points that were allowed were the four corners for a vertex, and the four corners, the midpoint and quarter-points of each quadrant side for the intersection of an edge. Moreover, only one discretized edge segment and one vertex per quadrant were allowed. This imposed a limit on the complexity allowed for geometric features present in an individual quadrant, which was not acceptable since the goal of this type of mesh generator is to serve the ftinction of creating and controlling the finite element models in autornatcd, adaptive analysis procedures. l2 Although methods were found to raise these limits for two-dimensional geometries, the complexity of general three-dimensional geometries made them impractical. Another deficiency of the original modified quadtree mesh generator, which affected the geometric representation in the boundary quadrants, was the use of a different tree structure for each material region. Besides being inefficient for boundary quadrants, the multi-tree structure also caused problems in correctly representing the geometry along region boundaries.

The removal of the limitations on the topological complcxity of the gcometric entities can only bc accomplished by a more explicit representation of the topological entities that are present in an object within the modified quadtree structure. The changes which were implemented include the use o f a single tree for multi-region domains, and the explicit storage of vertex locations and actual edge intersections. These changes do not have an adverse effect on the regularized tree structure of the modified quadtree, which is presented in section 2. To incorporate these needed changes, the database was rewritten. The new database stores more information at the quadrant level but, more importantly, there are now links in the database that enable the finite elements to be traced back to the quadrants from which they were formed. The quadrants in turn can be traced back to the original geometric boundary information. These links are important for ongoing applications of the meshing routines, such as adaptive analysis and metal forming analysis where knowledge of the original geometry is essential to local remeshing.

The use of the real intersections does introduce two new complexities in the meshing process. The first is that the use of real intersections can introduce extremely small segments into the modified quadtree, which makes thc generation of elements of good shape on the quadrant level impossible. This problem is addressed by deleting small segments that would produce poorly shaped elements while maintaining the basic topological relationship and knowledge of the original geometric information. Section 3 presents the procedures dcveloped to carry out this process. The second difficulty is that the boundary quadrants are now of arbitrary geometric complexity, thus making the use of meshing templates impossiblc. This is addressed by the use of the quadrant meshing algorithm presented in section 4 which is now used in conjunction with quadrant mesh templates to define the mesh topology. The process of repositioning the finite element nodes to produce the best mesh for a given set of mesh control parameters has also been

Page 3: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1045

greatly improved over that used in the initial version and is also presented in section 4. A study of the computational growth rate for the modified quadtree mesh generator has shown that a mesh can be produced in a time proportional to the number of elements; this is discussed in section 5. Examples showing the complexity of the domains that can efficiently and accurately be meshed are given in section 6.

2. CREATION OF THE MODIFIED QUADTREE

The first step in the modified quadtree meshing process is to define a discrete representation of the domain in a form that can be easily converted to a valid finite element mesh. The spatially addressable hierarchical decomposition, referred to as the modified quadtree, meets those needs.

2.1. Mesh control

Since the final mesh is a function of the size of the quadrants of the tree, there has to be a means of controlling to what levels the different locations in the tree should be subdivided. This is accomplished through the use of mesh control parameters. The mesh control parameters consist of two parts: one is a spatial co-ordinate and the other is a number for defining tree levels. Mesh control parameters start at level 1 corresponding to the size of the largest quadrant; level 2 is 1/2 the size of level 1, level 3 is 1/4 the size of level 1, and so on. The size of a quadrant is found by

(1) 1: = 2(8+ 1-0

where 7 is the quadrant size, f i = 14 and [ is the tree level of the quadrant. Currently the maximum p is taken as 14, which gives a size of 16,384.0 for level 1, 8192.0

for level 2 and so on. The finest level allowed is machine and geometry dependent. The mesh generator uses the mesh size parameters associated with the vertices, boundary edges and regions of the object to initially discretize the object domain. The user has the option of interactively applying the parameters to the geometric entities or taking default parameter values; both options are checked to ensure that they will create a valid finite element mesh.

Since applying mesh control parameters only to the existing geometric entities may not be

Figure 1 . Mcsh control information for an object to be meshed

Page 4: Robust, geometrically based, automatic two-dimensional mesh generation

P. L. BAEHMANN ETAL 1046

sufficient to obtain the desired graded mesh, mesh control parameters may also be placed anywhere on or in the domain to be meshed. These are referred to as mesh refine points. Whereas the mesh size parameters applied to the geometric entities cause the quadtree to be subdivided to a specific level, a mesh refine point of level n causes the quadtree to be subdivided to a further n levels. Mesh refine points can be placed interactively either before the meshing process takes place to refine a general area or after the mesh has been created to refine specific elements. Refine points can also be obtained from an adaptive analysis program and used in remeshing.' Figure 1 shows the differcnt types of mesh control parameters applied to a domain. The numbers not within small polygons are the reline points.

2.2. Initial suhdioision of the quadtree

The first step in creating the modified quadtree representation of the domain is to subdivide the quadtree to the levels indicated by the mesh size parameters. The spatial information looked at in this process is from the vertices and the midpoints of boundary edges whose mesh control parameters for the edges are finer than those of their vertices. This step only creates the space in the data structure and does not store any geometric information. This step was added to facilitate the discretization of the boundary curves by initializing the quadtree at the correct level. This reduces the subdivisions needed when a location is first discretized coarse, and then subdivided later due to fincr mesh siLe parameters encountered from a later edge or vertcx that affects that location.

2.3. Discretization of boundary edges

To begin the discretization of the domain into the modified quadtree, the edges defining the boundary of the domain are placed in the tree in a discrete form. Starting at the first vertex, the intersection of the first edge with the appropriate intcrscction box is determined. The intersection box consists of all the sides of one, two or four quadrants where the quadrant size is defined by equation (1) using the appropriate mesh size parameters for that location. If the vertex lies at the corner of a quadrant, the intersection box is defined by the sides of the four quadrants that surround the vertex. If the vertex lies on the side of a quadrant, the intcrsection box is defined by the sides of the two quadrants sharing that side. The last case is when the vertex lies inside a quadrant. In this case. the intersection box is the sides of that quadrant.

Once the intersection box has been dcterrnined, thc edgc is traversed until thc first intersection with the intersection box is found. This intersection, plus the vertex, is the discrete information used to define the first edge segment. The next, and remaining edge segments are found in the same manner using the last intersection point as the starting point for the new segment. This process is continued until the end of the edge is reached.

Assuming a parametrized form of the edge, each co-ordinate component can be written as

where xk is a co-ordinate of a point on the edgc and f k ( ( ) is thc mapping function used to express that co-ordinate in terms of the edge parameter 4 .

The co-ordinates of the next intersection of an edge with the intersection box can be obtained as follows.

Find min (,, with (, > (,,, wch that

{,,=,f- '(xi), j = t or2 (24 where :,is the parametric co-ordinate of the ncxt intersection of the edge with the intersection box,

Page 5: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1047

5 , is the parametric co-ordinate of the last intersection of the edge with the intersection box, f-’ (Xi) is the inverse mapping from thejIh co-ordinate to the 5 parameter of a point on the edge and X j is the x or y co-ordinate of the side of the intersection box that the edge intersects.

With the edge parameter of the intersection known and one co-ordinate of the intersection known, the other is found by

Xi =fi(tn), i = 2 or 1 (2b)

where Xi is the y or x co-ordinate of the next intersection of the edge with the intersection box and fi is the mapping function of the ith co-ordinate.

Figure 2(a) represents an example of an edge with mesh control levels of 5 for the vertices and 3 for the rest of the edge. As the edge is being discretized an attempt is made to enforce one tree level difference between adjacent segments, which later aids in creating suitably graded finite element meshes.

After a discretized segment has been found, the geometric information associated with that segment, namely the segment end-point co-ordinates, edge number and region information, is inserted into the quadrant associated with that location of the domain. If a terminal quadrant already exists in the tree at this location and at the appropriate level, the new information is simply added to what is already there. If a terminal quadrant already exists at this location, but at a coarser level, then the edge associated with the information already at the coarser level has to be rediscretized at the new finer level, whereas if the tree already exists at this location but at a finer level, then the current information has to be redone at the finer level. Rediscretizing a portion of an edge is often avoided by the initial subdivision of the tree to the levels specified by the mesh size parameters of the vertices and midpoints of an edge as discussed in section 2.1. After the discretized edge segment is successfully entered into the tree, the status of the quadrant is changed from undefined to either a vertex or boundary terminal quadrant. Figure 3 shows the boundary of a domain which has been discretized.

Figure 4 contains the pseudo-code for the discretization of the boundary edges and Figure 5 shows the resulting terminal boundary quadrants after all the edges have been discretized.

The handling of the discretized edge information in the new version of the modified quadtree mesh generator has been greatly improved over the previous version. To begin with, the

Figure 2(a). Mesh size information applied to boundary edge and vertices

Figure 2(b). Correspondingly sized quadrants for mesh control information for edge and vertices

Page 6: Robust, geometrically based, automatic two-dimensional mesh generation

~. .

Figure 3. Discretization of boundary edges

PROCEDURE DISCRETIZATION OF BOUNDARY EDGES

BEGIN

FOR ALL EDGES DO BEGIN

EDGENUMBER = current edge; REGIONS = regions of EDGENUMBER; VXYl = vertex1 coordinates; VXYZ = vertex2 coordinates; LEVELl = mesh cont ro l parameter f o r V X Y l ; LEVELZ = mesh cont ro l parameter f o r VXY2;

LOCATE QUADRAWI corresponding t o VXYl and LEVELl; ADD V X Y l t o QUADRANT; LOCATE QUADRANT corresponding t o VXYZ and LEVELZ; ADD VXYZ t o QUADRANT;

XY1 = VXYl make VERTEX1 cur ren t po in t ; xY2 = vxY1;

WHILE(XY2 .ne. VXY2) DO B E G I N

LEVEL = mesh cont ro l parameter f o r cur ren t portion of edge; SIZLEV = P**(lmax+l - LEVEL); INTERSECT edge s t a r t i n g a t TXYl with quadrant of

s i z e SIZLEV t o f ind TXY2;

EXAMINE i n t e r sec t ion TXYZ and co r rec t fo r roundoff;

LOCATE QUADRANT i n quadtree corresponding t o segment TXY1-TXYZ;

IFCQUADRANT a t too coarse a leve l N ) THEN BEGIN SUBDIVIDE tree t o LEVEL; REDISCRETIZE previous information

LEVEL = N ; REDISCRETIZE cur ren t edge s t a r t i n g a t TXYl

ELSEIF(QUADRANT a t too f i n e a leve l N ) THEN BEGIN

END ;

ADD TXY1-TXYZ, REGIONS, and EDGENUMBER t o QUADRANT;

T x Y l = TxY2

END

END

END

Figure 4. Pseudo-code for discretmng and inserting edges into the quadtree

Page 7: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1049

Figure 5. Boundary quadrants of the modified quadtree

intersections between the boundary edges and the terminal quadrants of the tree are now expressed using real co-ordinates. This allows for an accurate geometric representation of the domain. This is in contrast to the old version of the mesh generator, where after the real co-ordinate intersection was found, the intersection was pulled to one of five allowable integer intersections along a quadrant edge.

Another big improvement in the program resulting from the use of real co-ordinate intersections is that now vertices are allowed to fall within a quadrant. In the past vertices were pulled to the nearest corner of the quadrants they were in.

With the implementation of the new database, the new version of the mesh generator can now handle any number of boundary edges or vertices that fall within a quadrant; therefore geometry of any level complexity can now be meshed. The old version of the mesh generator only allowed for one discretized boundary edge segment and one vertex per quadrant. When more than one boundary edge or vertex fell within a quadrant, the integer co-ordinates of the discretized edge segments had to be shifted around to fit the limited database.

Multiple material regions in a domain are also handled differently in the new database. The loops associated with the different regions in a quadrant are constructed by knowing which regions, if any, are on each side of the discretized boundary segments. The region number itself is now a pointer into the geometric database where the material properties are stored.

2.4. Interior domain

The next step in creating the modified quadtree is defining the quadrants that comprise the interior of the domain. One by one the rcgions in the boundary quadrants are examined. Since there is a direction associated with the boundary edges, it is possible to determine which part of the boundary quadrant is within the domain. If part of the right side of the quadrant is within the current region, then the quadtree is examined to find the adjacent right neighbours. If the neighbours are already defined as being interior or boundary quadrants of any region, this current rightward search stops and the next region in the current boundary quadrant is obtained. If the right neighbours are not defined, they are now defined as interior quadrants of the current region and the next right neighbours are found. This current rightward search continues until a boundary quadrant is reached which does not have part of the right quadrant side within the domain. The interior domain is completely filled in when all the boundary quadrants have been used as the starting point for a rightward search.

After the interior quadrants have been created they are all checked to see that only one tree level difference exists between adjacent quadrants. This is done to ensure that well-shaped finite

Page 8: Robust, geometrically based, automatic two-dimensional mesh generation

1050 P. L. HAEHMANN H A L .

elements are created in a graded mesh. Figure 6 shows all the terminal quadrants for the domain being meshed. Figure 7 contains the pseudo-code for creating the interior quadrants ofthe domain.

Figure 6. Boundary and interior quadrants of the modified quadtree

PROCEDURE DEFINING INTERIOR QUADRANTS OF DOMAIN

BEGIN

FOR ALL MATERIAL REGIONS IN ALL BOUNDARY QUADRANTS DO BEGIN

CURRENTQUAD = boundary quadrant; CURRENTREG = material region;

EXAMINE information in CURRENTQUAD;

IF(portion of r ight s ide of quadrant within CURRENTREG) THEN BEGIN LOCATE adjacent right NEIGHBOR quadrant; SET CURRENTQUAD = NEIGHBOR

END

WHILE(CURRENTQUAD is undefined) DO BEGIN CHANGE s tatus of CURRENTQUAD t o inter ior quadrant; LOCATE adjacent right NEIGHBOR quadrant; SET CURRENTQUAD = NEIGHBOR

END

END

FOR ALL BOUNDARY AND INTERIOR QUADRANTS DO BEGIN

QUADRANT = current quadrant; LEVEL = tree l eve l of QUADRANT;

FOR 4 SIDES OF QUADRANT DO BEGIN

NEIGHBORLEVEL = t ree level of neighbor;

IF(NEIGHB0RLEVEL - LEVEL . g t . 1) THEN REFINE QUADRANT t o NEIGHBORLEVEL - 1

END

END

END

Figure 7. Pseudo-code for defining interior quadrants of a domain

Page 9: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1051

2.5. Further subdivision of the tree due to mesh refine points

The last step in creating the modified quadtree is the additional refinement of the quadtree by the mesh refine points. At this point the terminal quadrants of the tree where the mesh refine points occur are subdivided down the number of levels specified by the mesh reline point parameters. Once again a check is made to ensure that only one tree level difference exists between adjacent quadrants. Figure 8 shows the terminal quadrants after the quadtree has been subdivided due to the mesh refine points.

3 . ALTERATIONS TO THE MODIFIED QUADTREE

After a modified quadtree representation of an object has been completed, two alterations are performed on the modified quadtrec representation to enable better shaped elements to be created from the terminal quadrants. The two alterations are referred to as intersection point collapsing and quadrant and boundary smoothing, which are discussed in subsections 3.1 and 3.2, respectively.

3.1. Intersection point cohpsing

The advantage of having no constraints enforced on whcrc an object boundary may intersect a quadrant side i s that it allows for an accurate representation of the geometry of the object. However, this accurate modified quadtree representation may lead to a poor finite element representation of an object. Object boundaries intersecting a quadrant close to a corner of the quadrant, and internal vertices lying close to a quadrant bide, may result in small segments being created, or in the definition of small portions of a quadrant. Small segments are undesirable because they typically cause elements with one very small interior angle, or distorted quadrilateral elements, to be formed in a quadrant. Likewise, a small defined portion of a quadrant may produce an element that is much smaller than its neighbouring elements, or it may make it difficult to create desired element types.

A technique was developed to remove the disproportionately small segments and to pull internal vertices that lie near a quadrant side to the quadrant side. I t should be noted that this technique only alters the modificd quadtrec rcprcscntation; the original geometric description of the object is left untouched. Likewise, this technique docs not alter the topological representation of the object in the tree. It should also be noted that the quadrant sides are restricted to remain horkontal

Figure 8. Boundary and inlerior quadrants of the modified quadtree dkr enforcing only one level difference between adjacenl quadrants

Page 10: Robust, geometrically based, automatic two-dimensional mesh generation

1052 P. L. BAEHMANN ETAL.

or vertical during the collapsing process. This restriction makes it easier to examine, remove and insert information into the modified quadtree structure.

The removal of small segments and small defined portions of quadrants is accomplished in three main steps. In the first step, internal vertices that are within a specific distance from a quadrant side are pulled to the quadrant side. In the second step, intersection points which are close to a corner of a quadrant are pulled to the corner of the quadrant. Finally, in the third step all remaining small boundary segments that lie on a quadrant side are rcmoved.

The specific distance that is used to define small segments, and to determine if an internal vertex lies close to a quadrant side, is twenty per cent of the quadrant side lcngth. Testing has shown that a tolerance percentage value below twenty per cent will not remove all the geometric difficulties that may lead to a poor finite element representation.12 The advantages of increasing the tolerance percentage value above the twenty per cent value would decrease sharply as geometric restrictions would prohibit removing these larger small segments.

3.1.1. Internal vertices pulled to the quadrant side. Thc internal vertices are removed by shifting their positions in the modified quadtree structure. while maintaining their original geometric positions. There are three ways in which the position of an internal vertex can be shifted in the modified quadtree representation: the internal vertex may be pulled to a neighbouring intersection point, the corner of a quadrant or the side of a quadrant. Figure 9 contains the pseudo-code for this procedure.

There are several restrictions that may prevent shifting the position of an internal vertex. The restrictions are to ensure that the topological description of an object is not destroyed. For example, an internal vertex cannot be pulled to a neighbouring intersection point unless the neighbouring intcrsection point and the internal vertex are directly connected to one another by a discretized edge segment. If the intersection point and the internal vertex are not directly connected to one another, a portion of the boundary of the object will collapse upon itself. Likewise, because pulling an internal vertex to an intersection point requires the removal of the description of the interscction point, the neighbouring intersection point cannot be a vertex. The removal of the description of a vertex requires thc removal of part of the topological description of the object (an edge), which is not allowed.

In a similar manner, an internal vertex cannot be pulled to a corner of a quadrant if an intersection point lies at the corner, and an internal vertex cannot be pulled to a quadrant side if the quadrant side is a boundary segment. Both of these cases would result in the collapsing of the object’s boundary upon itself.

Two last restrictions apply to all three cases. First, the segments belonging to the internal vertex are not allowed to collapse upon themselves when the position of the internal vertex is shifted. Figure 10 illustrates how this may occur if it is not checked for. Secondly, no portion of the object’s boundary may lie between an internal vertex and the place where the internal vertex is being pulled to. These last two restrictions further ensure that the boundary of the object will not collapse upon itself.

3.1.2 Boundary irzterscctioiz points pulled to the quudrunt corners. In the second main step used to remove small segments, intersection points are pulled to neighbouring corners of the quadrant ( if they are close to one another). This step will remove the small interior segments that may exist between an intersection point and a corner of a quadrant, and it will remove the boundary segments that ‘slice-ofY a small portion of a quadrant. Figure 11 contains the pseudo-code for this procedure.

Page 11: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION

PROCEDURE REMOVE INTERNAL VERTICES

BEGIN

FOR ALL TERMINAL BOUNDARY QUADRANTS DO BEGIN

FOR ALL INTERNAL VERTICES DO

IF(1NTERNAL VERTEX is ' c l o s e ' t o an an ad jacent non-vertex boundary node) THEN BEGIN

IF(col1aps ing t h e INTERNAL VERTEX t o t h e boundary node does n o t r e s u l t i n t h e c o l l a p s i n g of t h e segments a s s o c i a t e d wi th t h e INTERNAL VERTEX upon each o t h e r ) THEN BEGIN

PULL t h e INTERNAL VERTEX t o t h e ad jacent boundary node; UPDATE database

END

ELSE IF(1NTERNAL VERTEX is ' c l o s e ' t o a corner of t h e quadrant , and t h e corner i s n o t a l r e a d y a boundary node) THEN BEGIN

IF(col1aps ing t h e INTERNAL VERTEX to t h e corner of t h e quadrant does not c o l l a p s e any boundary segments a s s o c i a t e d w i t h t h e INTERNAL VERTEX upon each o t h e r ) THEN BEGIN

PULL t h e INTERNAL VERTEX t o t h e corner of t h e quadrant ; UPDATE database

END

ELSE IF(1NTERNAL VERTEX ' c l o s e ' to a quadrant s i d e , and t h e quadrant s i d e i s not a boundary segment) THEN BEGIN

IF(col1aps ing t o a quadrant s i d e does not c o l l a p s e any boundary segments a s s o c i a t e d wi th t h e v e r t e x upon each o t h e r , and i f t h e segments a s s o c i a t e d wi th t h e v e r t e x will not i n t e r s e c t any p o r t i o n of t h e e x i s t i n g boundary) THEN BEGIN

PULL t h e INTERNAL VERTEX t o t h e quadrant s i d e ; UPDATE database

END

END

END

END

END

Figure 9. Pseudo-code for moving vertices that are just off the quadrant boundary

1053

Figure lqa) . Object domain before creation of the modified quadtree

Page 12: Robust, geometrically based, automatic two-dimensional mesh generation

Figure lqb). Modified quadtree representation of the object domain before collapsing of disproportionately small segments

Figure lO(c). Modified quadtree representation of the object domain after collapsing. This is an example ofan invalid case, where da and dc are coincident. The modified quadtree mesh generator checks to ensure that this cannot happen

PROCEDURE C O L L A P S I N G I N T E R S E C T I O N P O I N T S T O A CORNER O F A QUADRANT

B E G I N

FOR ALL TERMINAL BOUNDARY QUADRANTS DO B E G I N

QUAD = terminal boundary quadrant

FOR A L L THE SEGMENTS I N QUAD DO B E G I N

NSEG = segment

FOR BOTH E N D P O I N T S OF NSEG DO B E G I N

IF(endpoint is close t o a corner of t h e quadrant) THEN B E G I N IF(another i n t e r sec t ion point is a t t he corner) THEN B E G I N

IF(endpoint i s d i r e c t l y connected t o the in te rsec t ion poin t ) THEN B E G I N

IF(endpoint and in t e r sec t ion point a r e not both ve r t i ce s ) THEN B E G I N

i t s e l f ) THEN B E G I N P U L L endpoint t o the corner; UPDATE t h e database

IF(boundary of t he objec t does not col lapse upon

END END

END

IFCboundary of the object does not co l lapse upon E L S E IF(no in t e r sec t ion point a t t he corner) THEN B E G I N

i t s e l f ) THEN B E G I N P U L L endpoint t o the corner; UPDATE t he database

END END

END

EhiD

END

END

END

Figure 11. Pseudo-code for collapsing boundary edge intersections to a corner of a quadrant

Page 13: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATTC TWO-DIMENSIONAL MESH GENERATION 1055

Once again, several restrictions apply to this procedure to prevent destroying part of the original topological description of the object. First, if another intersection point lies at the corner that is not directly connected to the intersection point being collapsed, the intersection point cannot be collapsed. This restriction prevents the boundary of the object from collapsing upon itself. Secondly, if the intersection point being collapsed is a vertex, and if there is another vertex lying at the corner of the quadrant, then the intersection point cannot be collapsed. To collapse in this case would require the removal of an edge, part of the original geometric description of the object.

If an intersection point lies at the corner of the quadrant, and this intersection point is directly connected to the intersection point being collapsed, then the intersection point can normally be collapsed to the corner, except in two cases. First, as stated before, the two intersection points cannot both be vertices. Secondly, this collapsing is not performed if it may cause an internal region to be collapsed out of the object. This would destroy the original topological description of the object. Finally, one overall restriction is that no intersection points or boundary segments may lie between an intersection point and the corner to which it is collapsing.

3.1.3. Small boundury segments on the quadrant side removed. The last main step in removing small segments involves removing small segments that lie on a quadrant side. These small segments are removed by collapsing one end-point of the segment into the other end-point of the segment. Figure 12 contains the pseudo-code for this procedure. Several restrictions apply to this step. First, if either end-point of the segment is at a corner of the quadrant, then this segment cannot be removed. The reason for this restriction is that this is the type of segment that would normally be removed in the second main step. Since it was not removed, removing this segment must have violated one of the restrictions of that step.

The second restriction is that the segment must be either vertical or horizontal. The reason for this second restriction is the way the segments are removed in this collapsing step. The segment removal process in this step may be envisioned as the pulling of one end-point of the segment to the

PROCEDURE REMOVING SMALL BOUNDARY SEGMENTS

B E G I N

FOR A L L TERMINAL BOUNDARY QUADRANTS DO B E G I N

QUAD = terminal boundary quadrant

FOR ALL THE SEGMENTS I N QUAD DO B E G I N

NSEG = segment

I F C N S E G is 'small') THEN B E G I N I F ( N S E G is vertical or horizontal) THEN B E G I N

IF(neither endpoint of NSEG is a corner) THEN B E G I N IF(both endpoints are not vertices) THEN B E G I N

REMOVE NSEG; UPDATE database

END END

END END

END

END

END

Figure 12. Pseudo-code for removing disproportionately small boundary segments

Page 14: Robust, geometrically based, automatic two-dimensional mesh generation

1056 P. L. BAEHMANN ETAL.

other end-point of the segment. If the two end-points of the segment lie on different sides of a quadrant (i.e. the segment is not vertical or horizontal), then removing the segment in this step will result in a side of the quadrant becoming non-vertical or non-horizontal. Finally, because the description of one of the end-points of the segment must be deleted, the end-points of the segment cannot both be vertices, for this would require the removal of an edge.

Figure 13 illustrates the results of the collapsing procedures on the modified quadtree representation that was shown in Figure 8.

3.2. Quadrant and boundary smoothing

The finite element representation of an object is created by meshing the quadrants on an individual basis. Because the element selection in a quadrant is based on the geometry of the quadrant, the shapes of the elements created in a quadrant will be directly dependent on the shape of the quadrant. Therefore, to enable better shaped elements to be created in an object, the shapes

Figure 13(a). Modified quadtree representation of an object after collapsing

Figure 13(b). Enlargement of an area with disproportionately small segments before collapsing

Page 15: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1057

Figure 13(c). Enlargement of the same area after collapsing

of the quadrants are improved in a smoothing process. This smoothing process is performed as two separate operations in an hierarchical manner.

One smoothing operation is referred to as interior smoothing. In interior smoothing, the nodes in the object are repositioned to improve the shapes of the quadrants. The repositioning of the interior nodes is accomplished using a weighted form of the Laplacian smoothing method.z3 In the weighted form of Laplacian smoothing, a node is pulled to the centroid of the nodes that are in the quadrants associated with the node; however, the nodes that are directly connected to the node are included twice in obtaining the centroid. This weighted form can be expressed as

(3)

where T is the new location of the node, P, are the co-ordinates of node i, which is in the same quadrant as the node being smoothed but not directly connected, Q j are the co-ordinates of node j , which is in the same quadrant as the node being smoothed and directly connected, N is the number of nodes in the associated quadrants not directly connected to the node being smoothed and M is the number of nodes in the associated quadrants directly connected to the node being smoothed.

Experimentation has indicated that acceptable convergence is obtained after four iterations of this interior smoothing pro~ess.’~

The other smoothing operation is referred to as boundary smoothing. Boundary smoothing involves adjusting the position of the nodes along the boundary of an object in order that a better representation of the object’s boundary may be ~btained.’~ The desired placement of the nodes along an edge is obtained by minimizing the weighted sum of three criteria: optimizing the shapes of the. quadrants (of elements as in section 4) along the edge, proper modelling of the geometry of the object, and proper gradation of the tree or mesh along the boundary. This weighted sum is expressed as

P = uu + v v+ w w (4)

Page 16: Robust, geometrically based, automatic two-dimensional mesh generation

1058 P. L. BAEHMANN ETAL

where u + u + w = l

and P is the overall criterion value, U is the element/quadrant shape optimization criterion, I/ is the geometry modelling optimization criterion, W is the grading representation criterion, u is the element shape optimization weighting fraction, 2: is the geometry modelling optimization weighting fraction and w is the grading representation weighting fraction.

The shape optimization criterion for a node being smoothed is currently the centroid of the nodes to which the node being smoothed is connected. The shape optimization criterion is defined to be the distance between the current location of the node being smoothed, and this centroid:

where U is the element shape optimization criteria, S are the co-ordinates of the node search point and X are the co-ordinates of the node being smoothed.

The geometry modelling criterion is used to minimize the residual area between the actual boundary of the object and the discretized boundary (this residual area occurs from using straight- sided elements or quadrants to model curved edge boundaries). The geometry modelling criterion is minimized by minimizing the distance that a node lies from a line connecting its two neighbouring nodes:

where I/ is the geometry modelling optimization criterion, D is the distance that the node lies from the line connecting its two neighbouring nodes and e is a small value added to avoid division by zero.

The grading optimization criterion is obtained from a least squares fit of the nodes to a best exponential grading function. The exponential equation to be found is

where L is the difference in parameter values between two consecutive boundary nodes, n is the number of the discretized boundary segment bounded by the two nodes, and A, B and C are constants to be solved for.

The constants A, B and C depend on the relative distribution of the nodes on the edge in their original conf igu ra t i~n .~~ In this equation, A controls the relative magnitude of the function. The value of B determines whether the centre of the curve is a minimum ( B > 0), a maximum ( B < 0) or if the curve is a horizontal line (B = 0). The value of C controls the centre of the curve. The specific procedure used to solve for the constants is presented in Reference 24.

The grading optimization criterion is then defined to be the distance between the current location of the node being smoothed and its corresponding graded position:

W = ( F - H (8)

where W is the grading representation criterion, F are the co-ordinates of a possible nodal position and H are the co-ordinates of the optimum grading location based on being on the exponential curve (equation (7)).

In the smoothing hierarchy, the boundary smoothing is performed first, and is then followed by the interior smoothing. Experimentation has indicated that two repetitions of this combined smoothing are sufficient to provide acceptable c o n v c r g e n ~ e . ~ ~ Figure 14 illustrates the results of the combined smoothing on the modified quadtree structure shown in Figure 13.

Page 17: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1059

Figure 14. Modified quadtree representation of an object after quadrant smoothing

4. FTNITE ELEMENT MESH TOPOLOGV FROM THE MODIFIED QUADTREE

Upon completion of the alterations to the modified quadtree representation of an object, the finite element mesh of the object is created. Algorithms have been developed to generate three different mesh topologies: an all-triangular element mesh, a mixed-mode element mesh (which consists of both quadrilateral and triangular elements) and an all-quadrilateral elemcnt mesh.

The mesh topology is generated on a quadrant-by-quadrant basis by first constructing the simply connected loops defining the ‘chunks’ of material regions present in the quadrant. Each loop, referred to as a quad-loop, thus consists of portions of the quadrant boundary and the discretized boundary segments within the quadrant that separate material regions.

There are two types of terminal quadrants that must be meshed: boundary quadrants and internal quadrants. Because boundary quadrants can assume an infinite number of shapes and contain multiple quad-loops, it is not possible to use templates to mesh boundary quadrants into elements. Therefore, specific procedures were developed to mesh the boundary quadrants; these are discussed below. On the other hand, there is only one quad-loop and sixteen possible shapes that an interior quadrant can assume (depending on the locations of any mid-side nodes). Therefore, templates may be used to mesh the interior quadrants. Furthermore, by ‘mapping’ interior quadrants that have the same number of mid-side nodes into standard shapes, the number of templates required to mesh the interior quadrants can be reduced to six. Figures 15 and 16 illustrate the templates used for the triangular element mesh and the mixed-mode element mesh, respectively. It should be noted that, in the triangular element mesh, if there are two possible choices for the selection of a diagonal, then the diagonal which avoids the worst shaped element is chosen.

In order to mesh the boundary quadrants, a numerical measure of an element’s shape is required in order to be able to compare elements. For a triangular element, the numerical measure is the ratio of the sum of the squared lengths of the side of the triangle to the area of the triangle. This measure is a minimum for an equilateral triangle, and as the element distorts from an equilateral shape, this measure increases sharply. For a quadrilateral element, the internal angles are used as the numerical measure, with 90” being the optimum angle. Furthermore, any quadrilateral element that has an internal angle that is smaller than 45”, of greater than 135” is considered unacceptable.

4.1. Triangular element mesh

A triangular element mesh is created in a boundary quadrant by first locating the node with the largest interior angle in the quad-loop. Next, two triangles can typically be associated with this node, as shown in Figure 17. The best triangle of these two is then selected to form an element. If only one triangle could be associated with the node, then that triangle is used to form an element.

Page 18: Robust, geometrically based, automatic two-dimensional mesh generation

1060 P. L. BAEHMANN E T A .

Figure 15. Triangular element templates for the interior quadrants

Figure 16. Mixed-mode element templates for the interior quadrants

Figure 17. The two possible triangles that may be associated with a node

Figure 18. Finite elements created from the modified quadtree representation of an object

Page 19: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1061

PROCEDURE TRIANGULAR ELEMENT MESH

B E G I N

FOR A L L MATERIAL R E G I O N S I N A L L TERMINAL QUADRANTS DO B E G I N

QUAD = terminal quadrant; QUAD-LOOP = loop of edges i n QUAD for a region;

I F ( Q U A D is an interior quadrant) THEN B E G I N MESH QUAD with the appropriate template

E L S E I F ( Q U A D is a boundary quadrant) THEN B E G I N DETERMINE the possible nodal connectivities; I F ( Q U A D - L O O P contains three nodes) THEN B E G I N

E L S E IF(QUAD-LOOP contains four nodes) THEN B E G I N CREATE triangular element

F I N D the best pair of triangles; CREATE two triangular elements

F I N D the node with che largest internal angle; F I N D the two triangles that may be associated with the node; IF(two triangles are found) THEN B E G I N

E L S E I F ( Q U A D - L O O P contains more than four nodes) THEN B E G I N

DETERMINE which is the best triangle; CREATE triangular element

CREATE element E L S E IF(one triangle found) THEN B E G I N

END

F I N D node with the next largest internal angle; E L S E IF(no triangles found) THEN B E G I N

REPEAT phcess END ; IF(more than four nodes left) THEN B E G I N

E L S E IF(four nodes left) THEN B E G I N

END

R E P E A T process

MESH Q U A D - M O P with the meshing procedure for a four node quadrant

END

END

END

Figure 19. Pseudo-code for the all-triangular element mesh

Likewise, if no elements could be associated with the node, then the node with the next largest interior angle is examined.

Every time an element is removed in the above process, a node becomes unavailable to form any more elements in that quad-loop. The above process is then repeated with the node with the largest interior angle until there are only four nodes left available to form elements in the quad-loop. When there are only four nodes left (or when a quad-loop originally has only four nodes), there only exist two combinations of two triangular elements in the qupd-loop. The combination that avoids the worst triangular element is selected to finish meshing the quad-loop.

The triangular element mesh of the object shown in Figure 14 is depicted in Figure 18. Likewise, the pseudo-code for the triangular element mesh algorithm is given in Figure 19.

4.2. Mixed-mode element mesh

Two different methods are used to create a mixed-mode element mesh in a boundary quadrant. If a quad-loop has six or fewer nodes, the individual element combinations that may exist in the

Page 20: Robust, geometrically based, automatic two-dimensional mesh generation

1062 P. L. BAEHMANN ETAL.

quad-loop are examined, with the best combination being selected to mesh the quad-loop. If the quad-loop has more than six nodes, individual quadrilateral elements are removed from thequad- loop until there are only four or five nodes left available in the quad-loop to form elements. At that point then, the first meshing procedure can be used to finish meshing the quad-loop. The pseudo- code for the mixed-mode element mesh is contained in Figure 20.

PROCEDURE MIXED-MODE ELEMENT MESH

BEGIN

FOR ALL MATERIAL REGIONS IN ALL TERMINAL QUADRANTS DO BEGIN

QUAD = terminal quadrant; QUAD-LOOP = loop of edges QUAD for a region;

IF(QUAD is an interior quadrant) THEN BEGIN IF(QUAD-LOOP contains an odd number of nodes) THEN BEGIN CHECK appropriate neighboring quadrants; IF(neighboring quadrant has an odd number of nodes, and has

not been meshed yet) THEN BEGIN ADD appropriate mid-side and/or interior nodes to QUAD

END ; MESH QUAD with the appropriate template

ELSE IF(QUAD-LOOP contains an even number of nodes) THEN BEGIN MESH QUAD with the appropriate template

END ELSE IF(QUAD is a boundary quadrant) THEN BEGIN DETERMINE possible nodal connectivities; IF(QtiAD-LOGP contains three nodes) THEN BEGIN

ELSE IF(QUAD-LOOP contains four nodes) THEN BEGIN

ELSE IF(QUAD-LOOP contains five nodes) THEN BEGIN

ELSE IF(QUAD-LOOP contains six nodes) THEN BEGIN

ELSE IF(QUAD-LOOP contains more than six nodes) THEN BEGIN

END

CREATE a triangular element

CALL MESH.4NODES

CALL MESH.5NODES

CALL MESH.6NODES

CALL MESH.XNODES)

END

END

END

Figure 2qa). Pseudo-code for the mixed-mode element mesh

PROCEDURE MESH.4NODES

BEGIN

QUAD-LOOP = loop of edges in quadrant for a region;

EXAMINE QUAD-LOOP to see if it is an acceptable quadrilateral element;

IF(QUAD-LOOP is an acceptable quadrilateral element) THEN BEGIN CREATE quadrilateral element; CREATE two triangular elements

END

Page 21: Robust, geometrically based, automatic two-dimensional mesh generation

QUAD-LOOP = loop of edges in quadrant for a region;

BEGIN

EXAMINE the five one quadrilateral - one triangle combinations; DETERMINE which is the best one;

IF(best combination is acceptable) THEN BEGIN CREATE quadrilateral and triangular element

ELSE IF(best combination not acceptable) THEN BEGIN CREATE three triangular elements in the QUAD-LOOP using the triangular element mesh algorithm

END

END

Figure 2qc). Pseudo-code for meshing a five-noded material region loop in a boundary quadrant

PROCEDURE MESH.6NODES

BEGIN

QUAD-LOOP = loop of edges in a quadrant for a region;

EXAMINE the three combinations of two quadrilateral elements;

FIND the best combination;

IF(combination is acceptable) THEN BEGIN

ELSE IF(no acceptable quadrilateral elements) THEN BEGIN CREATE two quadrilateral elements

EXAMINE the three combinations of one quadrilateral - two triangles; FIND the best combination; IF(combination is acceptable) THEN BEGIN CREATE one quadrilateral and two triangular elements

ELSE IF(no acceptable combinations) THEN BEGIN CREATE an all triangular element mesh in the QUAD-LOOP us ing the triangular element mesh algorithm

END END

END

Figure 20(d). Pseudo-code for meshing a six-noded material region loop in a boundary quadrant

PROCEDURE MESH.XNODES

BEGIN

FIND node with largest internal angle;

FIND the two quadrilaterals that can be associated with the node;

IF(two quadrilaterals found) THEN BEGIN DETERMINE which quadrilateral is the best one; CREATE a quadrilateral element using the best quadrilateral

CREATE quadrilateral element

FIND the node with the next largest angle; REPEAT

ELSE IF(one quadrilateral found) THEN BEGIN

ELSE IF(no quadrilaterals are found) THEN BEGIN

END

IF(more than five nodes remain) THEN BEGIN

ELSE IF(five nodes remain) THEN BEGIN

ELSE IF(four nodes remain) THEN BEGIN

END

REPEAT

CALL MESH.5NODES

CALL MESH.4NODES

END

Figure 2qe). Pseudo-code for meshing a material region loop in a boundary quadrant that contains more than six nodes

Page 22: Robust, geometrically based, automatic two-dimensional mesh generation

1064 P. L. BAEHMANN ETAL.

Table 1. Possible element combinations in a mixed-mode element mesh

Number of nodes Quadrilateral Triangular in quadrant elements elements

3 4

5

6

etc.

Table I lists the possible element combinations that can exist in a quad-loop. The comparison of element combinations in a quad-loop is complicated by the fact that both quadrilateral and triangular elements may exist in a combination. In order to compare combinations that contain both triangular and quadrilateral elements, a numerical measure of a triangular-quadrilateral element combination is required. The numerical measure of the combination is obtained from the sum of the parametrized shape measures of each element.

The parametrized shape measure for a triangular element is obtained by dividing the ratio of the shape measure of the element by the shape measure of an equilateral triangle. A parameter value of 1 is the best value, with this parameter value then increasing in value as the shape of the element distorts from an equilateral shape. The parameter value for a quadrilateral element is obtained by doing a linear scaling of the worst of the four internal angles in the element. Once again, a parameter value of 1 is the optimum value, and in this case corresponds to a 90" internal angle. A parameter value of 5 is the worst parameter value and corresponds to a 45" or a 135" angle.

When comparing combinations, the combination with the lowest overall parameter value is considered to be the best combination. It should be noted that the influence of the quadrilateral element on the overall parameter value can be changed. This is done by adjusting the scaling range that is used to parametrize the quadrilateral element. To make the influence of the quadrilateral element greater, the scaling range should be increased. Likewise, reducing the scaling range will diminish the influence of the quadrilateral element on the overall parameter value.

When a quad-loop has more than six nodes, it becomes difficult to examine all of the different element combinations that may exist in the quad-loop. Therefore, a procedure similar to the one used in the triangular element mesh is used to mesh these quad-loops. Quadrilateral elements are 'sliced-off the quad-loop until there are only four or five nodes left in the quad-loop (two nodes become unavailable to form any more elements in a quad-loop when a quadrilateral element is removed). At this point, then, the respective meshing procedure for a quad-loop that initially contained that many nodes is used to finish meshing the quad-loop.

When the mixed-mode element mesh has been created, element merging techniques are used to reduce the number of triangular elements in the overall mesh. There are three ways in which triangular elements may be removed from the mesh. First, two adjoining triangular elements can be merged to form a quadrilateral element. Secondly, if a triangular element lies on the boundary of the object, it may be possible to introduce nodes onto this boundary and merge the triangular element into a neighbouring quadrilateral element to form several quadrilateral elements. This

Page 23: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1065

Figure 21. Mixed-mode finite element mesh before element merging

Figure 22. Triangular element merged with quadrilateral element to form all quadrilaterals

Figure 23(a). Mesh with two adjoining triangular elements before element collapsing

merging technique is illustrated in Figures 21 and 22. Finally, it may be possible to remove two adjoining triangular elements by ‘collapsing’ the two elements out of the mesh as illustrated in Figure 23. Figure 24 shows a mixed-mode element mesh of an object.

4.3. Quadrilateral dement mesh

The method used to create the all-quadrilateral element mesh is to divide all the quad-loops in the modified quadtree structure into three, four and five-sided polygons. The polygons can then be subdivided into quadrilateral elements as illustrated in Figure 25. The pseudo-code for this procedure is contained in Figure 26.

The three and four-sided polygons are created in the quad-loops using the techniques that are used in the mixed-mode mesh. The five-sided polygons may result from a five-node quad-loop, or

Page 24: Robust, geometrically based, automatic two-dimensional mesh generation

1066 P. L. BAEHMANN ETAL.

Figure 23(b). Mesh after triangular element 'collapsing'

Figure 24. Mixed-mode finite element mesh

Figure 25. Possible element combinations in an all-quadrilateral element mesh

they may result from merging a three-sided polygon into a four-sided polygon. Typically, better shaped quadrilateral elements will result from subdividing the five-sided polygon than from subdividing the three and four-sided polygons separately. The three-sided polygon is only merged into a four-sided polygon if the resulting five-sided polygon is convex, and if all five internal angles in the polygon are within the 45" to 135" range. Figure 27 shows an all-quadrilateral element mesh of an object.

4.4. Mesh ,finalization

In order to improve the gradation and shapes of the elements in a mesh, a smoothing procedure is performed on the elements in the mesh. As with quadrant smoothing, two different smoothing operators are used in an hierarchical manner. The first smoothing operation is the repositioning of

Page 25: Robust, geometrically based, automatic two-dimensional mesh generation

PROCEDURE CREATING ALL QUADRILATERAL ELEMENT MESH

BEGIN

FOR ALL MATERIAL REGIONS IN ALL TERMINAL QUADRANTS DO BEGIN

QUAD = terminal quadrant; QUAD-LOOP = loop of edges in QUAD for a region;

IF(QUAD is an interior quadrant) THEN BEGIN DIVIDE QUAD-LOOP into three and four-sided polygons using mixed-mode element mesh templates

IF(QUAD-LOOP does not have five nodes) THEN BEGIN ELSE IF(QUAD is a boundary quadrant) THEN BEGIN

DIVIDE QUAD-LOOP into three and four-sided polygons using the mixed-mode element mesh algorithm for boundary quadrants

EXAMINE QUAD-LOOP to see if it forms an acceptable five-sided polygon; IF(QUAD-LOOP forms an acceptable five-sided polygon) THEN BEGIN

ELSE IF(QUAD-LOOP is not an acceptable five-sided polygon) THEN BEGIN

END

ELSE IF(QUAD-LOOP has five nodes) THEN BEGIN

CREATE five-sided polygon

CALL MESH.SNODE

END END

END ;

EXAMINE three-sided polygons to see if they can be merged into a four-sided polygon to form an acceptable five-sided polygon;

IF(form an acceptable five-sided polygon) THEN BEGIN

END ;

EXAMINE three-sided polygons to see if they can be merged into a three-sided polygon to form an acceptable four-sided polygon;

IF(form an acceptable four-sided polygon) THEN BEGIN

CREATE five-sided polygon

CREATE four-sided polygon END;

SUBDIVIDE all of the sides of the polygons;

ADD an interior node into each polygon;

CREATE the node and segment lists for each polygon;

CREATE elements in each polygon;

END

Figure 26. Pseudo-code for the all-quadrilateral element mesh

Figure 27. All-quadrilateral finite element mesh

Page 26: Robust, geometrically based, automatic two-dimensional mesh generation

1068 P. L. BAEHMANN ETAL.

Figure 28. Triangular finite element mesh of an object

the internal nodes in the object. The second smoothing operation involves adjusting the position of the nodes along the boundary of the object in order to improve the representation of the boundaries in the finite element mesh.

The repositioning of the internal nodes in the object is accomplished by using the Laplacian smoothing operator.23 In Laplacian smoothing, a node is placed at the position given by the centroid of the nodes that the node is connected to. Experimentation has indicated that acceptable convergence is obtained after four iterations of this interior smoothing process.23

The repositioning of the nodes along the boundary of the object is accomplished using the boundary smoothing technique outlined in Section 3.2. In the overall smoothing operation, the boundary smoothing is performed first, followed by the interior smoothing. Experimentation has indicated that two repetitions of this combined smoothing is sufficient to provide acceptable c o n ~ e r g e n c e . ~ ~ Figure 28 shows the final mesh after it has been smoothed.

5. COMPUTATIONAL GROWTH RATES

The modified quadtree mesh generator has been studied in terms of computational growth rate. By studying the individual parts of the meshing process, it is easy to see that as the mesh is refined, the computation time required is linearly proportional to the increase in the number of elements. For example, the first step in discretizing the domain of the object is to discretize the boundary edges of the object and place them into the tree at the appropriate level. A t level rn there are n discretized segments, but at level m + 1 there will be 2n discretized segments, which is a linear increase. After the discretized segments are in the tree, the interior of the domain is filled in. Since a quadrant can only have up to four sides, there are always four directions to search no matter what level the tree happens to be at. Refining the quadtree results in more terminal quadrants, but still only local searching is done on four sides. In creating elements from the quadrants in the modified quadtree structure, the same thing occurs; a quadrant can only have up to four sides and four corners. Just because a quadrant is very fine, does not mean that it has more discretized edge segments; on the contrary, it probably has fewer edge segments, since there are more quadrants to separate boundary edges. The smoothing process performed on the quadrants and again on the elements is also a local procedure. Only the nodes from the quadrant’s or element’s adjacent neighbours are examined, so it does not matter how many other quadrants or elements there are; the computation time increases linearly as the mesh is made finer.

The first example is for a series of uniform meshes of the type shown in Figure 29. The resulting plot of computation time versus elements is given in Figure 30. The same object was also meshed

Page 27: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1069

Figure 30. Time

Figure 29. Uniform mesh with 287 elements

I

1 I I I -7 o p 1000 2000 3000 4000 5000 0

NUMBER OF ELEMENTS taken lo mesh domain versus the number ofelements shows a linear computatlonal growth

uniform and graded interior meshcs shown in Figures 29 and 31 rate for the

with a graded interior, as shown in Figure 31. The computation lime for this type of mesh also increases linearly as the number of elements increases. The last exarnplc of the linear computational growth rate was done using meshes strongly graded along the boundaries, as in Figure 32. The data are plotted in Figure 33. The data points of Figure 33 were obtained by altering the mesh control parameters along the boundaries to increase the number of boundary elements, yet none of these points show a strong deviation from an average linear growth rate.

Page 28: Robust, geometrically based, automatic two-dimensional mesh generation

1070 P. L. BAEHMANN ETAL.

Figure 31. Graded interior mesh with 135 elements

Figure 32. Graded mesh along boundaries with 724 elements

6. EXAMPLES

The modified quadtree mesh generator has been greatly improved over the previous version. The meshing algorithms have been made robust, and along with the data structure, more efficient. To demonstrate the capabilities of the mesh generator, the mesh in Figure 34 (a) is presented. There are

Page 29: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1071

IS0 - tA n

2 z 0

(I) 100- I

0 CUD BOY MESHES

0 1000 1000 3000 NUMBER OF ELEMENTS

I I

4000 5000

Figure 33. Time taken to mesh domain versus the number of elements shows a linear computational growth rate for meshes strongly graded along the boundary, as in Figure 32

Figure 34(a). Mesh of complex geometry using the new version of the modified quadtree mesh generator

two main areas of the mesh which look like they should have caused trouble for the mesh generator. One of these areas is comprised of three very closely spaced holes which caused two very narrow areas of material to be meshed. An enlargement of this area is shown in Figure 34 (b), where it can be seen the mesh generator had no trouble at all creating a valid finite element mesh in this area. The other likely candidate to have caused havoc for the mesh generator is the very narrow area at the top of the object. Figure 34 (c) shows the enlarged area and it can be seen that mesh generator created a valid finite element mesh for the complex geometry.

Page 30: Robust, geometrically based, automatic two-dimensional mesh generation

1072 P. L. BAEHMANN ETAL.

Figure 34(b). Enlargement of the narrow area of mesh between two of the three holes

Figure 34(c). Enlargement of the mesh at the top of the object

The next example illustrates the capability of the modified quadtree mesh generator to mesh a domain that consists of multiple material regions. The geometry in Figure 35 (a) consists of seven regions, five of which are defined as material regions and two as holes. Multiple regions present no added difficulty to the mesh generator since each geometric edge in the domain is associated with the material regions that bound it. The region information is passed directly to the modified quadtree mesh generator through the use of geometric communication operatorsz5 and is applied first to the discrete boundary edges and then passed along to the finite elements.

The next two examples demonstrate the improvements in the new version of the modified quadtree mesh generator. The mesh generator uses real co-ordinates for the intersection between the boundary edges and the quadrants. This ensures accurate geometric information and allows narrow material regions to be meshed. Figure 36 (a) shows the mesh of an object, with a somewhat narrow region, and Figure 36(b) shows the modified quadtree structure of the object. In the modified quadtree representation in the old version, shown in Figure 36 (c), intersection points are pulled to one of five allowable integer points on the quadrant side. In this model, points from two different edges were pulled to the same location and the mesh generator could go no further.

The final example demonstrates the improved finite element meshes generated by the new

Page 31: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1073

Figure 35(a). Domain of seven regions, five of which are defined as material regions

Figure 35(b). Mesh of the domain with five material regions and two holes

Page 32: Robust, geometrically based, automatic two-dimensional mesh generation

1074 P. L. BAEHMANN ETAL.

Figure 3qa). Mesh of an object with a somewhat narrow region, from the new version of the mesh generator

Figure 36(b). Modified quadtree structure of the object, from the new version of the mesh generator

Figure 36(c). Invalid modified quadtree structure of the object, from the old version of the mesh generator

Page 33: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1075

Figure 37(a). Mesh of an object, from the new version of the mesh generator

Figure 37(b). Mesh of the object, from the old version of the mesh generator

version of the mesh generator. Figure 37 (a) shows a finite element mesh from the new program and Figure 37 (b) shows a finite element mesh from the old program. The new version’s mesh is clearly better, which is a result mainly from going to real intersections, as can be seen by contrasting the new modified quadtree representation in Figure 37 (c) with the old representation in Figure 37 (d). The old version had to pull quite a few points to the allowable integer positions, which in the final mesh smoothing have to be pushed back and thus cause poor-shaped finite elements. The new version used real intersections, collapsed out small segments and generated an accurate finite element mesh.

Page 34: Robust, geometrically based, automatic two-dimensional mesh generation

1076 P. L. BAEHMANN ETA1,.

Figure 37(c). Modified quadtree structure of thc object, from thc new version of the mesh generator

Figure 37(d). fied quadtree structure of thc object, from the old version of the mesh generator

7. CLOSING REMARKS

The drastic decreases in the cost of numerical computation, plus the availability of both design and analysis software, have made the use of finite element analysis techniques cost effective for a large number of applications. However, two problem areas exist. The first is the amount of effort required to develop finite element models with the best of today’s interactive preprocessors. The second is the lack of finite element expertise possessed by a large percentage of the designers being asked to perform finite element analysis. To alleviate these problem areas, the finite element modelling process must be automated in such a manner that the input to thc process is a geometric object with the analysis attributes tied to it, and the output is the results, to a

Page 35: Robust, geometrically based, automatic two-dimensional mesh generation

AUTOMATIC TWO-DIMENSIONAL MESH GENERATION 1077

prespecified level of accuracy, tied to the geometric object. This paper has presented the two-dimensional version of a mesh generation approach that

provides the finite element discretization procedure needed for such a system. As shown in the previous sections, the modified quadtree mesh generator is capable of producing valid finite element meshes for any geometry. The tree-based data structure used to store the mesh is also ideally suited for h-type mesh refinerncnts,’ defined as part of an adaptive analysis process. Adaptive analysis procedures must be used in an automated finite element modelling procedure to ensure that the discretization errors are controlled.

In addition tL being able to generate meshes of well-shaped elements for any two-dimensional geometry, the modified quadtree mesh generator, and the three-dimensional modified octree mesh generator, can be easily integrated with the various geometric modelling procedures.2s In addition, it is computationally efficient and has a linear growth rate.

ACKNOWLEDGEMENTS

The authors would like to express their appreciation for the support of the US. National Science Foundation under Grant MSM 83-05950 and to the Industrial Associates of the RPI Center for Interactive Computer Graphics.

Any opinions, findings, and conclusions in this paper are those of the authors and do not necessarily reflect the views of their sponsors.

REFERENCES

I . M. A. Yerry and M. S. Shephard, ‘Finite element mesh generation based on a modified-quadtree approach’, I E E E

2. M. S. Shephard and M. A. Yerry, ‘Approaching the automatic generation of finite elemcnt meshes’, Computers in Mech.

3. J. C. Cavendish, ‘Automatic triangulation of arbitrary planar domains for the finite element method, fn t . j . mmer .

4. F. T. Tracy, ‘Graphics pre- and post-processer for two-dimensional finite clement programs’, SIGGRAPff’77, 11 (2),

5. C. 0. Frederick, Y . C. Wong and F. W. Edge, ‘Two dimensional automatic mesh generation for structural analysis’, Int.

6. ‘A. J . G. Schoofs, I,. H. Th. M. Van Beukering and M. L. C. Sluiter, ‘TRIQUAMESH. Clebruikershandleiding. The-

7. A. Bykat, ‘Automatic generation of triangular grid: I ~ subdivision of a general polygon into convex subregions, 11-

8. €3. Joe and R. B. Simpson, ‘Triangular meshes for regions ofcomplicated shapes’, Int. j. numer. mezhods eng., 23,751-778

9. W. C. Thacker, ‘A brief review of techniques for generating irregular computational grids’, Int..j. numer. meihods eng..

10. M. A. Yerry and M. S. Shephard, ‘Automatic three-dimensional mesh generation by the modified-octree technique’,

11. M. A. Yerry and M. S . Shephard. ‘Automatic mesh generation for three-dimensional solids’, Computers and Structures.

12. M. S. Shephard, M. A. Yerry and P. L. Baehmann. ‘Automatic mesh generation allowing for efficient a priori and a

13. B. Wordenwevcr, ‘Volumc-triangulation’. C A D Group Documenr No. I 10, University of Cambridge, Computer

14. T. C. Woo and T. Thomasma, ‘An algorithm for generating solid elements in object with holes’, Computer and

15. M. L. C. Sluiter and D. L. Hansen, ‘A general purpose automatic mesh generator for shell and solid finite elements’. in

16. J. C. Cavendish, D. A. Field and W. H. Frzy, ‘An Approach to automatic three-dimensional finite element mesh

17. V. Nguyen, ‘Automatic mesh generation with tetrahcdronal elements’, In(. j. numer. methods eng., 18, 273-280 (1982).

Computer Graphics and Applications, 3 (l), 39-46 ( 1 983).

Engng., 1 (4), 49-56 (1983).

methods mg., 8, 679-696 ( I 974).

8-12 (1977).

i . numer. methods eng., 2, 133-144 (1970).

Rapport We 78-01’, Technische Hogcschool Eindhovcn, Afdcling Der Wertuigbouwkunde. 1978.

triangulation of convex polygons’. Int . j . numer. nzethods eng., 10, 1329-1342 (1971).

(1980).

15, 1335-1341 (1980).

In t . j . numer. methods eng., 20, 1965-1990 (1984).

20, 31-39 (1985).

posteriori mesh refinements’, Computer Me&. A p p l . Mech. Engny., 55, 161 -1 80 (1986).

Laboratory, Corn Exchange Street. Carnbridgc, CB23QG. England. 1980.

Structures, 18, 333-342 (1984).

L. E. Hulbert (ed.), Computers in Eyineering, 3, No. (300217, ASME,, 1982, pp, 29-34.

generation’, Inl. j . numer. methods eny., 21, 329 348 (1985).

Page 36: Robust, geometrically based, automatic two-dimensional mesh generation

1078 P. L. BAEHMANN ETAL.

18. A. A. G. Requicha and H. B. Voelcker, ‘Solid modeling: a historical summary and contemporary assessment’, IEEE

19. J. W. Boyse and J. E. Gilchrist, ‘GMSOLID interactive modeling for design and analyses of solids’, I E E E Computer

20. A. Klinger and C. R. Dyer, ‘Experiments on picture representation using regular decomposition’, Computer Graphics

21. D. Meagher, ‘Geometric modeling using octree encoding’, Computer Graphics and Image Processing, 19, 129-147

22. S. L. Wittchen, ‘Automatic finite element mesh generation within a modified-quadtree discretization’, Muster’s Thesis,

23. M. A. Yerry, ‘Modified-quadtrees for finite element mesh generation’, Master’s Thesis, Center for Interactive Computer

24. J. L. Moore, ‘Boundary node smoothing for two and three dimensional finite element meshes’, Master’s Thesis, Center

25. M. S. Shephard, ‘Finite element modeling within an integrated geometric modeling environment: part 1 -mesh

Computer Graphics and Appl., 2, 9-24 (1982).

Graphics and Appl., 2, 27-40 (1982).

and Image Processing, 5, 68-105 (1976).

(1982).

Center for Interactive Computer Graphics, RPI, Troy, NY, 1986.

Graphics, RPI, Troy, NY, 1982.

for Interactive Computer Graphics, RPI, Troy, NY, 1984.

generation’, Engineering with Computers, 1, 61-71 (1985).