We start from the holes.mesh mesh (see figure 1) and the associated size map (stored in the holes.sol file). This map prescribes a constant isotropic metric of 0.1 on each vertex.
To adapt the circle mesh to the prescribed size map you just need to run the mmg2d application:
We obtain the adapted mesh displayed figure 2.
You can specify a metric file with a different name than the mesh one using the -sol option:
mmg2d_O3 holes.mesh -sol myMetric.sol
Boundary approximation control
The boundary approximation is controlled by the Hausdorff parameter. You can use the -hausd option to adapt the Hausdorff value to your needs (more infos about the -hausd option). We obtain the result displayed figure 3 by asking for a maximal Hausdorff distance of 0.005 (our mesh has a bounding box of 1):
mmg2d_O3 -hausd 0.005 holes.mesh
Maximal edge size value
The -hmin and -hmax options allows to truncate the edge sizes to be (respectively) greater than a given value and lower than another one. The figure 4 shows the mesh obtained for a hmax value of 0.03 (more infos about the hmax parameter):
mmg2d_O3 holes.mesh -hmax 0.05
Note that this hmax value is lower than the prescribed size, thus, we don’t respect our metric anymore.