Skip to content

SuperMin2D not finding minimum

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB Bug Reports SuperMin2D not finding minimum

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5201
    Julius
    Participant

    Dear developers,

    the function SuperMin2D in file superLatticeIntegralF2D.hh is not working.
    Using this function results in a return of 0.

    The initial minimum is set with the output as 0: (line 96) output[i]=T();
    This is only updated when the absolute value of another minimum is lower than the initial minimum

    if (fabs(outputTmp[i]) < output[i]) {
        output[i] = fabs(outputTmp[i]);
    }

    This basically reads as if( abs(x) < 0){ update }, which is never true.

    In the SuperMin3D function the output is initialized differently output[i] = std::numeric_limits<W>::max();. And that minimization works.

    Replacing SuperMin2D initialization with SuperMin3D makes the function work as expected.
    I also replaced the template <W> with <T>.

    Regards,
    Julius

    • This topic was modified 1 year, 10 months ago by Julius. Reason: template note
    #5204
    jan
    Participant

    Hello Julius,

    Thank you very much for reporting this mistake in the code. I have included the fix in our development version. The next release will include this bug fix.

    Regards,
    Jan

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.