Skip to content

code blockGeometryStructure2D.hh.

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics code blockGeometryStructure2D.hh.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1991
    LaurentDelaon
    Participant

    Hi,

    a remark on next code :

    Code:
    {
    351 for (int iX = 0; iX < getNx(); iX++) {
    352 for (int iY = 0; iY < getNy(); iY++) {
    353 if (get(iX, iY) == fromM) {
    354 bool found = true;
    355 for (int iOffsetX = -offsetX; iOffsetX <= (int) offsetX; ++iOffsetX) {
    356 for (int iOffsetY = -offsetY; iOffsetY <= (int) offsetY; ++iOffsetY) {
    357 if (getMaterial(iX + iOffsetX, iY + iOffsetY) != fromM) {
    358 if (getMaterial(iX + iOffsetX, iY + iOffsetY) != 1245) {
    359 found = false; //<==== here we can stop no?
    360 }
    361 }
    362 }
    363 }
    364 if (found) {
    365 get(iX, iY) = 1245;
    366 }
    367 }
    368 }
    369 }
    370 rename(1245,toM);
    371 }

    At 359 if false not necessary to continue loop scan ?
    maye be a break and a reflexion on this output condition…

    Laurent.

    #2909
    albert.mink
    Moderator

    Hi Laurent,

    we appreciate all recommendations to make the software better.

    Would you mind to tell my what is the problem with line 359? Does is result in false rename or is it an efficiency issue?

    All the best
    Albert

    #2912
    LaurentDelaon
    Participant

    I think its an efficiency issue…
    Maybe I made mistake ?

    #2920
    albert.mink
    Moderator

    You are welcome to contribute to openLB. So you might provide an efficiency evaluation and compare the time consumed with and without.

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