Dear MMG users,
I’d like to know if there is an option to check the new mesh quality.
For example, I’d like to know if there are bad oriented tetras and if so, re-run MMG.
I’m using FreeFem++. There is the option “checkmovemesh” for the remeshing command “movemesh”.
I’d like to know if there is something similar for MMG or how to adapt and use “checkmovemesh” with MMG.
Thanks in advance!
Lily
Dear Lily,
All Mmg versions display the elements quality histogram if you ask a minimum verbosity -v 4
.
In Mmg3d you can get more precise information if you use the library functions:
- MMG3D_Get_tetrahedronQuality to get tetra quality,
- MMG3D_mmg3dcheck to check for invalid elements,
- MMG3D_searchqua to search for elements whose quality is worse than a threshold,
- MMG3D_searchlen to search for edges whose length is smaller/bigger than given values,
- MMG3D_lenedgCoor to compute the edge length in a given metrics.
Please follow the links to access to the usage documentation in libmmg3d.h, while general library examples can be found in the folder libexamples (although these functions are not explicitly covered by the examples yet).
The quality Q of a tetrahedron in the isotropic case is defined as in this paper, while the definitions of volume and edge length for the anisotropic extension can be found in this other paper.
Please let me know if you have more specific needs!
Yours,
Luca
Dear Luca,
Thank you for your clear response. It helps me a lot.
Yours,
Lily
Dear Luca,
I have one more question if you please.
I’m using MMG3D with FreeFem++.
How can I export the info about the worst quality Q in FreeFem.
I’d like to define in FreeFem something like
real wQ = “worth Q given by MMG”
Thanks in advance!
Lily
Dear Lily,
I think that the coupling of the two software does not expose all Mmg API functions to FreeFem users in the current release.
Anyway, since I am not an expert Freefem user nor developer, I strongly advice to ask for further support about this topic on the FreeFem community forum:
Surely they have deeper knowledge about FreeFem to help you find out:
- possible plans to support those Mmg functions directly, or
- equivalent functions to get elements quality maybe already available in FreeFem itself, or
- feasible ways to implement your own quality formulas through the scripts (it would be interesting to find out it the methods shown in https://doc.freefem.org/documentation/mesh-generation.html#mesh-connectivity-and-data for 2D meshes extend to the
msh3
datatype)
(… But I see you are already doing it )
Yours,
Luca