Unexpected results from mmg3d (lib and standalone)

Hi, MMG developers and users,

I am trying to adapt a 3d mesh isotropically to a solution but keep getting a new mesh that doesn’t seem consistent with the metric distribution. I’d really appreciate it if someone can point out what I am doing wrong.

The mesh is a slightly deformed rectangular prism and the given scalar solution has smaller values around the middle. So, after adapted, the mesh is expected to have reduced-size elements in the middle and coarser ones near the ends.

Instead, however, the new mesh ends up with an extremely high resolution on one boundary. The interior and the other boundaries have uniformly coarser elements but even their sizes are closer to hmin.

FYI, the only non-default parameters are hmin and hmax, which are 1000 and 5000 in my experiment. The mesh and solution files are attached: test_orig.mesh (12.6 KB) test_orig.sol (2.1 KB)

Best regards,
Eunseo

Hi Eunseo and welcome in our community,

Mmg computes the hausdorff distance between the input discretization and the “ideal” geometry (computed internally) to improve the approximation of curve surfaces: If the computed hausdorff distance is greater than a given threshold, we insert points over the surface, if the distance is below this threshold, point deletion is authorized. It leads to insert point on curved areas.

By default the hausdorff threshold is setted to 0.01 which is suitable for a good representation of a sphere of radius 1. As the bounding box of your model is very large and as you have a curve area on your surface you need to increase a lot this threshold.

Running your testcase with the -hausd 300 argument gives the attached result.


The sphere that you can see on the left image (your initial mesh) has a diameter equal to the asked edge lengths in this location. As you can see, the final mesh, right, seems to have edges of the suitable lengths.

Just note that Mmg tries to not create internal edges connecting 2 boundary points, as it tries to not create elements with more than one boundary face. On test case like yours, with very few elements in the domain, it can impact locally the final edge sizes.

I hope that it will help you.
Best regards.

Algiane

Thank you so much for the explanation, Algiane!
The result with -hausd 300 is what I hoped to get.

Best regards,
Eunseo