Big mesh makes mmg3d get stuck in analysis

Hi there,

So I have a question concerning mmg3d. I want to remesh a mesh with 8e6 Nodes and when I tried to start mmg3d on my machine (128GB RAM, 24 Cores) mmg3d gets stuck in the analysis phase. I thought this was maybe because of the size but after 3 days i cancelled the job. “perf top” showed me that mmg3d was spending most of the time before cancelling in the routine MMG5_boulernm.

So I was wandering, can this be a limitation because of integer overflow?

Further I wanted to ask if there’s any plan of adding SMP support to MMG.

Best regards
Elias

Hi Elias,

I have no idea of what happens on your test case (integer overflow, infinite loop…)… 8e6 nodes doesn’t seems to be a very large mesh regarding an integer overflow (I have experimented this limit on meshes around 200e6 nodes).

The MMG5_boulernm function counts the number of reference and sharp edges passing through a non-manifold point (a point at the intersection of at least three different surfaces).
It is a special treatment of the surface so It is probable that you end up on a bug inside this function.

Is it possible to send me your mesh, size map (if you provide it) and Mmg options (+version) in order to reproduce the bug?

Beside, we are currently developping a library performing parallel mesh adaptation based on Mmg (using MPI).

Regards,

Algiane

Thanks for the reply. So I would like to share my mesh, but as it comes from medical patient data I’m not allowed to share it. I try to recap as exactly as possible what I did

  • The input mesh came from a Triangulation of a multilabeled voxel image stack representing a human heart. Meshing was done with CGAL.
  • The problem, is that my goal is a CFD simulation so I need planar outlets which are hard to generate from a voxel stack
  • That’s why I took my CGAL-mesh loaded it into paraview and started cutting planar outlets and tetrahedralize the resulting mesh. I added a picture of before and after.
  • This of course generates a mesh with very bad elements and thats where I wanted to remesh the whole mesh with mmg3d. I first cleaned the cutted mesh of duplicate nodes zero volume elements. However the mesh still has a very bad quality distribution.
  • My mesh dimensions are in mikrometer and I wanted to have a resulting mesh with edgelengths in the range of 100 - 1000 um.
  • So I used mmg3d the following way (due to the VTK mesh having only tets i also get a only tet mesh file for mmg)
    mmg3d_O3 -in input.mesh -out output.mesh -hmin 100 -hmax 1000 -hausd 200

Hi,

I think that I understand your whole process but I still don’t figure out where is the bug. Just in case : it is not possible to send your mesh by private mail?

Regards,
Algiane

Maybe I can do that. I have to ask my superiors. If you have access to google drive I can share the mesh there.

Another thing popped up in my mind: The tetrahedrons in my mesh have an assigned tag for representing different anatomical regions of my mesh. As far as I know MMG keeps the surfaces of tag regions untouched. It would be nice if one could also smooth the surfaces of tag regions inside the mesh.

Best regards
Elias

Hi Elias,

Get back to me if you think that you can share the mesh with me. Another way to try to fix this bug would be to try to reproduce the bug on a minimal example, but we need to understand what your mesh have that makes Mmg crash: maybe you can try to comment the call of the function in which Mmg is stuck and to save the mesh after the analysis step (if it doesn’t fail). I attach a debug.patch (906 Bytes) to do that (to apply to the ‘master’) branch of Mmg. To apply it:

cd mmg
git apply debug.patch

If Mmg saves an output mesh, it will contains the list of the “special edges” detected by Mmg. You can see them using the Medit visualisation tool and the g shortcut. Edges of interest will appear in red.

Regarding your second question: normally Mmg smoothes the interfaces between regions. If not, you can check that:

  • the hausdorff parameter is sufficiently small;
  • Mmg doesn’t detect spurious sharp edges;
  • The interface triangles, if provided, have the same reference on a given area.

Best,

Algiane

Hi Algiane,

Yes I can share my mesh with you. So how should we do that? I can put the mesh on my google drive and give you access to it?

Best regards
Elias

Hi Elias,

If it is ok for you it’s perfect for me!

Regards,

Hi Elias,

Sorry for the delay (the end of year is overloaded ;-)). I am not able to reproduce your deadlock, which release of Mmg are you using?

Just one more question: are you sure of your mesh conformity? (Mmg does weird things on the mesh as it does on non-conformal mesh);

Best Regards

Algiane

I checked the mesh before for duplicate points and so on. Since I cutted some elements through paraview i may end up with arbitrary bad elements close to the cuts.

Hi Elias,

Did you finally success to run Mmg on your mesh or did you still need help?

Regards,
Algiane