Hello mmg community,
I use mmg in a C++ software. So far, I had no problem using it for isotropic metric. I have began to implement the support of anisotropic metric, and I have an issue in the function called
At some point, I end up with an Arithmetic Exception here
crit += sqrt(dd/ray);.
dd is negative.
I have tried to cheat a little bit and ensure dd to be positive by computing
uz like that
ux = fabs(ppt->c - c); uy = fabs(ppt->c - c); uz =fabs( ppt->c - c); dd = mj*ux*ux + mj*uy*uy + mj*uz*uz + 2.0*(mj*ux*uy + mj*ux*uz + mj*uy*uz);
But then, it was
ray that was negative. So I cheat again by doing
ray=fabs(ray); and now I have a correct results.
I have really hard trouble to debug. If I use mmg through command line, everything is going fine. I have checked multiple times if the metric was well specified usingthis page and it was.
I have tried with a “fake” anisotropic metric (with only 1 in the diagonal) and I still have an issue.
Do you have any tips on how to debug ? are ux, uz and uy supposed to be negative ?