I am investigating a class of simple graphs which cause MMG to freeze, crash, and fail. I’m more interested in solving the freezing case if it matters; as it requires Task Manager to end the process.
The graphs all follow a similar format:
- I’m using the MMG2D api,
MMG2D_mmg2dmesh(mesh, solution)
- input graph contains only vertices and edges
- all vertices and edges are marked as “required”.
I have hundreds of other tests which run MMG2D_mmg2dmesh
which work fine. What seems to be unique about these cases is the presence of simple edge loops (triangles) intended to remain intact, and the issue seems to be when they are enclosed interior to other polygons.
The difference between these is the addition of two more collinear vertices. Collinear vertices do not cause a freeze, they are present in both. Rest assured, the polygons are simple and edges are well formed. Here is another similar example:
Again, two more collinear vertices in B2 from B1 causes a freeze. The move from B3 and B4 is interesting because there is a clue in the debug logs regarding the edge that cuts through the small square. In B1/B2/B3, this edge is interior, and B4 it’s exterior. I only get logs for B1 and B4, not B2 or B3 because of freezing/crashing. Notice the log is complaining about edge (7 9)- this is that same edge- the edge cutting across the smaller inner square.
Here’s the input graph and the logs for B1. You can see the 8th edge connects vertices (7 9).
std::vector<double> v { -2, -2, 2, -2, 2, 0, 2, 2, -2, 2, -2, 0, -1, 0, 0, -1, 1, 0, 0, 1 };
std::vector<int> e {
1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 1,
6, 7, 7, 9, 9, 3,
7, 8, 8, 9, 9, 10, 10, 7
};
std::vector<int> reqV{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
std::vector<int> reqE{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
B1 log:
## Warning: MMG2D_bdryenforcement: at least 1 missing edge (7 9).
## Error: MMG2D_locateEdge: unexpected failure. Check your initial data and/or report the bug. lon:1. 0.000000e+00 2.500000e-01 5.000000e-01
tria 4: 6 5 12,
## Error: MMG2D_bdryenforcement: at least 1 edge not found.
## Error: MMG2D_mmg2d2: unable to enforce the boundaries.
## Warning: MMG2D_pack: unexpected edge table... Ignored data.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
MODULE MMG2D: 5.8.0 (Oct. 30, 2024)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-- MMG2DMESH: INPUT DATA
-- INPUT DATA COMPLETED. 0.000s
MAXIMUM NUMBER OF POINTS (NPMAX) : 50000
MAXIMUM NUMBER OF TRIANGLES (NTMAX) : 100000
-- PHASE 1 : MESH GENERATION
10 vertex inserted 0 not inserted
unable to insert 0 vertex : cavity 0 -- delaunay 0
0 vertex inserted 0 not inserted
unable to insert 0 vertex : cavity 0 -- delaunay 0
Insertion succeed
** number of missing edges : 1
-- edge enforcement 7 9
Try to enforce edge 7 9
NUMBER OF VERTICES 14 CORNERS 0
NUMBER OF TRIANGLES 22
NUMBER OF EDGES 4
%% files/crash-test-horizontal-fails.msh OPENED
B4 is a success, it’s log is uneventful.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
MODULE MMG2D: 5.8.0 (Oct. 30, 2024)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-- MMG2DMESH: INPUT DATA
-- INPUT DATA COMPLETED. 0.000s
-- PHASE 1 : MESH GENERATION
Insertion succeed
2 sub-domains
-- PHASE 1 COMPLETED. 0.000s
-- PHASE 2 : ANALYSIS
-- PHASE 2 COMPLETED. 0.000s
-- PHASE 3 : MESH IMPROVEMENT (ISOTROPIC)
-- GRADATION : 1.300000
-- PHASE 3 COMPLETED. 0.000s
-- MESH QUALITY 7
BEST 0.866025 AVRG. 0.767051 WRST. 0.692820 (1)
HISTOGRAMM: 100.00 % > 0.12
-- MESH PACKED UP
NUMBER OF VERTICES 8 CORNERS 5
NUMBER OF TRIANGLES 7
NUMBER OF EDGES 9
MMG2DMESH: ELAPSED TIME 0.000s
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
END OF MODULE MMG2D
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
%% files/crash-test-half-horizontal-success.msh OPENED
Can someone explain what exactly is going on when MMG says MMG2D_bdryenforcement: at least 1 missing edge (7 9)
(the first line in B1’s log). I feel like this must be related to the issue where MMG freezes, but do you have any further ideas why?
Happy to share anything else or try any of your ideas, thank you!