fm_refine function

Refine a 2d mesh