Automatic Mesh Generation on a Regular Background Grid

4 downloads 0 Views 298KB Size Report
insertion, will be reCovered through a systematiC element swap proCess. ... mesh generation, baCkground grid, triangular mesh, boundary reCovery.
Vol.17 No.6

J. Comput. Sci. & Technol.

Nov. 2002

Automatic Mesh Generation on a Regular Background Grid 

LO S. H.1 and LIU Jianfei ( 1

)2

Department of Civil Engineering, The University of Hong Kong, Hong Kong, P.R. China

2

Department of Mechanics, Peking University, Beijing 100871, P.R. China

E-mail: [email protected] Received October 19, 2001; revised January 7, 2002. Abstract This paper presents an automatic mesh generation procedure on a 2D domain based on a regular background grid. The idea is to devise a robust mesh generation scheme with equal emphasis on quality and eÆciency. Instead of using a traditional regular rectangular grid, a mesh of equilateral triangles is employed to ensure triangular element of the best quality will be preserved in the interior of the domain. As for the boundary, it is to be generated by a node/segment insertion process. Nodes are inserted into the background mesh one by one following the sequence of the domain boundary. The local structure of the mesh is modi ed based on the Delaunay criterion with the introduction of each node. Those boundary segments, which are not produced in the phase of node insertion, will be recovered through a systematic element swap process. Two theorems will be presented and proved to set up the theoretical basic of the boundary recovery part. Examples will be presented to demonstrate the robustness and the quality of the mesh generated by the proposed technique. Keywords mesh generation, background grid, triangular mesh, boundary recovery

1

Introduction

Much success has been achieved in mesh generation over two-dimensional domains[1 12] . However, we still start from the two-dimension when new idea are studied and tested. The grid-based method has been investigated for many years by many researchers[13;14] , but the results are not completely satisfactory especially over three-dimensional domains. Here, we would like to inspect this method afresh under a di erent perspective. In this paper, we present a robust mesh generation scheme for two-dimensional domains with equal emphasis on quality and eÆciency. The central idea is to employ a grid of equilateral triangles instead of rectangles in the generation of triangular element mesh. The boundary recovery phase is also much enhanced. In fact, the actual implementation follows a construction proof of the existence of the boundary segments by means of element swap. The mesh generation algorithm is as follows: 1) Construction of the background grid. 2) Identify the domain boundary, and prepare the sequence of boundary nodes to insert. 3) Insert the boundary nodes into the background mesh one by one and update the mesh topology for each node insertion by local element swap based on Delaunay criterion. 4) Recover the missing boundary segment one by one through element swap. This is always possible based on the construction proof of the two related theorems. 5) Improve the quality of the mesh through some local process.

The rest of the paper is organized as follows: The construction of the background mesh is rst presented; the insertion of the boundary node will be discussed; it is followed by the basic operations changing the mesh topology; the problem of boundary recovery is explained; and the mesh generation is completed with a phase of mesh optimization. The proofs of two theorems relative to the boundary treatment are given. Examples, conclusions and discussions are given at the end of this paper. Supported by the University Grant Council (UGC) for the project \Analysis of building structure using hybrid stress hexahedral elements". * To whom all the correspondence should be addressed.

No.6

2

Automatic Mesh Generation on Background Grid

883

Background Grid of Triangles

Before meshing, a background mesh of equilateral triangles has to be established. The background mesh should be large enough to cover the entire domain to be meshed. The background mesh can be set up by following steps: 1) Find the circle containing the region to mesh. 2) Create an equilateral triangle for which the circle containing the region is its inscribed circle as shown in Fig.1. 3) Divide the triangle into smaller equilateral triangles with element size given by the user or calculated from the domain boundary. 4) Record the triangles into structure as follows: Struct triangle f Int corner[3] ; // three corners of a triangle. Fig.1. Construction of the Struct triangle *neighbor[3] ; // three neighbor triangles of a triangle. background grid. Struct triangle *front, *back; //link triangles into a chain. g

3

Insert Boundary Nodes into the Mesh

1) Boundary nodes are inserted into the mesh following the steps: For a given node, identify the triangle containing it. This can be done using the random walk algorithm proposed by Borouchaki and Lo[15] . For each node insertion, three cases have to be considered if robustness of the algorithm is to be maintained. The node falls inside a particular triangle, this triangle is divided into three smaller triangles by joining the inserted node to the corners of the containing triangles (OP2). The node is very close to a line segment of the mesh, the node will be absorbed by the line segment and each of the two opposite triangles on this line segment are divided into two triangles (OP3). The inserted node is very close to an existing node in the mesh, the existing node will be shifted to the position of the node to be inserted and no new node is created in this case. 2) The local topology is modi ed by means of element swap following the Delaunay criterion.

4

Basic Operations a) Element Swap (OP1)

This is the basic operation that would be used extensively in the boundary recovery and in the local modi cation of mesh topology. In Fig.2, there are two triangles ABC and BAD sharing a common edge, the con guration can be changed to triangles DCB and DCA through the exchange of diagonal. To judge whether we can swap any two adjacent triangles, three Fig.2. Swap of diagonal. conditions have to be met: 1) Convex testing. If both angle CAD and angle CBD are smaller than  then the pair of triangles can be swapped. For implementation, if segment AB intersects with segment CD, the test is passed. Otherwise it fails. 2) Delaunay criterion. If the circumcircle of triangle ABC contains point D then the test is passed. Otherwise it fails 3) Boundary integrity. While swap, the boundary edge recovered cannot be swapped further. If line AB is boundary edge, no swap is to be done. b) Divide a Triangle into Three (OP2)

Triangle ABC can be divided into three smaller triangles with the insertion of an interior point P by joining P to the three corner vertices A, B and C as shown in Fig.3. c) Divide Two Triangles into Four (OP3)

Triangle ABC and triangle BAD sharing edge AB are divided into two triangles AEC + EBC and BED + EAD respectively on the introduction of a new node to edge AB as shown in Fig.4.

884

LO S. H., LIU Jianfei

Vol.17

d) Merge Three Triangles into One (OP4)

When there are only three triangles surrounding an interior node, the interior node can simply be removed and three triangles are merged into one as shown in Fig.5.

Fig.3. Separate a triangle into three.

Fig.4. Divide two triangles into four.

Fig.5. Merge three triangles into one.

e) Merge Four Triangles into Two (OP5)

Fig.6. Merge four triangles into two.

5

When there are only four triangles surrounding an interior node, the node can be removed directly and the four triangles merge into two as shown in Fig.6. This operation is an important step in the boundary retrieval in removing a node on a boundary segment.

Boundary Recovery

After all the boundary nodes are inserted, the boundary integrity of the domain has to be checked. In general, most boundary edges would be produced in the node insertion process. However, there may be some long boundary segments which are not present in the mesh after node insertion. These missing edges have to be recovered through an element swap process. P. L. George et al. have also used this technique for boundary recovery[16] . When we take a closer look at the problem, a systematic approach can be formulated, and the main idea is explained and summarized into two theorems in the following section. The following is the procedure for the retrieval of a missing boundary segment. Identify all the triangles cut across by the missing boundary segment. The collection of the triangles will in general form a polygon, which we call L-polygon, as shown in Fig.7. A systematic element swap process recovers the boundary segment associated with the L-polygon. This always works following the construction proof of Theorem 1. Fig.7. L-Polygon of AB. Intermediate nodes may exist on the boundary segments, which will cut it into sub-segments. This is caused by the introduction of a boundary node, which is very close to an edge of the mesh. In case there are intermediate nodes, each sub-segment will be recovered in turn and intermediate nodes are then removed using OP5. It is possible as shown in Theorem 2 that elements connected to a node can always be reduced to four and intermediate node can then be removed by merging the four elements into two using OP5. Fig.8. Segment AB broken by P .

6

Mesh Optimization

The quality of the mesh is rather poor just after boundary retrieval. However this can easily be recti ed by several mesh optimization techniques, three methods have been used in this study: 1) Element swap is performed according to the Delaunay criterion while boundary integrity is maintained. This is a constrained mesh optimization process. 2) Interior nodes surrounded by three or four triangles are removed. Basic operations of OP4 and OP5 are designed to do this job. 3) Node repositioning. Interior nodes are moved to the center of the polygon comprising of all the

No.6

Automatic Mesh Generation on Background Grid

885

triangles connected to this node.

7

Proofs of Theorems

Lemma 1. For an arbitrary polygon AP1 P2 : : : Pm B , consisting of m + 2 points with a base edge AB as shown in Fig.9, there exists at least one point among P1 P2 : : : Pm whose angle is less than  . The proof of the previous lemma is obvious, since the sum of angles at points P1 ; P2 ; P3 ; : : : ; Pm is less than m . Consider the sum of interior angles of the polygon. Sum of interior angles = (m + 2 2) = m

This sum is also given by a + b + 1 + 2 +

 + 

m

Fig.9. Arbitrary polygon.

Hence 1 + 2 +    + m = m a b . Thus, mean value  = (m a b )=m <  . Theorem 1. A polygon AP1 P2    Pm BQ 1 Q2    Qn as shown in Fig.10 composing of nite number of triangles contains diagonal AB in its interior, then segment AB can be recovered by element swap (OP1). The main idea is that through element swap a node of the L-polygon can always be removed from the polygon reducing the size of the polygon. This process can be applied repeatedly until edge AB is generated. Proof. Choose one point with an angle less than  from P1 P2 : : : Pm , say P , such a point exists due to Lemma 1. The triangles of the L-polygon connected to point P form a polygon, which will be called P -polygon as shown in Fig.11. There are three possible situations in which none, one or both end points of segment AB are included in the polygon. Here we only consider the case in Fig.11(a); as for the other two cases, they can be treated in a similar manner. Suppose there are k points at the opposite side of segment AB which are connected to point P . That is there are k edges connected to point P which cut across line segment AB. Find a point from Q1 ; Q2 ; : : : ; Qk , say Q, whose angle is less than  , such a point exists due to Lemma 1 using Pl Pr as the supporting edge. The two triangles sharing diagonal PQ can be swapped, and the number of diagonal connected to P is decreased by one.

2

Fig.10. L-polygon of

AB

, angle P <  .

Fig.12. Endgame of swap procedure.

Fig.11. Three cases of P -polygon.

Fig.13. Change the polygon to simple situation for removing break point. (a) Before swap. (b) After limited steps of swap.

The process can go on until the simple con guration as shown in Fig.12 is reached. It is obvious for this case that triangle P Pl Pr can be created and taken away after another swap. In this way, point P is removed from the L-polygon. The procedure can be repeated taking another point from the L-polygon until all the point P1 ; P2 ; : : : ; Pm of the L-polygon are removed and diagonal AB will be generated.

886

LO S. H., LIU Jianfei

Vol.17

Theorem 2. Let C be a point on line AB, all other points P1 ; P2 ; : : : ; Pm are on the same side of AB and can be seen from point C, connecting C to P1 ; P2 ; : : : ; Pm divides the polygon into a series of triangles as shown in Fig.13(a). It is proposed that the number of points connected to C can be reduced to one by simple swap as shown in Fig.13(b). The single point P connected to C is one of the point from the set fP1 ; P2 ; : : : ; Pm g. Proof. Select a point from the set fP1 ; P2 ; : : : ; Pm g with an angle less than  , say Ps . Swap the two triangles sharing edge Ps C , the diagonals from point C decreases, and point Ps is removed from the set. The procedure goes on until only one diagonal is left, and the situation as shown in Fig.13(b) is reached.

8

Examples The rst example in Fig.14 shows the resulting meshes after boundary recovery and mesh opti-

Fig.14. The result after boundary recovered and optimization. (a) Boundary recovered. (b) The nal mesh after optimization.

Fig.15. Arbitrary complex region 1.

Fig.17. Boundary segments shorter than grid size.

Fig.16. Arbitrary complex region 2.

mization. In the phase of boundary recovery shown in Fig.14(a), the quality of the mesh is not taken into account as many pointed elements appear in the mesh. This is corrected in the phase of mesh optimization as shown in Fig.14(b). The examples in Fig.15 and Fig.16 respectively are two complex regions with boundary segment size similar to the background mesh. It can be seen that equilateral triangles are preserved at the interior of the mesh. Finally the example in Fig.17 presents a complicated region with many segments whose size is smaller than that of the background grids.

No.6

9

Automatic Mesh Generation on Background Grid

887

Conclusions and Discussions

An automatic mesh generation method based on background grid is presented. To ensure goodquality triangles are obtained at the interior of the domains, equilateral triangular background mesh rather than the traditional square mesh is used. The robustness of the method is guaranteed in the phase of boundary recovery which is based on the construction proof of two related theorems. It is a very eÆcient mesh generation method as mesh generation only deals with domain boundary. The possibility of extending the present technique to three-dimensional problems is under investigation. Acknowledgements

tion.

The second author would like to thank Dr. S. H. Lo for his kindly invita-

References [1] Borouchaki Houman, Paul Louis George. Aspects of 2-D Delaunay mesh generation. International Journal for Numerical Methods in Engineering, John Wiley & Sons, 1997, 40: 1957{1975. [2] Cavendish, James C. Automatic triangulation of arbitrary planar domains for the nite element method. International Journal for Numerical Methods in Engineering, John Wiley & Sons, 1974, 8: 679{696. [3] Sadek E A. A scheme for the automatic generation of triangular nite elements. Int. J. Numer. Methods Eng., 1980, 15: 1813{1822. [4] Shaw R D, Pitchen R G. Modi cation to Suhara-Fukuda method of network generation. Int. J. Numer. Methods Eng., 1978, 12: 93{99. [5] Lo S H. A new mesh generation scheme for arbitrary planar domains. Int. J. Numer. Methods Eng., 1985, 21: 1403{1426. [6] Lo S H. Delaunay triangulation of non-convex planar domains. Int. J. Numer. Methods Eng., 1989, 28: 2695{2707. [7] Jin H, Wiberg N E. Two-dimension mesh generation, adaptive remeshing and re nement. Int. J. Numer. Methods Eng., 1990, 29: 1501{1526. [8] Fortune S. Numerical stability of algorithms for 2d Delaunay triangulations. Int. J. Comput. Geometry Appl., 1995, 5(1{2): 193{213. [9] Blacker T D, Stephenson M B. Paving: A new approach to automated quadrilateral mesh generation. Int. J. Numer. Methods Eng., 1991, 32: 811{847. [10] Kwok W, Haghighi K, Lang E. An eÆcient structure for the advancing-front triangular mesh generation technique. Commun. Numer. Methods Eng., 1995, 11: 465{473. [11] Talbert J A, Parkinson A R. Development of an automatic two-dimensional nite element mesh generator using quadrilateral elements and Bezier curve boundary de nition. Int. J. Numer. Methods Eng., 1990, 29: 1551{1567. [12] Zhu J Z, Zienkiewicz O C, Hinton E, Wu J. A new approach to the development of automatic quadrilateral mesh generation. Int. J. Numer. Methods Eng., 1991, 32: 849{866. [13] Yerry M A, Shephard M S. A modi ed quad-tree approach to nite element mesh generation. IEEE Comp. Graphics Appl., 1983, 1: 39{46. [14] Baehmann Peggy L, Scott L Wittchen, Mark S Shephard et al. Robust, geometrically based, automatic twodimensional mesh generation. International Journal for Numerical Methods in Engineering, John Wiley & Sons, 1987, 24: 1043{1078. [15] Borouchaki H, Lo S H. Fast Delaunay triangulation in three dimensions. Computer Methods in Applied Mechanics and Engineering, Elsevier, 1995, 128: 153{167. [16] George P L, Hecht F, Saltel E. Automatic mesh generator with speci ed boundary. Computer Methods in Applied Mechanics and Engineering, North-Holland, 1991, 92: 269{288. LO S. H. graduated from the Department of Civil and Structural Engineering at the University of Hong Kong in 1979. He obtained the M.Ph. degree from the same department in 1985. He nished his DocteurIngenieur degree at Ecole des Ponts et Chaussees, Paris, in 1986. After working two years for P.S.A. Automobile Group in France, S. H. Lo went back to Hong Kong and joined the Department as a lecturer in 1988, and was promoted to senior lecturer in 1994. His research interests include the nite element method, adaptive re nement analysis, computer graphics in engineering applications, large deformation problems, etc. He is a co-editor of the section \Structural Analysis and CAD" for the journal \Progress in Structural Engineering and Materials", and he is also a member of the editorial board of the international journal \Finite Elements in Analysis and Design". He was a visiting professor to INRIA, France in 1994 and 1998. LIU Jianfei received his Ph.D. degree from the Beijing University of Aeronautics and Astronautics in 1991. He is an associate professor of Peking University. His research interests include mesh generation and computer aided design.