Techniqueadvanced
Mesh untangling
Also called inverted element repair.
Moves vertices to make every element Jacobian positive by maximising the smallest signed volume, as Knupp and Freitag and Plassmann proposed, before smoothing.
Mesh untangling repairs a mesh in which some elements are inverted, that is, turned inside out, with a negative signed area, volume or Jacobian determinant. Such elements appear when a mesh is moved to follow a deforming body, when a smoother such as Laplacian smoothing moves a vertex outside the region where its elements are valid, or when a hexahedral mesh is projected onto a curved boundary. A finite element code cannot use an inverted element, and quality measures that assume positive volume give wrong answers on it. Untangling moves the free vertices, keeping the boundary and the connectivity fixed, so that every signed volume becomes positive. Freitag and Plassmann solve one vertex at a time as a linear program; Knupp minimises a convex penalty on the negative Jacobians. Both are followed by smoothing, because an untangled mesh is valid but often poor.
In plain words
Some tiles of a mesh are folded over, like a sheet of paper creased back on itself. Each tile has a signed size: positive when it lies the right way up, negative when it is folded. The task is to slide the inner corner points, without changing which corners make each tile, until every tile has a positive size.
Take one corner point and the ring of tiles around it. The size of each tile changes in a straight line as the point moves. So the question "where should the point go to make the smallest size as large as possible" is a linear program, which has an exact answer. If the best smallest size is positive, the ring is fixed. If it is not, no place for this point can fix the ring, and other points or the connections must change.
When it applies
- The mesh has a fixed connectivity and some elements with negative signed area, volume or Jacobian determinant at a corner.
- Some vertices may move; usually the boundary vertices are fixed, or may move only along the boundary.
- For triangles and tetrahedra, the signed volume is affine in the position of any one vertex. This is what makes the local problem linear and the penalty convex. For quadrilaterals and hexahedra, the Jacobian determinant at each corner is the signed volume of the corner tetrahedron, so the same holds corner by corner.
- It does not apply when the region around a vertex has no valid position at all. Then the problem needs moves of several vertices together, edge flips or a remesh.
The template
For a free vertex with star elements , let be the signed area of (twice the area, or the Jacobian determinant, gives the same results). Each is affine in .
UNTANGLE(mesh, free vertices)- 1
repeat - 2
for each free vertex x with an inverted element in its star do - 3
solve the linear program: maximise t subject to α_i(x) ≥ t for i = 1, ..., m - 4
if the optimum t* > 0 then move x to the optimal position - 5
else note that the star of x has no valid position - 6
until no element is inverted, or no move helps - 7
smooth the mesh with a method that keeps the elements valid
Why the linear program decides it. The kernel of the star is the set of positions with all . If the kernel contains a point , then is feasible with , so . Conversely, if , the optimal position has every , so it is in the kernel. The program is bounded: for the signed areas of a star in the plane, is the area of the link polygon for every , by the shoelace formula, so . The program has 3 variables in 2D and 4 in 3D, and constraints, so the simplex method or any small LP solver finds the exact optimum quickly. Freitag and Plassmann used the simplex method. The optimum is not only valid but as far from inversion as possible, which is a good start for smoothing.
Knupp's penalty. Knupp minimises, over all free vertices together or one at a time,
where is the Jacobian determinant at corner and is a small target. A corner with costs nothing; a corner below costs twice its shortfall. So exactly when every corner has , and then the mesh is untangled. As a function of one vertex position, each is affine and is convex, so is a convex function of that vertex, and a local minimum over one vertex is global. Over all vertices together, is a polynomial of degree 2 or 3 in the coordinates and is not convex.
Classic examples
An arrow-shaped star. The link polygon , , , , , has a notch at . Laplacian smoothing puts the free vertex at the mean of the link, , beyond the notch, and the six signed areas are , , , , and . Two triangles are folded. The linear program, solved exactly by checking the vertices of the feasible region, gives at , where the signed areas are , , , , , . They sum to 17, the area of the link polygon, as the shoelace identity says. Knupp's penalty with and equal to twice the area is at the Laplacian position and at the LP optimum.
A star with no valid position. The U-shaped link , , , , , , , has an edge from down to , whose left side is , and an edge from up to , whose left side is . No point is on both sides, so the kernel is empty. The linear program confirms it: , at , where three triangles still have signed area . Moving this vertex alone cannot untangle the star; a neighbour must move, or the connectivity must change.
Mesh motion. When a boundary moves, as in a fluid and structure computation, the interior vertices follow by some rule, and elements near a fast moving part fold. Untangling the folded region, then smoothing, keeps the mesh usable without a new mesh.
Hexahedral meshes. A hexahedral mesh projected onto a curved surface often has corners with negative Jacobian near the surface. Knupp's penalty works on the eight corner Jacobians of each hexahedron, with the interior vertices free.
Variations
- Global versus local. The LP is local, one vertex at a time, in Gauss-Seidel sweeps. Knupp's penalty can be minimised over all vertices together with a gradient method, which moves several vertices at once and can fix stars that no single move fixes.
- Shifted barriers. Escobar, Montenegro and coauthors replaced the volume by a regularised value inside a smooth quality measure, so that one smooth objective untangles and smooths at the same time.
- Boundary vertices. Allowing boundary vertices to slide along the boundary curve or surface enlarges the kernel and fixes many cases near curved boundaries.
- Connectivity changes. When the kernel is empty, an edge flip in 2D or a face or edge flip in 3D, as in topological tetrahedral mesh improvement, changes the star.
- After untangling. Optimization-based mesh smoothing then raises the worst quality and keeps every element valid, because it accepts only moves that stay in the kernel.
Pitfalls
- Smoothing a tangled mesh. Many quality measures are positive for a folded element, for example those built from edge lengths only. A smoother that uses them can make a tangled mesh look good. Untangle with a signed measure first.
- Float signs. A nearly flat element can get the wrong sign. Use exact orientation and volume tests to decide whether an element is inverted.
- Empty kernel. If , no position of that vertex works. Repeating the local step does not help; move neighbours, flip, or remesh.
- Stopping at only just. An LP optimum with a tiny is valid but almost flat. Smooth after untangling.
- Corner Jacobians of hexahedra. For a hexahedron, positive Jacobians at the eight corners do not imply a positive Jacobian everywhere inside, because the Jacobian is not linear. Check more points, or use a sufficient condition, when this matters.
- Choosing . With , Knupp's penalty is zero for a mesh that has flat elements. A small positive , a fraction of the mean element size, pushes elements away from zero.
Exercises
- Show that for the signed areas of a star in the plane, does not depend on , and conclude that . Deduce that a link polygon with negative or zero signed area has no valid position.
- Show that for a tetrahedron the signed volume is affine in each vertex, and write the linear program of one free vertex in 3D. How many variables does it have?
References
- Lori A. Freitag and Paul Plassmann, Local optimization-based simplicial mesh untangling and improvement, International Journal for Numerical Methods in Engineering 49(1-2), 2000, 109 to 125, the untangling of one vertex as a linear program that maximises the smallest signed area or volume, solved by the simplex method, followed by smoothing (general locator)
- Patrick M. Knupp, Hexahedral and tetrahedral mesh untangling, Engineering with Computers 17(3), 2001, 261 to 268, the untangling objective, the sum of |alpha - beta| - (alpha - beta) over the corner Jacobian determinants, for tetrahedra and hexahedra (general locator)
- Pascal Jean Frey and Paul-Louis George, Mesh Generation, Application to Finite Elements, 2nd edition, ISTE and Wiley, 2008, chapter 18 (mesh optimisation)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 876K96 Edit this page History Report an error Markdown