OOF: Finite Element Analysis of Microstructures
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.