Segmentation fault for anisotropic 3d mesh adaption

Hi to all, i have encounter the seg fault error starting from 3d mesh (created on FreeFem++) in phase 2 of anisotropic meshing. More precisely i have the following message:

Adapting…
exec: mmg3d mymesh.mesh -sol mysol.sol -m 10000

Memory problem: realloc: Not enough space

Error: MMG3D_splsurfedge: unable to split.

Unable to complete surface mesh. Exit program.

Unable to split mesh. Exiting.

– MMG3D, Release 5.5.2 (Nov. 17, 2020)
Copyright (c) Bdx INP/CNRS/Inria/UPMC, 2004-
Jan 14 2021 09:19:13

– INPUT DATA
%% mymesh.mesh OPENED
%% mysol.sol OPENED
– DATA READING COMPLETED. 1.000s

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
MODULE MMG3D: 5.5.2 (Nov. 17, 2020)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

– MMG3DLIB: INPUT DATA
– INPUT DATA COMPLETED. 0.000s

– PHASE 1 : ANALYSIS

– MESH QUALITY 206280
BEST 0.994926 AVRG. 0.630222 WRST. 0.090355 (24061)
– PHASE 1 COMPLETED. 1.000s

– PHASE 2 : ANISOTROPIC MESHING
9926 splitted, 0 collapsed, 26573 swapped, 5 iter.

– GRADATION : 1.300000 (2.300000)

Unexpected error: *** Segmentation fault

ELAPSED TIME 16.000s
read mesh ok 0Mesh3, num Tetra:= 80046, num Vertice:= 14312 num boundary Triangles:= 3688
Mesh3::meshS, num Triangles:= 3688, num Vertice:= 1846 num boundary Edges:= 150
– Mesh3 : mymesh.o.mesh, space dimension 3, num Tetrahedron elts 80046, num Vertice 14312 num Bordary elts 3688
– Mesh3:MeshS : mymesh.o.mesh, space dimension 3, num Triangle elts 3688, num Vertice 1846 num Bordary elts 150
Number of elements = 80046
– FESpace: Nb of Nodes 14312 Nb of DoF 14312

Is there anyone that can help me to better understand the problem? It’s the first time that i use mmg and i’m not so expert.

TRIGA3D_PROVA.edp (2.7 KB)

Hi,

Thank you for sharing the freefem++ scripts: it is always useful to reproduce the issue to understand it!

I think that Mmg doesn’t have enough memory to create the mesh that you ask (you are asking for a very very fine mesh).

In the attached picture, the blue ellipse shows the edge size asked in each direction of the 3D space for a given vertex. As you can see it is very small comparing to the input mesh size.

If interested, you can inspect your mesh and metric by creating a symbolic link from “mymesh.sol” toward the “mysol.sol” file and by opening the mesh with the Medit software (GitHub - ISCDtoolbox/Medit).

I hope that it will help you,
Best Regards,

Algiane

thanks for the help, so changing hardware is not so useful if i understand correctly, problem is in mmg.

But i’m accepting also a less fine mesh, how can i reduce the detail?

Changing hardware may work in some cases, with your metric, I would not be surprise if the final mesh contains more than billions of elements: is it really the mesh that you want to create?

Otherwise you will have to change the bounds of your metric. I guess that it is computed by the makemetrica function. I am note a ff++ expert so I can’t really help you on this point, I can only give you some key points:

  • you set hmin=0.01, hmax=1, as your mesh has a volume (roughly) of 300 and a regular tetra has a volume of \frac{h^3}{6\sqrt{2}} (with h the edge length), you ask for a mesh between 3000 and 2 billions of elements;
  • a common mistake is to forgot that the eigenvalues of the metric are equal to \frac{1}{h^2}.

Have a nice day.

Thank you very much for the support, changing hmin now it works well.