Hello there. First of all, thank you for this very useful library.
I’m using it for meshing 2d elements and I stumbled into a problem. Sometimes I’m passing data to MMG2D which are non-consistent, I mean numerically wrong.
Those are some very limited side cases, which happens when my meshes are very tiny, i.e. very little verts and edges lengths. The tool I use before calling MMG seem to have a bug, and generates those inconsistent results which are then fed to MMG.
Thus I get:
Error: MMG5_boundingBox: unable to scale mesh: Check that your mesh contains non-zero points and valid elements.
Assertion failed: ((dataPtr == 0) || ( rows >= 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) && cols >= 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols))), function MapBase, file /Users/Developer/eigen/Eigen/src/Core/MapBase.h, line 176.
which is in turn generated by the bbox code check in mmg/src/common/scalem.c,
int MMG5_boundingBox(MMG5_pMesh mesh), about line 70
mesh->info.delta = 0.0;
for (i=0; i<mesh->dim; i++) {
dd = mesh->info.max[i] - mesh->info.min[i];
if ( dd > mesh->info.delta ) mesh->info.delta = dd;
}
if ( mesh->info.delta < MMG5_EPSD ) {
fprintf(stderr,"\n ## Error: %s: unable to scale mesh:"
" Check that your mesh contains non-zero points and "
"valid elements.\n",__func__);
return 0;
}
called by MMG2D_mmg2dmesh in my code.
Of course I could trap the numerical errors by some isFinite check in Eigen, but I’d like to know if there’s a way to fetch this specific error in some way. Apparently the meshing call only returns MMG5_STRONGFAILURE, MMG5_LOWFAILURE…
Basically my question is if it’s possible to fetch a specific error in MMG.
Thank you in advance