The **mmg3d** application allows to improve the quality of an input mesh while keeping the mean edge lenghts of the mesh.

We consider the initial cube mesh displayed figure 1 and named *cube.mesh*. This mesh is provided without any associated sizemap.

To improve your mesh quality while keeping the mean edge sizes, you just need to run the application using the -optim option.

mmg3d_O3 -optim cube.mesh -out optimMesh.mesh

- the -out option allows to choose the ouput file name.
- the -optim option enable the mesh improvement with mean edge length preservation.

More infos about the -optim option.

We obtain a mesh named *optimMesh.mesh *and the size map computed to preserve the edge sizes (see figure 2). This sizemap is saved in the *optimMesh.sol* file.

### Remark:

By default, the Mmg applications try to coarsen the mesh with respect to:

- the geometric approximation
- the gradation control value
- the minimal and maximal edge sizes if specified by the user

For example, starting from our initial cube mesh, we run the application without any arguments:

mmg3d_O3 cube.mesh

We obtain the cube.o.mesh mesh displayed figure 3. As the approximation of the cube boundaries is exact, the remesher can coarse the mesh.