18
Vol.10 No.6 J. of Comput. Sci. & Technol. Nov. 1995 A New Approach to Fully Automatic Mesh Generation Min Weidong (NTIS) and Tang Zesheng ( ~ ) CAD Center, Department of Computer Science and Technology, Tsinghua University, Beijing 100084 Zhang Zhengming (~$1), Zhou Yu (N ~1) and Wang Minzhi (=1=~) CAD Center, Institute of Nuclear Energy Technology, Tsinghua University, Beijing 100084 Received October 7, 1994. Abstract Automatic mesh generation is one of the most important parts in CIMS (Computer Integrated Manufacturing System). A method based on mesh grad- ing propagation which automatically produces a triangular mesh in a multiply connected planar region is presented in this paper. The method decomposes the planar region into convex subregions, using algorithms which run in linear time. For every subregion, an algorithm is used to generate shrinking polygons according to boundary gradings and form Delaunay triangulation between two adjacent shrinking polygons, both in linear time. It automatically propagates boundary gradings into the interior of the region and produces satisfactory quasi-uniform mesh. Keywords: Finite element mesh generation, grading propagation, arbitrary domain, shrinking polygon. 1 Introduction Automation of finite element mesh generation brings great benefits for mechan- ical product development and analysis, such as freeing engineers from mundane tasks, shorting product design cycle and eliminating human-related errors. It is one of the most important parts in CIMS (Computer Integrated Manufacturing Sys- tem). Various techniques for generating 2D meshes have been developed, such as mapping [1], modified quadtree [2'3], cutting method[4-7], filling method [8,9] and De- launay triangulation[l~ Some of the existing mesh generation methods have disadvantages such as being semi-automatic and requiring specific topological information. It is difficult to in- tegrate them into fully automatic CIMS. Therefore, extensive research has recently been pursued in fully automatic mesh generation [5-7,x2-15] due to its potential abil- ity to attack increasingly complex problems and phenomena. On the other hand, few of the automatic mesh generation methods published so far can have all the three following desirable features which must be possessed by a good automatic mesh generation method.

A new approach to fully automatic mesh generation

Embed Size (px)

Citation preview

Page 1: A new approach to fully automatic mesh generation

Vol.10 No.6 J. of Comput. Sci. & Technol. Nov. 1995

A N e w Approach to Fully A u t o m a t i c Mesh Generat ion

Min Weidong ( N T I S ) and Tang Zesheng ( ~ )

CAD Center, Department of Computer Science and Technology, Tsinghua University, Beijing 100084

Zhang Zhengming ( ~ $ 1 ) , Zhou Yu (N ~1) and Wang Minzhi ( = 1 = ~ )

CAD Center, Institute of Nuclear Energy Technology, Tsinghua University, Beijing 100084 Received October 7, 1994.

Abstract

Automatic mesh generation is one of the most important parts in CIMS (Computer Integrated Manufacturing System). A method based on mesh grad- ing propagation which automatically produces a triangular mesh in a multiply connected planar region is presented in this paper. The method decomposes the planar region into convex subregions, using algorithms which run in linear time. For every subregion, an algorithm is used to generate shrinking polygons according to boundary gradings and form Delaunay triangulation between two adjacent shrinking polygons, both in linear time. It automatically propagates boundary gradings into the interior of the region and produces satisfactory quasi-uniform mesh.

Keywords: Finite element mesh generation, grading propagation, arbitrary domain, shrinking polygon.

1 I n t r o d u c t i o n

Automation of finite element mesh generation brings great benefits for mechan- ical product development and analysis, such as freeing engineers from mundane tasks, shorting product design cycle and eliminating human-related errors. It is one of the most important parts in CIMS (Computer Integrated Manufacturing Sys- tem). Various techniques for generating 2D meshes have been developed, such as mapping [1], modified quadtree [2'3], cutting method[4-7], filling method [8,9] and De- launay triangulation[l~

Some of the existing mesh generation methods have disadvantages such as being semi-automatic and requiring specific topological information. It is difficult to in- tegrate them into fully automatic CIMS. Therefore, extensive research has recently been pursued in fully automatic mesh generation [5-7,x2-15] due to its potential abil- ity to attack increasingly complex problems and phenomena. On the other hand, few of the automatic mesh generation methods published so far can have all the three following desirable features which must be possessed by a good automatic mesh generation method.

Page 2: A new approach to fully automatic mesh generation

492 J. of Comput. Sci. & Technol. Vol. 10

1. The elements produced by the method should possess favourable element shape, i.e., keep elements more or less equilateral and equiangular.

2. It should be easy to define and control mesh gradings. The element distri bution should vary smoothly over the region.

3. The method should possess high computational efficiency. Most methods have disadvantages of being difficult to define and propagate

mesh gradings and/or consuming lot of running time. Some methods use geometric progression [5'sl and arithmetic progression Its] to propagate mesh grading in bound- ary line. They propagate mesh grading into the interior of a planar region using cutting method which consumes lot of running time.

A fully automatic triangular mesh generation method based on mesh grading propagation is.described in this paper to alleviate the problems mentioned above. This method uses a new way, i.e., shrinking polygon, to propagate boundary mesh gradings into the interior of a planar region. The method first decomposes a multiply connected ( i.e., with holes) planar region into convex subregions in linear time. For every convex subregion, an algorithm is used to generate shrinking polygons accord- ing to boundary gradings and form Delaunay triangulation between two adjacent shrinking polygons, both in linear time. Meanwhile, it automatically propagates boundary gradings into the interior of the region with arithmetic progression. It generates satisfactory quasi-uniform mesh whose element shape is close to equilat- eral triangle and element distribution varies smoothly over the region.

An outline of the method is given in Section 2. Section 3 discusses decomposing a multiply connected region into a simply connected concave region, followed by the description of decomposing a simply connected concave region into convex subregions in Section 4. In Section 5, concepts of mesh grading propagation in region and shrinking polygon are introduced, and an example is given to show how the shrinking polygons propagate boundary mesh gradings into the interior of the region. An algorithm for triangulating a convex polygon is presented in Section 6. Finally, examples are shown and conclusion is drawn in Section 7.

2 Outline of the Algorithm

2.1 Mesh Grading Propagation in'Line

To define mesh grading of a line l, the user defines mesh gradings rs, re of its starting endpoint and ending endpoint. Nodes are inserted on the line with arithmetic progression propagation.

Suppose s is the length of the line and the line is to be split into n segments, whose lengths are rs , rs + d, rs + 2d, . . . , rs + (n - 1)d from the starting endpoint to

the ending endpoint (see Fig.l). Here, d is called mesh grading propagation factor. We have

re = rs + ( n - 1)d, and s = rs + (rs + d) + (rs + 2d) + ... + [rs + ( n - 1)d].

r s r s + d r s + 2 d r s + 3 d r e

Fig.1. Mesh grading propagation in line.

Page 3: A new approach to fully automatic mesh generation

No. 6 An Approach to Fully Automatic Mesh Generation 493

It is easy to calculate the values of n and d. However, because n should be a positive integer, rs and r e should be adjusted. Every new node has a mesh grading given b y r s q - i •

With this method, a straight line l is split into segments which are still stored in the straight line I. A straight line l is called a lotus. On the other hand, a curve line is split into segments. Each of them forms a straight line, i.e., a lotus. Every lotus has its mesh grading propagation factor d.

2 .2 T h e O u t l i n e o f t h e A l g o r i t h m

The outline of the method presented in this paper is described as follows. 1. The outside loop and inside loops are extracted automatically from the graph

to be processed. The outside loop is oriented counterclockwise, whereas the inside loops are oriented clockwise.

2. The boundary lines are discretized with mesh grading propagation in line. 3. The multiply connected region is transformed into a simply connected concave

region by adding lines between outside loop and inside loops. 4. The simply connected concave region is decomposed into convex polygons. 5. An algorithm is invoked to mesh every convex polygon. 6. A length-weighted smoothing[ 1T] is carried out.

3 Transform Multiply Connected Region into Simply Connected Region

3.1 C u t t i n g L i n e

A mutiply connected region is one with holes in its interior. It can be converted into a simply connected region by adding cutting lines between the outside loop and inside loops. A cutt ing line connects a boundary node of the outside loop and a boundary node of an inside loop. The outside loop and inside loops are oriented in the counterclockwise and clockwise directions respectively. By adding cutt ing lines, the multiply connected region is converted into a simply connected region (See Fig.2).

t

Fig.2. A multiply connected region is converted into a simply connected re,on by adding cutting lines.

In order to avoid generating cutting lines which intersect with some lines of loops (this will result in non-simple polygon), the process is designed as follows. We define the following ordering of points in the plane: (x, y) > (u, v) if y > v, or y -- v and x > u. We define a function TOP(LP) to be the boundary node with the largest coordinates of loop LP using the above ordering. Inside loop INP whose TOP(INP) has the largest coordinates using the above ordering is selected. A cutt ing line which

Page 4: A new approach to fully automatic mesh generation

494 J. of Comput. Sci. & Technol. Vol. 10

connects TOP(INP) and one of the boundary nodes of outside loop OUTP whose y coordinate is greater than that of TOP(INP) is formed. In order to avoid generating bad shape element, the cutting line is selected to make the length of the cutting line as short as possible. INP is merged into OUTP by the cutting line. This process is recursive and it finally converts a multiply connected region into a simply connected region.

First, a function SDIS(/, V:) is defined, where I is a segment and V is a point. If the intersecting point of I and the perpendicular from point V to segment l lies on segment l, then the value of SDIS(/, V) is the distance from point V to segment I. Otherwise, the value of SDIS(I, V) is the minimum of the distance from V to two endpoints of segment I. The cutting line between INP and OUTP can be selected as follows. First we select a candidate line l of OUTP whose SDIS(/,TOP(INP)) is the smallest. The selection is .among the lines which have at least one endpoint whose y coordinate is greater than that of TOP(INP). Then, the algorithm finds the optimal node in line l which has the shortest distance from TOP(INP) to this node. This process can be improved by the following searching strategy. The searching starts from one of two endpoints of 1 which has shorter distance from TOP(INP) to this endpoint. The nodes of line l are checked along the line sequentially until the distance from the node TOP( INP) does not decrease.

3.2 D e s c r i p t i o n o f t h e A l g o r i t h m

The following is the algorithm for converting a multiply connected region into a simply connected region. OUTP is the outside loop, and INLOOPS stores the inside loops whose TOP(INP) is sorted with the ordering defined above. All boundary lines of loops have been discretized with mesh grading propagation in line.

P r o c e d u r e convert(OUTP, INLOOPS) begin 1. while (INLOOPS is not a null set) do 2. begin 3. Let INP be the inside loop whose TOP(INP) is the largest coordinates according to

the ordering defined above. 4. A candidate line 1 of OUTP is selected, which has the smallest SDIS(1,TOP(INP)). 5. The optimal node ND of line 1 is determined. 6. A cutting line which connects TOP(INP) and ND is formed. It is discretized with

mesh grading propagation in line. 7. INP is merged into OUTP by the cutting line. INLOOPS is updated. 8. end of while 9. Simply connected polygon OUTP is sent to the algorithm decompose-concave-

polygon(OUTP) to be discussed in Section 4. endp

For every inside loop, the selection of candidate line l can be finished in linear time O(n), where n is the number of lines of the outside 'loop, and the selection of the optimal node can be finished in linear time O(n~), where n I is the number of boundary nodes of I.

Page 5: A new approach to fully automatic mesh generation

No. 6 An Approach to Fully Automatic Mesh Generation 495

4 D e c o m p o s e Concave Polygon into Convex Polygons 4.1 S e p a r a t o r

We define some symbols as follows: �9 P(i) : The i-th latus of polygon P. �9 PS(I) , PE(I): Starting endpoint and ending endpoint of latus I. A region is said to be concave if it has boundary nodes with internal angles

greater than 180 ~ , whereas this kind of nodes is said to be R-nodes (reflex nodes). Suppose P is a simply connected concave polygon. PS(P( i ) ) is an R-node if and only if (PS(P( i ) ) - P S ( P ( i - 1))) x (PS(P( i + 1)) - PS(P( i ) ) ) < 0. All the R-nodes are stored in counterclockwise order in a reflex node list.

A separator S P is defined as a line segment which connects an R-node and a boundary node or two R-nodes. Whenever a sepatator S P is found, the polygon P . i s subdivided into two polygons S and (P - S)(See Fig.3). The decomposition process is recursive. Finally the polygon P is divided by separators into several convex polygons.

4 .2 A n g l e C r i t e r i o n

The selection of separators which decompose the concave polygon into convex subregions is governed by the criterion that these subregions must be well shaped, i.e., separators must not introduce small angles which produce sharp corners. A good separator S P must conform to the angle criterion, i.e., the angles c~, fl, % 8 around the separator SP (See Fig.3) are all greater than a specified angle Ami n (its value is chosen as 70 ~ in the implementation of the algorithm), and a, 3, are smaller than 180 ~ in order to get a convex polygon S.

4 .3

Fig.3. Concave polygon P is subdivided into polygons S and (P - S) by separator SP.

O u t s i d e C r i t e r i o n

Fig.4. Outside test of R-nodes.

It is possible tha t an R-node might be enclosed within a subregion S formed by a separator SP , as shown in Fig.4. If such a possibility occurs, separator S P is invalid and is not generated. This is called the outside criterion. An outside test is developed to check if separator S P conforms to the outside criterion and works as follows. If all R-nodes excluding the one(s) on the separator are outside of polygon S, the separator is valid. An R-node R to be checked is outside of polygon S if there is at least one latus which meets the condition ( P S ( S ( i ) ) - R ) x ( P E ( S ( i ) ) - R ) < O. Here, S(i) is the i-th Iatus of S.

Page 6: A new approach to fully automatic mesh generation

496 J. of Comput. Sci. & Technol. Vol. 10

4 . 4 D i s t a n c e C r i t e r i o n

Even if a separator satisfies both the angle criterion and the outside criterion, it is not always a good separator. Bad shaped element will be produced when certain R-node (excluding the one(s) on the separator) is too close to the separator, guppose the gradings of two endpoints of separator SP are G and W. The function DIS(l, V) stands for the distance from point V to segment I. If every R-node R excluding the one(s) on separator SP meets one of the following two conditions, then separator SP is said to conform to the distance criterion:

1. The intersecting point of SP and the perpendicular from point R to S P does not lie on SP.

2. DIS(SP, R) > dmi n * (G + W)/2 (dmin -- 0.5 in the implementat ion of the algorithm).

A separator is said to be valid if it conforms to the angle criterior, the outside criterior and the distance criterion.

4 .5 D e s c r i p t i o n o f t h e A l g o r i t h m

The following algorithm based on searching for valid separators is developed to split concave polygon P into convex polygons. Here, RL is a list storing R-nodes in counterclockwise order, and NEXT(RL, R) is the next R-node of R-node R in RL.

P R O C E D U R E decompose-concave-polygon(P) begin I. RL is formed. 2. An R-node is assigned to R. 3. while (RL is not a null set) do 4. begin 5. if there is no non-reflex node between R and NEXT(RL, R) t hen R = NEXT(RL,

R), goto 3. 6. Search in the counterclockwise direction for a valid separator SP from node R to a

node which lies between R and NEXT(RL, R) in P. 7. if no such valid separator has been found, then search in clockwise direction for a

valid separator SP from node NEXT(RL, R) to a node which lies between NEXT(RL, R) and R in P.

8. if no valid separator has been found, t h e n R = NEXT(RL, R), goto 3. 9. Separator SP is discretized with mesh grading propagation in line. RL is updated.

P is split by separator SP. Convex polygon S is sent to the algorithm mesh-convex- polygon(S) to be discussed in Section 6. P = P - S.

10. end of while endp

Searching for a valid separator for an R-node R means searching for a proper boundary node which lies between R and NEXT(RL, R). Therefore, this algorithm can decompose a concave polygon into convex polygons in linear time O(n). Here, n is the number of the boundary nodes of the convave polygon.

Generally, valid separators can be found by the above algorithm, sett ing Ami n = 70 ~ in the angle criterion and dmin = 0.5 in the distance criterion. Sometimes, Ami n -- 70 ~ and dmi n = 0.5 are too big to find a valid separator, then the algorithm

Page 7: A new approach to fully automatic mesh generation

No. 6 An Approach to Fully Automatic Mesh Generation 497

will adjust Ami n and dmi n a little smaller to find a valid separator. Experiments of many examples show that almost all examples can be split into convex polygons by separtors, setting Ami n = 50 ~ and dmi n = 0.5. All of them can be split into convex polygon if Amin-and dmi n are small enough.

5 Shrinking Polygon and Mesh Grading Propagation in Region

5.1 S h r i n k i n g P o l y g o n

Let every vertex of convex polygon P move into the interior of P, and a new polygon Q will be formed. Polygon Q is called the shrinking polygon of polygon P.

The algorithm for triangulating convex polygon generates shrinking polygon Q of polygon P and discretizes its boundary with mesh grading propagation in line mentioned above, then forms mesh between P and Q. P is replaced by Q. This process is repeated until the whole region is meshed. Mesh between P and Q can be generated as follows. Suppose p is a latus of polygon P and q is the latus of polygon Q corresponding to latus p, then mesh can be easily generated between these two latera (See Fig.5).

P P

Fig.5. Mesh between a polygon and its shrinking polygon.

Now, we will come to discuss how to get the vertices' positions of shrinking poly- gon and how to propagate mesh gradings into shrinking polygon in order to generate quasi-uniform mesh which has both favourable element shape and smoothly-varying element distribution. This is the problem of mesh grading propagation in a region.

5.2 Mesh Grading Propagation in a Region

Suppose Q is the shrinking polygon of convex polygon P. P(i) and Q(i) rep- resent the i- th latus of P and Q respectively. The latera in polygon are oriented counterclockwise. We define some symbols as follows. �9 PS(I), PE(l): Starting endpoint and ending endpoint of latus l. �9 RS(I), RE(1): Mesh gradings of starting endpoint and ending endpoint of latus I. �9 D(I): Mesh grading propagation factor d of latus I. �9 N(/): Number of segments of latus l.

Apparently, PS(P(i)) and PE(P(i - 1)) are the same point. PS(Q(i)) is determined as follows. PS(Q(i)) is on the bisector of angle P S ( P ( i -

1))PS(P(i))PE(P(i)), and dis = (RS(P(i)) + RE(P(i - 1)))/2, where dis is the distance between PS(Q(i)) and PS(P(i)).

Let RS(Q(i)) = RS(P(i)), RE(Q(i)) = RE(P(i)), and latus Q(i) can be dis- cretized with mesh grading propagation in line as mentioned above. RS(Q(i)) and

Page 8: A new approach to fully automatic mesh generation

498 J. of Comput. Sci. & Technol. Vol. 10

RE(Q(i)) are modified after discretizing. In order to make mesh grading vary smoothly, D(q(i)), RS(Q(i)) and RE(Q(i)) must be adjusted according to the following mesh grading propagation rules.

These rules are designed according to the following considerations. 1. Q(i) has the same mesh grading propagation factor as that of P(i). 2. RS(Q(i)) is propagated from RS(P(i)) . RE(Q(i)) is propagated from RE(P(i)) . 3. Because Q is the shrinking polygon of P , varying values D(P(i)) and -D(P( i ) )

should be added smoothly to RS(Q(i)) and RE(Q(i)) respectively. 4. Varying values D(P(i)) and -D(P i i ) ) should be added in different ways in differ-

ent cases in order to prevent mesh grading from varying dramatically. The mesh grading propagation rules designed according to the above four con-

siderations can be writ ten as the following algorithm.

D(Q(i)) = D(P(i)). if (N(Q(i)) < 2 or U(Q(i)) = N(P(i)) ) then

{RS(Q(i)) = RS(P(i)); RE(Q(i)) = RE(P(i)); } else if ( g ( P ( i ) ) - g(q(i)) > 2 ) then

{RS(Q(i)) = RS(P(i)) + D(P(i)); RE(Q(i)) = RE(P(i)) - D(P(i)); } else if (O(P( i ) ) /RS(P( i ) ) >_ 0.5 or D(P(i))/RS(P(i)) < -0.5 ) then

{RS(Q(i)) = RS(P(i)) + D(P(i)); RE(Q(i)) = RE(P(i)); } else if (D(P( i ) ) /RE(P( i ) ) >_ 0.5 or D(P(i))/RE(P(i)) < -0.5 ) then

{ RS(Q(i)) = RS(P(i)); RE(Q(i)) = RE(P(i)) - D(P(i));} else { Suppose Q is the j-th shrinking polygon of the original convex polygon.

If ( j is an even integer ) then { RS(Q(i)) = RS(P(i)) + D(P(i)); RE(Q(i)) = RE(P(i)); }

else (RS(Q(i) ) = RS(P(i)); RE(Q(i)) = RE(P(i)) - D(P(i)); }}

Using these rules, mesh grading can be propagated into t he interior of the region efficiently. The element size varies smoothly with the varying of mesh grading. Meanwhile, bad shaped element can be avoided.

5 .3 C u t o f f C o r n e r s a n d L a t e r a

Vertices of shrinking polygon are on the bisector of the corner angle. PS(P( i - 1))PS(P(i))PE(P(i)) . If this angle is too small, it will bring small angle in mesh element. To avoid this situation, cutt ing off corners is introduced into the algorithm.

For a latus P(i), there are some mesh nodes on it from PS(P(i)) to PE(P(i)) in order. Suppose the order is from f S ( P ( i ) ) to PE(P(i)) , then two symbols are defined as follows. N E X T ( V ) represents the next mesh node of mesh node V. P R E ( V ) represents the previous mesh node of mesh node V.

If angle P S ( P ( i - 1))PS(P(i))PE(P(i)) is smaller than a given threshold value (it is 90 ~ in the implementation of the algorithm), this corner is cut off and a triangle element is formed, see -Fig.6. Tha t is to say, t r iangular element P S ( P ( i ) ) N E X T ( P S (P( i ) ) )PRE(PE(P( i - 1))) is formed. Two relative latera P(i) and P(i - 1) are adjusted. A new latus l (from P R E ( P E ( P ( i - 1))) to N E X T ( P S ( P ( i ) ) ) ) is inserted into the polygon. Mesh grading propagates as fol- lows: D(l) = (D(P(i))+ D ( P ( i - 1)))/2, N(l) = 1, RS(l) = R E ( P ( i - 1)) - D ( P ( i - 1)), RE(I) = RS(P(i) ) + D(P(i)).

Page 9: A new approach to fully automatic mesh generation

No. 6 An Approach to Fully Automatic Mesh Generation 499

n(i)

Fig.6. Cut off corner.

P

Fig.7. Shrinking polygon Q is not a simple polygon.

~ . . ~

(~) (b)

Fig.8. Cut off lz~tus. Fig.9

If a latus P(i) has only one segment, sometimes shrinking polygon Q will bring about invalid mesh element because Q is not a simple polygon (See Fig.7)." This can be avoided by cutt ing off latus P(i), as shown in ]:ig.8.

We define a line l from P R E ( P E ( P ( i - 1 ) ) ) to N E X T ( P S ( P ( i + 1))), and let len be the length of I. We define polygon S as PRE(PE(tg( i - 1)))PS(P(i))PE(P(i)) N E X T ( P S ( P ( i + 1))), as shown in Fig.& Let r be the maximum among RS(P(i)), RE(P( i -" 1)) and RS(P(i + 1)). Let dis be the minimum of the distance from PS(P(i)) to line l and the distance from PE(P(i)) to line I. If a latus P(i) meets the following three conditions, it will be cut off.

1. N(P(i)) = 1. 2. len _< a * r (a = 2.4 in the implementation of the algorithm). 3. dis >/3 �9 r (/3 = 0.5 in the implementation of the algorithm).

Conditions 2, 3 are used for avoiding generating flat element. Cutt ing off latus P(i) me~.ns what follows. Elements are formed in polygon

S. Meanwhile, latera P(i - 1) and P(i + 1) are adjusted, latus P(i) is deleted from polygon P , and a new latus l is inserted into polygon P. Mesh grading is propagated as follows: D(l) = (D(P( i -1 ) )+D(P( i+I ) ) ) /2 , RS~I) := R E ( P ( i - 1 ) ) - D ( P ( i - 1 ) ) , RE(l) = RS(P( i + 1)) + D(P(i + 1)).

Mesh elements in polygon S can be generated as follows. If len < a * r/2, then N(l) = 1, and two triangular elements are formed by connecting the sho~ter diagonal (see Fig.9(a)). Otherwise, the midpoint of line I is inserted on the line as a mesh node, N(l) = 2. By connecting the shorter diagonal, three triangular elements are formed (see Fig.9(b)). We connect the shorter diagonal in order to get elements with bet ter shape.

5.4 A n Example of Mesh Grading Propagat ion in a Reg ion

An example is given in Fig.10 to show how the shrinking polygons propagate boundary mesh gradings into the interior of the region. In Fig.10, Step 1 cuts off a corner. Step 2 cuts off a latus. Step 3 generates a shrinking polygon. Step 4 cuts

Page 10: A new approach to fully automatic mesh generation

500 J. of Comput. Sci. & Technol. Vol. 10

off a corner. Step 5 generates a shrinking polygon. Step 6 cuts off two latera. Step 7 generates a shrinking polygon. Step 8 generates a shrinking polygon too. Step 9 cuts off a corner and a latus. Step 10 cuts off a latus. Step 11 cuts off six latera one by one. Step 12, step 13, and step 14 cut off a corner, a latus, and two corners, respectively. Step 15 generates the last shrinking polygon which degenerates to a point. Step 16 performs a smoothing.

6 Tr iangu la t ion of a C o n v e x P o l y g o n

6.1 A l g o r i t h m f o r G e n e r a t i n g T r i a n g u l a r M e s h o f a C o n v e x R e g i o n

The algorithm for generating triangular mesh of a convex region is outlined as follows. Here, P is a convex polygon whose boundary has been discretized with mesh grading propagation in line. Details will be discussed in what follows.

P R O C E D U R E mesh-convex-polygon(P) begin 1. while (P is not a null-set) do 2. begin 3. Corners and latera which meet some conditions are cut off in order to avoid bad

shaped element and invalid mesh. 4. If the boundary of P has less than four mesh nodes, then the last one/two triangular

element(s) is(are) formed and mesh generation is terminated. Return from this procedure.

5. Vertices of shrinking polygon Q of polygon P are determined with the method discussed above.

6. Vertices in Q whose distances are shorter than a threshold value are merged. 7. Boundary of Q is discretized with mesh grading propagation in line. 8. Mesh gradings of Q are adjusted with mesh grading propagation rules discussed

above. 9. Mesh between P and Q is generated. 10. Null latera and duplicate latera in Q are deleted. 11. If Q is a concave p61ygon, it is decomposed into several convex polygons using the

method discussed in Section 4. Recursively call mesh-convex-polygon(Q') for every convex polygon Q'. Return from this procedure.

12. P is replaced by Q. 13. end of while endp

6.2 C o n d i t i o n o f T e r m i n a t i n g F o r m i n g S h r i n k i n g P o l y g o n

Condit ion of terminating forming shrinking polygon of polygon P is tha t the boundary of P has less than four mesh nodes. One or two triangle element(s) is (axe) formed (see Fig.11).

6 .3 M e r g e V e r t i c e s o f S h r i n k i n g P o l y g o n

After generating the vertices of shrinking polygon, check must be performed to see if some vertices are too close since this will introduce bad shaped element into mesh.

Page 11: A new approach to fully automatic mesh generation

No. 6 An Approach to Fully Automatic Mesh Generation 501

(13)

(~)

(4) (s)

(~) (8)

(2) (3)

(6)

(9)

(1o) (11) (12)

(14) (15) (16)

Fig.lO. An example of mesh grading propagation in a region.

Page 12: A new approach to fully automatic mesh generation

502 J. of Comput. Sci. & Technol. Vol. 10

Fig.l 1. Condition of terminating the algorithm.

Let dis be the distance between P S ( Q ( i ) ) and P E ( Q ( i ) ) , r = ( R S ( P ( i ) ) + R E ( P ( i ) ) ) I 2 . If dis <_ ~ * r ((~ = 0.5 in the implementation of the algorithm), then the two vertices P S ( Q ( i ) ) and P E ( Q ( i ) ) are merged (see Fig.12). That is to say, N ( Q ( i ) ) = 0 and coordinates of the midpoint of F S ( q ( i ) ) P E ( Q ( i ) ) are assigned to P S ( Q ( i ) ) , P E ( Q ( i ) ) , P E ( Q ( i - 1)) and P S ( Q ( i + 1)).

6.4 M e s h G e n e r a t i o n b e t w e e n P o l y g o n P a n d I t s S h r i n k i n g P o l y g o n Q

Mesh between polygon P and its shrinking polygon Q can be generated by mesh- ing quadrilaterals P S ( P ( i ) ) P E ( P ( i ) ) P E ( Q ( i ) ) P S ( Q ( i ) ) (denoted as Q V m D ( i ) )

corresponding to latus P(i ) . Q U A D ( i ) can be meshed in linear time O ( N ( P ( i ) ) + N ( Q ( i ) ) ) using the following algorithm which generates a Delaunay triangulation. The process of generating mesh between a polygon and its shrinking polygon can be seen in Fig.10.

P R O C E D U R E mesh-strip(Q UA D(i)) begin

ni = N(Q(i)); nt = N(P( i ) ) ;p = PS(P(i)); q = PS(Q(i)); while (hi > 0) and (nt > 0) do

{ if (triangle NEXT(q)p.q is a Delaunay triangle, i.e., its circumcircle contains neither point N E X T ( p ) nor point N E X T ( N E X T ( q ) ) ) then

{ Triangular element N E X T ( q ) p q is formed; q = N E X T ( q ) ; n i = ni - 1; }

else { Triangular element NEXT('p)pq is formed;

p = N E X T ( p ) ; n t . = nt - 1; } } /* end of while (hi > O) and (nt > 0) do */

while (nt > 0) do { Triangular element N E X T ( p ) p q is formed;

p = N E X T ( p ) ; n t = nt - 1; } while (ni > O) do

{ Triangular element N E X T ( q ) p q is formed; q = N E X T ( q ) ; n i = ni - I; }

endp.

This algorithm generates Delaunay triangulation for every quadrilateral QUAD(i) . Proof is given as follows. All internal edges of this triangulation are apparently lo- cally optimal (concept of locally optimal can be found in [18]). Since a triangulation T of a finite set V is a Delaunay triangulation if and only if all internal edges of T are locally optimal[IS], so the mesh generated by the above algorithm is a Delaunay triangulation.

Page 13: A new approach to fully automatic mesh generation

No. 6 An Approach to Fully Automatic Mesh Generation 503

p4 P3 P4 P3

\ . . . . .......

p6 P p1 1~ p Pl

Fig.12. Merge vertices of shrinking polygon.

6 .5 D e l e t e N u l l L a t e r a a n d D u p l i c a t e L a t e r a in S h r i n k i n g P o l y g o n

Latus Q(i) is called a null latus if N(Q(i)) = 0, i.e., PS(Q(i) ) = PE(Q(i) ) ("=" means they are the same point). Given two latera I and m, they are called duplicate latera if PS(1) -- P E ( m ) and PE(1) = PS(m) .

After generating mesh between polygon P and its shrinking polygon Q, null latera and duplicate latera are deleted from polygon Q. In Fig.12, null latus qlq2 must be deleted. In Fig.13, duplicate latera qaq2, q3q4 must be deleted. Sometimes Q becomes a null-set after deleting (this situation occurs in Step 15 in Fig.10), which means that mesh generation has been finished.

For duplicate latera, the algorithm guarantees that these two latera have the same mesh nodes when it discretizes boundary, and hence a correct mesh will be formed (see Fig.14).

p4 p3

Fig.13. Duplicate Intern qxq2, q3q4 must be deleted.

P4 P3 \ \ \ , /

Fig.14. Form mesh of Fig.13.

Fig. 15 Fig. 16

Page 14: A new approach to fully automatic mesh generation

504 J. of Comput. Sci. & Technol. Vol. 10

Fig. 17 Fig. 18

Fig. 19

Page 15: A new approach to fully automatic mesh generation

No. 6 An Approach to Fully Automat ic Mesh Generation 505

h.__

Page 16: A new approach to fully automatic mesh generation

506 J. of Comput. Sci. & Technol. Vol. 10

443.0

,50.0

20.0

.~- p__ 10.0

, . . _ i

0.0 v~

-10.0

U3 -20,0

-30 .0

-40.0

Stress St reng th Principal Stress Per ipher ic Stress

/, /

f i

f

o 1 o 2o 2o ~ so ~o 70 so Node Number

Fig.22. Finite element analysis result using the mesh of Fig.2O.

4~.0

~.0

20.0

[3- 10.0

0,0

-10.0 U')

-20.0

-50 ,0

-40 .0

Stress Strength Principal Stress Peripheric St ress

i s

t

z

I/

s

z0 40 so so lo0 120 14o Node Number

Fig.23. Finite element analysis result using the mesh of Fig.21.

7 Examples and Conclusion A method based on mesh grading propagation which automatically produces a

triangular mesh in an arbitrary planar region is presented in this paper. The new method has been implemented in MS-WINDOWS 3.1. Fig.15 to Fig.21 are the re- sults generated by the method. Fig.22 and Fig.23 are the finite element analysis results using the meshes of Fig.20 and Fig.21, respectively. Experiments show that the algorithm generates satisfactory quasi-uniform mesh whose element shapes are close to equilateral triangle and whose mesh size varies smoothly over the region. It can conveniently define and control mesh gradings and automatically propagate them. I t runs fully automatically in optimal time, which makes it possible to inte- grate finite element analysis with fully automatic CIMS.

Page 17: A new approach to fully automatic mesh generation

No. 6 An Approach to Fully Automatic Mesh Generat ion 507

R e f e r e n c e s

[1] Haber R et al. A general two-dimensional, graphical finite element preprocessor utilizing dis- crete transfinite mappings. Int'l J. Numer. Methods Eng., 1981, 17(7): 1015-1044.

[2] Yerry M A, Shephard M S. A modified quadtree approach to finite element mesh generation. IEEE CG&A, 1983, 3(1): 39-46.

[3] Baehmann P Let al. Robust, geometrically based, automatic two-dimensional mesh generation. lnt ' l J. Numer. Methods Eng., 1987, 24(6): 1043-1078.

[4] Sadek E A. A scheme for the automatic generation of triangular finite elements. Int ' l J. Nume.r Methods Eng., 1980, 15(12): 1813-1822.

[5] Deljouie-Rakhshandeh K. An approach to the generation of triangular grids possessing few obtuse triangles. Int.l J. Numer. Methods Eng., 1990, 29(6): 1299-1321.

[6] Jin H, Wiberg N. Two-dimensional mesh generation, adaptive remeshing and refinement, lnt'l J. Numer. Methods Eng., 1990, 29(7): 1501-1526.

[7] Zhu J Z et al. A new approach to the development of automatic quadrilateral mesh generation. Int. 'l J. Numer. Methods Eng., 1991, 32(4): 849-866.

[8] Shaw R D, Pitchen R G. Modifications to the Suhara-Fukuda method of network generation. Int'l J. Numer. Methods Eng., 1978, 12(1): 93-99.

[9] Cavendish J C. Automatic triangulation of arbitrary planar domains for the finite element method, lnt'l J. Numer. Methods Eng., 1974, 8(4): 679-696.

[10] Sapidis N, Perucchio R. Delaunay triangulation of arbitrarily shaped planar domains. Computer Aided Geometric Design, 1991, 8(6): 421-437.

[11] Joe B. Delaunay triangular meshes in convex polygons. SIAM J Scientific and Statistical Com- puting, 1986, 7(2): 514-539.

.[12] Bhatia R P, Lawrence K L. Two-dimensional finite element mesh generation based on stripwise automatic triangulation. Computers & Structures, 1990, 36(2): 309-319.

[13] Blacker T D, Stephenson M B. Paving: A new approach to automated quadrilateral mesh generation. Int'l J. Numer. Methods Eng., 1991, 32(4): 811-847.

[14] Joe B, Simpson R B. Triangular meshes for regions of complicated shape. Int'l J. Numer. Methods Eng., 1986, 23(5): 751-778.

[151 Sezer L, Zeid I. Automatic quadrilateral/triangular free-form mesh generation for planar re- gions. Int'l J. Numer. Methods Eng., 1991, 32(7): 1441-1483.

[16] Talbert J A, Parkinson A R. Development of an automatic, two-dimensional finite element mesh generator using quadrilateral elements and bezier curve boundary definition, lnt'l J. Numer. Methods Eng., 1990, 29(7): 1551-1567.

[17] Parthasarathy V N, Kodiyalam S. A constrained optimization approach to finite element mesh smoothing. Finite Elements in Analysis and Design, 1991, 9(4): 309-320.

[18] Lee D T, Schachter B J. Two algorithm-q for constructing a Delaunay triangulation. Int. J. Computer and Information Sciences, 1980, 9(3): 219-242.

[19] Bykat B. Automatic generation of triangular grid: I - subdivision of a general polygon into

convex subregions. 1] - triangulation of convex polygons. Int'l J. Numer. Methods Eng., 1976, 10(6): 1329-1342.

M i n W e l d o n g is a Lecturer in the Depar tment of Computer Science and Technology, Tsinghua University. He received his B.E., M.E. and Ph.D. degrees from Tsinghua University in 1989, 1991 and 1995, respectively. His research interests include computat ional geometry,

Page 18: A new approach to fully automatic mesh generation

508 J. of Comput. Sci. & Technol. Vol. 10

computer graphics and computer aided design. He is currently a postdoctor in the University of Alberta in Canada (Emaih [email protected]).

Tang Zesheng is a Professor of Department of Computer Science and Technology, Tsinghua University. From 1985 to 1986, he visited The University of Michigan and worked in XEROX Palo Alto Research Center in California. His current research interests include scienctific visualization and computational geometry. He is the Vice Chairman of CAD and Computer Graphics Society of China Computer Federation, and a member of the Computer Engineering and Application Society of China Electronic Institute.

Zhang Zhengming is an Assistant Lecturer. He obtained his B.E. and M.E. degrees from Tsinghua University in 1990 and 1993, respectively. His current research area is struc- ture analysis of nuclear reactor.

Zhou Yu is a Associate Professor. He obtained his B.E. degree from Peking University in 1982 and his M.E. degree from Tsinghua University in 1988. his research area is structure analysis of nuclear reactor.

W a n g Minzhi is a Lecturer. She received her B.E. and M.E. degrees from Tsinghua University in 1988 and 1993, respectively. Her current research area is structure analysis of nuclear reactor.