MMG2d Null metric det error

Hi!

I am using MMG with its KratosMultiphysics interface for 2D meshes and I’m interested in achieving very small element sizes.

If I keep decrease the element size prescribed (1e-4 or lower), at a certain point MMG returns the error:

Error: MMG5_interpmet22: null metric det : 0.000000E+00

Error: MMG2D_intmet_ani: at least 1 naive interpolation.

Im not sure if it is a problem on my side, in the way we are prescribing the metrics, or if it is something on MMG side.

I attach the .sol and .mesh files for this case. The full terminal output is the following:

MAXIMUM MEMORY AUTHORIZED (MB) 12027
%% out_step=0.mesh OPENED
NUMBER OF VERTICES 40275 CORNERS 0
NUMBER OF TRIANGLES 80489
NUMBER OF EDGES 2691
%% out_step=0.sol OPENED
MmgProcess: Step data size: 12 Buffer size: 1
MmgProcess: ////////* MMG LIBRARY CALL *////////

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
MODULE MMG2D: 5.4.3 (Feb. 26, 2020)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

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

– PHASE 1 : DATA ANALYSIS

– MESH QUALITY 80489
BEST 1.000000 AVRG. 0.953957 WRST. 0.538874 (18404)
HISTOGRAMM: 100.00 % > 0.12
100.00 % > 0.5
0.8 < Q < 1.0 79908 99.28 %
0.6 < Q < 0.8 578 0.72 %
0.4 < Q < 0.6 3 0.00 %
Connected component or subdomains: 45
Tagged edges: 4122, ridges: 59, refs: 4063
1840 corners, 0 singular points and 65 non manifold points detected
2910 calculated normal vectors

– RESULTING EDGE LENGTHS 120704
AVERAGE LENGTH 1.7347
SMALLEST EDGE LENGTH 0.1027 32868 40140
LARGEST EDGE LENGTH 35.8375 20330 8508
0.60 < L < 1.30 58853 48.76 %

 HISTOGRAMM:
 0.00 < L < 0.30      3224    2.67 %  
 0.30 < L < 0.60      5667    4.69 %  
 0.60 < L < 0.71      3187    2.64 %  
 0.71 < L < 0.90     10527    8.72 %  
 0.90 < L < 1.30     45139   37.40 %  
 1.30 < L < 1.41      8763    7.26 %  
 1.41 < L < 2.00     19028   15.76 %  
 2.00 < L < 5.00     19486   16.14 %  
 5.   < L             5683    4.71 %  

– PHASE 1 COMPLETED. 0.033s

– PHASE 2 : ANISOTROPIC MESHING
** GEOMETRIC MESH
4171 splitted, 0 collapsed, 8396 swapped
830 splitted, 63 collapsed, 886 swapped
520 splitted, 81 collapsed, 319 swapped
362 splitted, 55 collapsed, 201 swapped
356 splitted, 30 collapsed, 176 swapped
** COMPUTATIONAL MESH

– GRADATION : 1.300000 (2.300000)
gradation: 4051 updated, 5 iter.
31573 splitted, 1651 collapsed, 26154 swapped

Error: MMG5_interpmet22: null metric det : 0.000000E+00

Error: MMG2D_intmet_ani: at least 1 naive interpolation.

    34548 splitted,     1174 collapsed,    11465 swapped
    13075 splitted,      736 collapsed,     4630 swapped
     1845 splitted,      539 collapsed,      880 swapped
      141 splitted,      306 collapsed,      181 swapped
   100525 splitted,    47633 collapsed,    34525 swapped,   175215 moved
    11774 splitted,    13277 collapsed,     7142 swapped,   173669 moved
     4932 splitted,     6042 collapsed,     3783 swapped,   172577 moved
     3164 splitted,     4116 collapsed,     3021 swapped,   171651 moved
     2407 splitted,     3463 collapsed,     2757 swapped,   170584 moved

– PHASE 2 COMPLETED. 10.827s

– MESH QUALITY 346241
BEST 1.000000 AVRG. 0.945662 WRST. 0.000000 (82729)
HISTOGRAMM: 100.00 % > 0.12
99.96 % > 0.5
0.8 < Q < 1.0 340138 98.24 %
0.6 < Q < 0.8 5769 1.67 %
0.4 < Q < 0.6 259 0.07 %
0.2 < Q < 0.4 50 0.01 %
0.0 < Q < 0.2 25 0.01 %

Error: MMG5_minQualCheck: too bad quality for the worst element: (elt 82729 -> 0.000000e+00)

 NUMBER OF VERTICES     173155   CORNERS     1840
 NUMBER OF TRIANGLES    346241
 NUMBER OF EDGES         20554

These are the min size and max/min norms of the metrics for this problem that I computed before calling MMG:
min_elemental_size : 0.000100024
min_metric_norm : 0.0230676
max_metric_norm : 1.28358e+08

Are these too low or too high?

out_step=0.mesh (2.5 MB) out_step=0.sol (1.4 MB)

Hi,

I just realized that the issue is on myside, as there is a domain defined very close to where the smallest sized are described. It is related to what I reported on this thread.

I did not realize that this was happening, sorry for the noise.

I understand that MMG is trying to keep the domains defined while also creating very small elements, which gives the error.

I attach here two versions of the same mesh, one with the extra domain defined (the same as the first post, which makes MMG fail), and another one without the extra domain (which works fine).

working.mesh (2.8 MB) working.sol (1.3 MB) failing.mesh (3.3 MB) failing.sol (1.5 MB)

I’m not sure if the case reported on the first post (with that domain prescribed) is expected to fail or not, as we are maybe asking too much to the remesher. In case it is expected we can close this post.

Hello Mark,

I just give a look to your test cases and your issue is due to a bug in the simultaneous reduction of Mmg2d. The bug appears only when trying to interpolate two homothetic metrics, so it is more likely:

  • in presence of reference edges (edges at the interface of two subdomains);
  • in presence of corners (a point that delimit a sharp angle along a reference edge or a point at the intersection of at least 3 “special” edges);

It explains that it disappear when you remove your subdomain.

In fact, if you provide a valid metric (diagonalizable with strictly positive eigenvalues), Mmg should not crash, even if it may be unable to respect your metric due to the mesh topology (too close borders…).

I think that I have corrected your issues (branch hotfix/null-calnat) but I am still waiting for the continuous integration results before merging it in the develop branch (I have added some assertions that impact the 3 software).

I keep you aware when it will be done.

Moreover, I think that you can have better results if it is possible for you to provide to Mmg the bounding box corners (the square corners). It will allow you to disable the sharp angle detection of Mmg which adds a lot of artifacts (spurious corners) to your reference lines and at the interface between your subdomains (for the out_step=0.mesh).

Regards,
Algiane

Hi Mark,

The correction is merged in the develop branch of Mmg!

Regards,
Algiane