netgen icon indicating copy to clipboard operation
netgen copied to clipboard

Crash in case of partial meshing failure

Open MrSmile opened this issue 1 year ago • 2 comments

I'm using generic meshing interface by creating derivative class from netgen::NetgenGeometry. It works reasonable well, but in the case of partial failure in some early stages netgen frequently crashes. I've discovered that it's due to PointIndex::INVALID and if I comment this line there's no crash any more:

--- a/libsrc/meshing/meshfunc.cpp
+++ b/libsrc/meshing/meshfunc.cpp
@@ -438,7 +438,7 @@ namespace netgen
          glob2loc = PointIndex::INVALID;
 
          for (PointIndex pi : mesh.Points().Range())
-           if (domain_bbox.IsIn (mesh[pi]))
+           //if (domain_bbox.IsIn (mesh[pi]))
                glob2loc[pi] = meshing.AddPoint (mesh[pi], pi);
 
          for (auto sel : mesh.OpenElements() )

Is that if really unnecessary or PointIndex::INVALID should be handled gracefully somewhere later?

MrSmile avatar Mar 18 '24 03:03 MrSmile

I think this is important for efficiancy of parallel volume meshing, can you provide a surface mesh where this leads to problems? (the volume meshing should then be independent of the basegeom anyway).

ChrLackner avatar Mar 19 '24 08:03 ChrLackner

I've saved intermediate results before volume meshing: test.txt I can reproduce a similar crash (but not exactly the same: number of points at middle stages differ) by trying to do "Generate Mesh" twice in netgen GUI.

MrSmile avatar Mar 21 '24 04:03 MrSmile