Mesh Size Functions:
Many mesh generators, including DistMesh, depend on a good a priori mesh size function. It should take into account curvature and feature size of the geometry, and external size functions such as user specifications or adaptive error estimators. In addition, the gradients of the size functions have to be bounded to ensure high quality elements. We compute curvature and feature sizes directly from the implicit geometry definition, and solve our gradient limiting equation to obtain an optimal size function.