A Global Minimization-Based, Automatic Quadrilateral Meshing Algorithm Paul Wolfenbarger (
[email protected])1 Joseph Jung (
[email protected]) 2 Clark R. Dohrmann (
[email protected])2 Walter R. Witkowski (
[email protected]) 2 Malcolm J. Panthaki(
[email protected])3 Walter H. Gerstle (
[email protected])1
Abstract: A novel method is presented for automatically generating quadrilateral meshes on arbitrary two-dimensional domains. Global minimization of a potential function governs mesh formation and characteristics. Comprised of several terms, the potential function distributes the elements throughout the domain and aligns the edges of the elements to form valid connectivities. If there are any remaining unlinked element edges, the local connectivity is examined and a \hole elimination" algorithm is applied that successively nds alternative connectivities. Unlinked edges, representing holes in the mesh, are moved to either coalesce, or to a boundary. The components of the potential, the minimization procedure, and the connectivity re nement algorithm are presented. The method shows promise for extension to automatic three-dimensional hexahedral meshing. Initial conditions required to ensure mesh closure include an even number of elements on the boundary and a closed boundary. The desired mesh characteristics are programmed into the algorithm. A Poisson's solution scheme is utilized to generate a better initial placement, density, size and orientation of elements, leading to faster and more robust mesh closure. A number of example geometries have been meshed. Keywords: Automatic quadrilateral meshing, global minimization-based meshing, mesh, computational mechanics.
1. Introduction and Motivation The use of nite element codes is accelerating in industry, science, and academia [10]. Driven by cheaper computing, shorter design cycles, and costlier laboratory and destructive testing, this acceleration is taxing the ability of analysts to keep pace. In an attempt to shorten the design cycle, and to allow the analyst to focus on the results, many codes are turning to automated generation of meshes. In fact many modern designs require meshes which if generated by hand would take longer than the entire allotted design cycle [19, 13]. Evolutionary problems (where the model changes as the analysis progresses) and adaptive mesh re nement procedures also require robust, reliable and repeatable automatic mesh generation algorithms. Many problems plague current methods for generating unstructured meshes. The most often used meshes are triangular/tetrahedral and quadrilateral/hexahedral meshes. Triangular/tetrahedral meshing is well understood, but many analysts dislike triangular/tetrahedral meshes. This dislike is due to the fact that triangular/tetrahedral meshes are inherently stier than quadrilateral/hexahedral meshes. This forces the use of more, or higher order, elements to produce the same level of accuracy [1, 12]. No reliable, widely Department of Civil Engineering, University of New Mexico (UNM), Albuquerque, NM 87131 Sandia National Laboratories, Albuquerque, NM 87185 (The portion of this work performed at Sandia National Laboratories was supported by the United States Department of Energy under Contract Number DE-AC04-94AL85000.) 3 Independent Engineering Software Consultant and Senior Research Engineer at the Albuquerque High Performance Computing Center, Albuquerque, NM 87131 1 2
accepted method of automatically generating good quality, unstructured, quadrilateral or hexahedral meshes has been adopted. The current state of the art in the eld of quadrilateral meshing is the Paving algorithm which has some problems closing local discontinuities such as two elements needing to attach to ve elements or two elements overlapping in space. These discontinuities occur when multiple advancing fronts of elements converge at \unacceptable" angles and densities [20]. Several other reliable but less accepted or less automatic algorithms are available [2]. In an attempt to nd a new approach to these problems, Sandia National Labs and the University of New Mexico have developed a new algorithm. This algorithm is based on using a 2D particle model to govern the movement of each element and then forming links between particles to create a completed mesh. By creating a generalized functional that relates each quadrilateral element directly to the geometry and to the other elements, the global problem is discretized without a loss of generality. Using methods borrowed from physics, chemistry, and other scienti c computational methods, a \mostly connected" mesh is created. Topologically-based connectivity improvement techniques are then utilized to close the remainder of the mesh. While mesh re nement is sometimes useful to alleviate the problem of acute angles, no smoothing is required as the global minimization algorithm uses a technique very similar to existing mesh smoothing algorithms (known as Relaxation Smoothing [8]) to smooth the mesh during its creation. During the course of developing this method, it was necessary to create an infrastructure which would allow the algorithm to be easily studied and debugged, and allow exibility in the data structure of the mesh at various stages of the mesh creation. To this end, the meshing tool was implemented in the CoMeT (Computational Mechanics Toolkit) framework which is described in detail by Panthaki et. al. [15]. (Additional information on the CoMeT framework can be obtained at http://www.arc.unm.edu/CoMeT). A new meshing subsystem was added to CoMeT to facilitate development of this and other mesh generation schemes. CoMeT provides software utilities that allow the algorithm developer to graphically view the state of the mesh during execution. CoMeT also provides an interpreted, extensible language that is used to modify, test and debug the meshing algorithm. Changes can be made to the ow of the algorithm, often without the need to modify any of the underlying C++ code. These changes allow the algorithm developer to interactively modify and test various algorithmic parameters including the actual ow of the algorithm and proved useful during the developmental stages of this meshing tool. The graphical debugging tools and animation tools, of course, provided insight into the runtime behavior of the meshing algorithm. While still a prototype tool, this meshing algorithm is a considerable step toward meeting the goal of robust, fully-automatic all quadrilateral mesh generation over arbitrary two-dimensional domains. The essence of the algorithm is promising for extension to fully-automatic three-dimensional hexahedral meshing. Furthermore, the mesh subsystem developed in CoMeT will make future research on advanced meshing algorithms much simpler. So far, all the research has been targeted towards achieving robust closure of meshes (resulting in a topologically-valid quadrilateral mesh) using any arbitrary, user-speci ed number of elements over any arbitrary two-dimensional domain. Little emphasis has been given to either the nal quality of the resulting mesh or the computational eciency of the algorithm. The next phase of the research will address these issues as their resolution is critical to the eventual adoption of this algorithm into analysts' tool box of meshing tools.
2. Global Minimization-Based Quadrilateral Meshing Algorithm A functional is used to drive a dynamic simulation in a manner similar to computational chemistry and molecular biology simulations [4, 11, 6]. Use of a functional to represent desirable relationships between elements, the geometry and other elements makes the method extensible to 3D or to generalized surface meshing. Only the functional needs to be changed to modify the bulk of the program's behavior. An implicit goal of the method is to minimize the user input required to create a topologically-valid, high quality mesh that captures the geometry of the domain as well as it can, using the criteria speci ed by the user.
2.1. Overview of the Algorithm In creating a meshing tool that provides a global approach to all the various stages of mesh generation, all data are distributed at the lowest possible object level. All particles have the same level of knowledge about their surrounding conditions and act as independently as possible. A number of methods were borrowed from particle physics, and molecular dynamics to control element movement and linking, with the nal mesh being completed using one of several methods developed for coalescing \holes", (see Figure 1), or removing them at the mesh boundary. After establishing the 2D geometry, particles are placed using one of several user-prescribed methods as described below. At present the main constraint on particle placement is that a layer of elements must be attached to the domain boundary. Also the system is designed to allow the particle size to be de ned according to user criteria. The initial size for a particle is maintained throughout the algorithm. The functional is then applied to control the movement of the particles in several phases.
Triangular "Hole" Quadrialteral Elements
Figure 1. Detail of a Mesh Which Shows a Triangular Hole Between Quadrilateral Elements.
Initially a boundary mesh of particles is attached to each boundary of the domain, and interior particles are placed as directed by the user (see Section 2.2).
The second phase of the simulation distributes the particles throughout the domain to be meshed, using
simple particle-to-particle and particle-to-boundary repulsive forces as described in Section 2.3.2. The simulation then runs until an equilibrium (within a user-speci ed tolerance) position is reached. In cases where the initial input is known to have good gradation(e.g., Poisson placement [9]), this step may be omitted. For the third phase, each particle nds the best match it can for each arm end (see Section 2.3.3) and creates a link. In a similar fashion to the way atoms form covalent bonds to form a molecule, each arm then has an attractive force based on the distance to its bond partner (see Section 2.3.4). Each link also creates a force to align each particle as well as possible with the other particles to which the particle is linked (see Section 2.3.4). When the original input is not well graded, this phase is continued until the system is deemed to be in an approximate state of force equilibrium. In the nal phase, the algorithm locates the unlinked particle arms and determines the best closure states of the \holes" they belong to (see Section 2.4). These holes are then coalesced or moved to the boundary to close the mesh.
The result is a closed, topologically valid quadrilateral mesh containing approximately the distribution of elements speci ed by the user. Note that the nal phase of the algorithm may result in the addition or removal of a few elements on the boundary - future improvements will work to eliminate this aspect of the algorithm as it interferes with the need to maintain mesh compatibility across shared domain boundaries.
2.2. Initial Particle Placement As with any nonlinear problem, the closer the initial guess is to the nal solution, the shorter the time to convergence. In this research there are also multiple solutions and it has been found that better initial conditions also favor better nished meshes.
Particle Link
a) Completed Particle Mesh Using Random Placement
b) Completed Particle Mesh Using Poisson's Placement
Figure 2. Comparison of Two Initial Placement Methods - Dual Representation
a) Completed Quadrilateral Mesh Using Random Placement
b) Completed Quadrilateral Mesh Using Poisson's Placement
Figure 3. Comparison of Two Initial Placement Methods - Quadrilateral Mesh Representation
As an example, two meshes of a dog-bone shape are shown in Figure 2. The top series was created using an initially random placement. This method simply places a prede ned number of particles evenly spaced on the boundary and then scatters the remainder randomly throughout the interior. In this case 235 particles were used to mesh the gure with 81 of them on the boundary. The bottom gure is a comparable mesh created using a placement technique called Poisson's placement method based on a local feature size, which is calculated using a boundary integral solution [9]. The Poisson's placement method created a mesh which was smoother around the corners and had a much better gradation of element size. Also, due to better initial conditions (distribution, size and orientation of the particles), the Poisson's mesh took about a third of the time to close when compared to the time it took to close the mesh using the random placement method. In both gures there are clumps of particles which represent areas that did not run to complete equilibrium or where a hole was driven to the boundary. Large holes caused by coalescing holes which do not complement each other well such as the one shown in Figure 2(b) also occur. Figure 3 shows the resulting meshes for the same gures. Inspection of these meshes shows that the large open areas produce the worst type of elements with acute included angles and a high number of elements sharing a single node. Eorts are underway to eliminate these two related problems. Another placement method used consists of placing all of the interior particles in a box smaller than the area to be meshed. Other methods have been considered including partial results of other meshing tools in the same manner as the Poisson placement method. At present, the only constraint on initial particle placement is that a layer of particles must rst be attached to the boundary. This helps to constrain interior particles from leaving the domain during the minimization phase. The functional is then applied to control the movement of the interior particles in the domain, with the goal of distributing the particles appropriately. Any method can be used for initial particle placement over the domain so long as this constraint is met.
2.3. Functional De nition The functional, , is a set of relations between the particles and their environment which govern how the particles behave. To de ne the functional the particle is rst de ned and then the parts of the functional = ParticleRepulsion + ArmAttraction + ArmAlignment + Damping are examined. Each part of the functional is described in a separate section. The complete functional is P = ni=1 f
!2 m !2 X l l I I CR ????! + CR ????! + jCi Cx j jCi BX j x=1 X =1 2 ? ???? ! CA jAik Ajl j + ! ???????! CRot (? A??? ik Ajl Cik AI (k?1) )2 g n X
(Particle Repulsion ? see Section 2:3:2:) (Arm Attraction ? see Section 2:3:4:) (Arm Alignment ? see Section 2:3:5:) (1)
and viscous Damping is de ned as
Damping =
n X i=1
fCD
trans
Vi + CDrot !i g
(Damping ? see Section 2:3:6:) (2)
This functional represents the dierential equation of motion for the particle which the program must solve. The entire algorithm can be thought of as simply a way to minimize the functional as a scalar representation
of the state of the particles. Note that the form of the functional is a fairly simple one which was chosen for proof of concept and development. For instance, the repulsive potential is set as a basic inverse power relation but a Lennard-Jones potential could instead be used in its place [6, 3]. The fact that the algorithm's driving dierential equation is simple to change and is loosely coupled to the system insures mesh closure, making the algorithm provably robust. In subsequent sections, we will examine how the particle moves in response to the functional and what this means in terms of reproducibility.
2.3.1. Particle Description Figure 4 shows the basic particle used in the simulation as a dual representation of a quadrilateral element. A particle consists of a location (Ci (x; y)), size (li ), and orientation () along with dynamic information used in the simulation. For each particle we de ne ve positions. Ck for the center and four Akn for the ends of each particle arm. This allows us to de ne each arm as a vector which will be useful in the functional. Since the rigid particle is potentially rotating, we do not actually store all of these positions but instead store position Ck and angle de ning the particle's rotation from the horizontal.
Arm Ak1 ψ
θ
Ak2
Element
k CK
Ak4
Horizon Reference
Ak3 li
Particle k(x,y)
Figure 4. Schematic of a Particle (Dual of Quadrilateral Element)
is the relative angle from arm number one to the arm for which we need information. Note that the particle arms are xed at a 90 relationship to each other, so that no storage of this information is required. As links can be formed at any angle, it was found that allowing a degree of freedom in added complexity and instability to the solution.
! The size of a particle is de ned as the distance j?C???? k Akn j where all arms will have the same length. This information is enough to allow the rapid determination of all the required vectors at a given point in time but does not require computing all of them every time Ck , , or the size changes.
The dual nature of our particle with the eventual element which will replace it is also shown in Figure 4. Although we have drawn a regular quadrilateral with no distortion, there is no such constraint on the nished mesh (see Figure 5). This can result in some elements which are severely distorted. In order to limit this as much as possible, the tool tries to maintain nodes that are shared by only four elements. While not a panacea, this does help to keep the number of vertices with small included angles to a minimum. Mesh quality could also be improved by adding another term to the functional, using a simulated annealing [6] approach to get a better initial set of links and improved link nding methods. In fact, almost any quality measure can be incorporated into the algorithm at an early stage if it can be well de ned in terms of particle-to-particle and particle-to-boundary interactions.
2.3.2. Repulsive Potential Each particle sees potential from all of the other particles and boundaries in line of sight (LOS). In Figure 6 particle \I" (Ci ) has a direct line of sight to particles \h" (Ch ), \j" (Cj ), \k" (Ck ), and \l" (Cl ). The line from the center of particle \I" to particles \o" (Co ), and \p" (Cp ) are blocked by intersecting with boundary segment \A" (BA2 ). For each of the directly seen particles, particle \I" will have a functional contribution ! lI ! , where CR is the repulsive constant de ned by the user, ? jC??? of CR ???? i Cx j is the distance between
jCi Cx j
Particle
Link
a) Dual Representation
Mesh
b) Mesh Overlaid on Dual Representation
c) Mesh Only
Figure 5. Relationship of Dual Representation and Mesh
centers of particles, lI is the nominal size of the particle \I". Since we want to keep track of the forces rather than the functional, we actually use the rst derivative with respect to position of all the functional formulas in the program. This requires less computation because it removes the exponential term. A good deal of work was done to balance the repulsive coecients (CR ) with the attractive (CA and CRot ) terms in order to have a stable simulation. The simulation is very stable after the links are formed and the forces are mostly in balance, but in the initial stages a bad combination of particle placements and constants can easily send a particle completely out of the domain. The system does not contain any functional contribution designed speci cally to handle this. The problem of particles leaving the simulation domain is dealt with by adapting the time step to a small enough size to allow the particle to remain inside the domain while the functional acts to counteract the excess velocity.
BB
Cp Co
BA Cl Ch
Ci
Ck Cj
Particle \I" will also see a contribution from boundary segment \A" since a line perpendicular to it will not cross any other boundary segments. On the other hand, no contribution is seen from boundary segment \B" (BB ), since a perpendicular line to this segment does not intersect the segment itself. Again, the functional 2 lI contribution is of the form, CR ????! , where jCi BX j all variables are the same as discussed before except that the distance j????! Ci BX j is de ned as the shortest (perpendicular) distance to the boundary segment \X".
Note that at each time step each particle must check n ? 1 other particles, either to determine Figure 6. Particle Repulsive Potential the functional contribution or to determine that no functional contribution is required due to the LOS rules. If well implemented, this can be brought from O(n2 ) to O( n(n2?1) ). This small improvement still leaves determining the repulsive potential as the main performance bottleneck. Several possible performance enhancements are under discussion, none of which have yet been implemented.
2.3.3. Link Creation Each link between two particle arms represents a shared edge between two quadrilateral elements in the 2D mesh. If an element edge lies on the domain boundary, that edge is \linked" to the geometric boundary rather than to another particle's arm. Requiring that each arm be linked to one and only one other arm or boundary ensures that upon completion a nished mesh exists with no ambiguous connections. To nd these connections a simple method was developed which nds the closest arm end in the direction that the arm points to within a prede ned angle (see gure 7). The system can also set the maximum distance at which a link will be made in terms of a multiple of the particle size. Too small a distance will result in no links at all being formed, and too large a distance will result in extra computation time. Links cannot be formed if the two ends are not within LOS as described in Section 2.3.2.
At1
New Connection ("bond")
At4
Ct At2
Target Particle
Aw At3 Cw
Target Arm Capture Zone
Working Particle
Figure 7. Capture Zone for a Particle Arm
In contrast to a molecular dynamics simulation in which all molecules feel alignment forces from all other molecules, [4] each particle arm in the simulation feels alignment forces from only the one particle arm to which it is linked. This method is used in simulated annealing where the randomness of the molecules movement is slowly reduced leaving all of the molecules closely aligned with its neighboring molecules [3]. Some thought has been given to using a generalized method until the particle links are found in order to have better aligned particles, resulting in more suitable links being made. For the 2D case the existing method functions quite well. The 3D version may require a more sophisticated solution. Several re nements have been suggested to improve the way that links are selected between multiple candidates in the search area or \Capture Zone." The current implementation the best dot product !takes ???! match between particle arms on the working and target particles, [min(? C??? w Aw Ct Atk )] with the target particle simply being the closest particle in the capture zone. As an alternative the best dot product match of all of the particle arms in the capture zone might be used. Another alternative is to assign each target arm a weight based on a fuzzy evaluation of the arm's distance, deviation from the arm angle, and dot product match [16].
2.3.4. Attractive Potential Each particle has up to four links (one per arm). These links can be attached either to other particle's arms or to a boundary as discussed in Section 2.3.3. A particle I with arm k attached to arm j of particle l will !2 see a functional contribution of CA j?A???? ik Ajl j (see Figure 8). Since the force must act through the center of the particle, an additional rotational contribution to the functional is present in the alignment potential as discussed in Section 2.3.5. It is not possible to make a link to a particle or boundary that would be out of line of sight so the LOS rules speci ed in Section 2.3.2 are implicitly accounted for.
2.3.5. Alignment Potential In most cases, any two linked arms will not be colinear. The attractive force, therefore, would not pass through the center of the particle. This results in a torque and an additional force component to rotate the
particles into alignment to match this oset. This moment is represented by a functional contribution in the ! ???????! form of CRot (? A??? ik Ajl Cik AI (k?1) )2 for particle I arm k attached to particle j arm l. Connection ("link")
Cl Aik
A jl
Ci
Force from Attractive Potential
Torque from Alignment Potential
The arms are xed at a perpendicular angle, so using AI (k?1) gives us only the component of the vector which is perpendicular to the line through the center of the particle, creating a pure torque to apply to the particle. Again these forces are only applied along existing links (see Section 2.3.3). Figure 8 shows two particles which share a link and the resultant force and moment which must be applied to the centers of the particles.
As each particle has four links and each link is shared with exactly one other particle, we have 4n=2 calculations to perform in nding both the attractive and alignment potentials. This is small by comparison to the work required for the repulsive potential.
Figure 8. Attractive Forces Due to a Link
2.3.6. Viscous Damping Finally each particle has a damping force based on its translational velocity (Vi ) and its rotational velocity (!i ). This force is in direct opposition to the direction of movement. A particle I would see a functional contribution of CDtrans Vi + CDrot !i . This reduces the amount of free vibration in the system and helps to insure that the system will reach an approximate equilibrium state.
2.3.7. Particle Movement Based on the Potential After collecting the forces and torques due to each of the parts of the potential the algorithm determines a new location, velocity and acceleration for each particle in both translational and rotational frames. A fairly standard rst-order method known as the Euler method is used for forward time integration [6]. Translational and rotational velocity tolerances for the simulation allow the algorithm to determine when it has reached equilibrium. (These trigger points are set to control the amount of expansion or other activity.) The use of nite, non-zero values for these tolerances provide the algorithm with reasonable convergence criteria, allowing it to ignore undamped high frequency vibrations that could prevent convergence of the system. By moving particles in this manner, the algorithm is reproducible. This means that if a problem occurs, it can be exactly reproduced and corrected. It also allows the system to be stopped and restarted with no loss of generality as long as the complete state of both particles and the mesh controller are maintained.
2.4. Connectivity Re nement After the link nding phase and when the system has reached a new approximate equilibrium, either the mesh will be complete, or more likely, there will be unlinked arm ends. These unlinked arms represent \holes" in the mesh. Holes are dealt with as ordered loops of particles surrounding one or more open arm ends (see Figure 9). These loops are manipulated to reduce the number of loops and/or the number of open arm ends in each loop. At the end of this iterative process, a closed mesh results.
2.4.1. Determination of Holes (Loops) Several types of loops exist. A \closed" loop is a loop with no unlinked arm ends. A loop with only a single unlinked arm is a \singleArm" loop. A loop with two unlinked arms on a single particle (of the loop) is a \doubleArm" loop. Similarly, a \tripleArm" loop has three unlinked arm ends on a single particle bounding that loop. Any loop that contains unlinked arms on two or more particles is de ned as a \compound" loop. Figure 9 illustrates each of these types of loops. This gure also illustrates the value of the debugging tool used in the program. All particles which are not completely linked are rendered in a separate user-speci ed color and the state of the simulation can be rendered as often as needed during its execution. The current list of unclosed loops in the mesh is kept up-to-date for execution eciency. Fully Linked Particle
a) Closed Loop
d) TripleArm Loop
Link
Partially Linked Particle
b) SingleArm Loop
c) DoubleArm Loop
e) Compound Loop
f) Compound Loop
Figure 9. Types of Loops
2.4.2. Movement of Holes to Close the Mesh After nding all the \unclosed" loops the algorithm begins the process of dealing with them. The goal is to remove them all, resulting in a closed, topologically valid mesh of quadrilateral elements. The loops are moved through the mesh to force them to either coalesce with other loops or to \squeeze" them out of the domain at the boundary. Loops are often in a state which can be directly reduced in complexity. This is referred to as \reducing a loop to its minimum state". Figure 10 shows a loop reduction process - the loop is not closed but its complexity
is reduced. The dashed line indicates the new link which is added to change the loop from a compound loop to a double arm loop - this is considered to be a reduction in complexity. The system is restrained to create only valid connectivities in that no crossed links are allowed, no two particles may share more than one link, and no particle may have links to itself. By restraining the possible links to the adjacent free arms in the loop we insure that the loop is never split into two loops. This reduction favors links that will create a node shared by four elements over one shared by three or ve elements, which, in turn, are favored over those which would be shared by six or more elements. This helps to improve the quality of the nal mesh. When two loops coalesce, they will either form a single loop of dierent complexity, or if they are complementary, they will result in a closed loop. For instance, two single-arm loops coalescing will either form a two arm compound loop or they will close completely as shown in Figure 11. In all cases, the overall complexity of the problem is always reduced during the process of loop coalescence. Holes moved to the boundary will either add or remove a particle to eliminate the open arm ends in a) Before Reduction a) After Reduction that loop, as shown in Figure 12. This is undesirable Figure 10. Reduction of a Compound not only because it can interfere with the requireLoop to a DoubleArm Loop ment of nodal continuity across shared boundaries with meshes on both sides but also because the total number of particles on the boundary is a user input value which the system tries to maintain as closely as possible. Hence, the preference is to coalesce loops rather than move them to a boundary. On the other hand, the ability to add or remove at least one particle from the boundary is critical in proving the mesh can always be closed [14]. In the future, the need for particle addition/removal will be reduced to only the level required to keep the algorithm provably robust. Fully Linked Particle
a) Two SingleArm Loops Which Close Upon Coalescence
Link
Partially Linked Particle
b) Two SingleArm Loops Which Form a Double Arm Loop
Figure 11. Two Possible Outcomes From Combining Two SingleArm Loops
In order to select a pair of loops to coalesce, priority is given to the following items in order. 1. Loops which share a common link are favored over those at a distance. 2. Loops which share a common particle are favored over those at a distance. 3. Loops of opposite type are preferred (loops with free arms on particles on the boundary prefer loops with all free arms on interior particles.) 4. Closer loops are preferred to more distant ones (in terms of distance between geometric centers.) Figure 13.1 shows a pair of loops which share a link. The shared link is opened and then the reduction routines discussed previously act to close the loop. The dashed link will be removed creating a single larger
Fully Linked Particle
Link
/
/
Partially Linked Particle
Removed Particle
New Particle
a) A Loop Moving out of the Boundary Which Adds a Particle
b) A Loop Moving out of the Boundary Which Deletes a Particle
Figure 12. Two Possible Outcomes From Moving a Hole to the Boundary
loop. The new loop is then reduced giving the result shown. The system again runs to an approximate equilibrium before nding another pair of loops to combine. Figure 13.2 shows two loops which share a common particle. The algorithm rst opens a link in one loop which will force it to share a link with the other loop. The link on the shared particle which is most closely aligned to the vector between the centers of the two loops is selected for removal. The dashed link has been selected for removal. After removing the selected link the two loops are now in the shared link condition and are handled accordingly.
a) Common Link Removed b) Resulting Loop Reduced 1) Joining of Two Loops Sharing an Edge
2) Joining of Two Loops Sharing a Particle
Figure 13. Two Methods of Joining Loops
In the case of a pair of loops that do not share a common particle, one loop is told to \open" itself to the other loop. This is done by nding the link which is most closely in the direction of the target loop and opening that link. These steps are repeated until the two loops share a link, and then merging is handled as described above (see Figure 14.) It is important in this case that the loop which is opening itself does not come to share a link with a loop other than the one it is merging with. The loop which is opening also must not intersect a boundary of the domain. To avoid these problems, the closest pair of loops is always selected, and a test is performed to insure that there are no boundaries between them.
3. Algorithm Analysis All work that has been done on the algorithm to date has been focused on attaining reliable mesh closure. No work has been done on improving the computational eciency of the algorithm.
Starting Condition
Particle Shared
Loop Being Reduced
Edge Shared
Single Loop Formed
Figure 14. Two Non-Adjacent Holes Moving to Coalesce
Final Loop
Finding the distance between particles to calculate the repulsive potential dominates the computation. If we assume that we have n particles and m boundary segments, then each particle must check (n + m ? 1) other items every time repulsive forces are found. This gives a total of n(n + m ? 1) operations to nd the repulsive forces. If we take advantage of the fact that the force contribution on particle I due to particle j (Fij ) is equal to the opposite of the force on particle j due to particle I (Fij = ?Fji ), we can cut this in half. If we also assume that m