Wrong condition for "very very bad...

  • Roman Lygin

    Roman Lygin - 2011-07-31

    The file smoothing2.cpp (class Opti2SurfaceMinFunction) has a check, which if fails, outputs a string "very very bad badness". Trying to analyze the root-cause of this message on a seemingly fine shape I came to a suspicion if the check misses the absolute value. Instead of:

    double e1l = e1.Length();
    if (Determinant(e1, e2, n) > 1e-8 * e1l * e2.Length())

    shouldn't it rather use
    if (fabs (Determinant(e1, e2, n)) > 1e-8 * e1l * e2.Length())

    Any thoughts from the experienced users or developer team?


  • Joachim Schoeberl

    It's correct. Elements with negative orientation are considered as elements with very bad shape.

  • Roman Lygin

    Roman Lygin - 2011-08-11

    Thanks Joachim!
    The reason I'm asking is that this warning is output quite frequently yet the final mesh is fine.
    Here is one of the simplest cases I could identify (link) - a planar rectangle 10x10.
    When meshing with moderate grading, max size 3.5, there are about a dozen of these warnings in the test.out file (also enclosed). These are visible via using API only and are not visible via Netgen GUI.

    Hope this can help you verify what's going on internally (I have not had time to do this myself though).

    Thanks again,


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks