OOF: Finite Element Analysis of Microstructures

/adaptive_mesh/swap_two

/adaptive_mesh/swap_two

/adaptive_mesh/swap_two -- move a single edge

Synopsis

If two triangular elements share a common edge and together form a convex quadrilateral, then the shared edge forms a diagonal of the quadrilateral. These two triangles can be replaced by two triangles whose common edge joins the other two corners of the quadrilateral, as shown in Figure 4.3. Definition of an edge swap. This is what we mean by an edge swap.

Figure 4.3. Definition of an edge swap

The two light triangles have undergone an edge swap between the two images.

If two adjacent triangles have been selected (with the Mesh dashboard), and they form a convex quadrilateral, then the swap_two function performs an edge swap on the triangles. It is an error to use this function if there are not exactly two triangles selected, or if they don't form a convex quadrilateral.

To apply edge swapping automatically where it's most needed, use the /adaptive_mesh/swap_worst function.