Note that the gmsh software handles a lot of mesh file formats, thus, you can use it to convert your mesh at the medit format :

Save As -> Mesh - INRIA Medit (*.mesh)

If you use the medit file format, you can provide:

  • a size map at medit solution file format (.sol extension) if you want to adapt your mesh to a size map.
  • a level-set map at medit solution file format (.sol extension) if you want to discretize an isovalue of a function.

If you use the gmsh file format:

  • the size map or level-set map must be provided in the .msh(b) file as $NodeData and flagged using a string tag with the :metric suffix.
  • there is a non-compatibility between the .mesh format used by mmg2d (coordinates in 2D) and the gmsh output (coordinates in 3D):
    • To force mmg2d to produce a .mesh file readable by Gmsh (not anymore compatible with Medit) you can run mmg2d with the -msh 1 command line argument.
    • To load a 2D .mesh file created with Gmsh, you will need to run mmg2d with the -msh 2 command line argument. In this case, the .mesh file produced by mmg2d is a Gmsh .mesh.

Remark: you must provide positive or null integers for the entities references.

Learn to use the Mmg tools

To learn how to use the Mmg tools:

  • Mmg applications:
    • mmg2d to remesh triangular two-dimensional meshes
    • mmgs to remesh triangular three-dimensional surface meshes
    • mmg3d to remesh tetrahedral volume meshes
  • ParMmg application to remesh tetrahedral volume meshes in parallel

Lot of options are commons between the four codes, thus, do not hesitate to look at the tutorials of the four software to understand how to use it.

To learn how to use the Mmg libraries: go here

Practical work to learn how to use Mmg (applications and libraries):

git clone https://github.com/MmgTools/Mmg-Day-2018_TP.git

How to prescribe an anisotropic size map?

Mesh visualization:

  • gmsh: allows to visualize your mesh at the medit format (but not the associated solution) and, of course, your mesh at the gmsh format and its embedded solution.
  • medit: allows to visualize your mesh and solution at the medit format.


Of course the meshes generated by Mmg can be used in any solver. If you don’t have a favorite solver yet, you can use one of those that interfaces Mmg:

  • AVBP: a solver for numerical simulation of unsteady turbulence for reacting flows.
  • Elmer/Ice: a finite element software for ice sheet, glaciers and ice flow modelling (open source).
  • Freefem++:a partial differential equation solver for non-linear multi-physics systems in 2D and 3D (open source).
  • Gypsilab: a MATLAB toolbox for fast numerical computation with finite element and boundary element methods (open source).
  • Kratos: a framework for building parallel, multi-disciplinary simulation software (open source).
  • MUSIC: a multimodal platform for cardiac imagery.
  • YALES2: a solver for two-phase combustion, from primary atomization to pollutant prediction, on massive complex meshes.

Blender plug’in for Mmgs:

Thanks to Loïc Norgeot, you can use BakeMyScan, an Open Source toolbox for asset optimization, to call mmgs inside Blender.

Comments are closed.