# Isotropic Mesh Adaptation

GRUMMP's approach to isotropic mesh adaptation is to apply a concatenation of existing functionality to produce a high-quality mesh that meets the specified length scale requirement. (See Section 2.1 for information on how to specify a length scale.) This is done as the first step in mesh optimization (executables `meshopt2d` and `meshopt3d`). The steps taken are:

1. Coarsen the mesh where necessary to make sure vertices are not too close together (where ``too close'' means that the distance between them is less than the average of their length scales).
2. Swap the mesh to make it Delaunay; this step is a necessary prerequisite to mesh refinement.
3. Refine the mesh to ensure that no cells are larger than the local length scale and that no badly-shaped cells remain. This step is identical to what GRUMMP does in generating a mesh after the initial triangulation / tetrahedralization is complete.
4. Postprocessing by smoothing and swapping. In 2D, two passes of smoothing are sufficient to ensure excellent meshes in both theory and practice. In 3D, some swapping is typically required to eliminate slivers, which the insertion process alone cannot remove.

If this sounds simple, that's because it is: the driver for this process has eight lines of code, not counting diagnostic output, comments, and blank lines.