OOF: Finite Element Analysis of Microstructures

/adaptive_mesh/swap_worst

/adaptive_mesh/swap_worst

/adaptive_mesh/swap_worst -- swap lots of edges

Synopsis

This function attempts to perform an edge swap on all pairs of adjacent triangles, accepting the swap if it results in a lower total mesh-energy E. The triangles with the largest (worst) E are examined first.

swap_worst and its cousin /adaptive_mesh/swap_two, are most useful when as a result of annealing or mesh refinement a pair of triangles straddles a material boundary, with their shared edge perpendicular to the boundary. In such a case, it is very difficult for annealing to realign the errant edge, but swap_worst will do it immediately, as shown in Figure 4.4. Effect of the swap_worst function.

Figure 4.4. Effect of the swap_worst function

A mesh with two pairs of triangles straddling a material boundary. /adaptive_mesh/anneal is unlikely to be able to make the element edges follow the boundary.

The same mesh after applying the /adaptive_mesh/swap_worst function.