From 76e22c78253f192a074d12fff73fceeb46b69111 Mon Sep 17 00:00:00 2001 From: Henrik Rusche Date: Fri, 18 Nov 2016 14:04:48 +0100 Subject: [PATCH] Fixed bug in IBM (Hrvoje Jasak) --- .../immersedBoundaryFvPatchTriAddressing.C | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatch/immersedBoundaryFvPatchTriAddressing.C b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatch/immersedBoundaryFvPatchTriAddressing.C index a85e1c516..ca04f0eb1 100644 --- a/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatch/immersedBoundaryFvPatchTriAddressing.C +++ b/src/immersedBoundary/immersedBoundary/immersedBoundaryFvPatch/immersedBoundaryFvPatchTriAddressing.C @@ -86,7 +86,7 @@ void Foam::immersedBoundaryFvPatch::makeTriAddressing() const boolList visited(triPatch.size(), false); - register label curTri; + label curTri = 0; // Only search for tri faces in the mesh forAll (triFacesInMesh, tfimI) @@ -125,13 +125,17 @@ void Foam::immersedBoundaryFvPatch::makeTriAddressing() const // already visited faces do { - curTri = nextToVisit.removeHead(); + if (!nextToVisit.empty()) + { + curTri = nextToVisit.removeHead(); + } + else + { + break; + } } while (visited[curTri]); - // Discard tri if already visited - if (visited[curTri]) continue; - visited[curTri] = true; const triFace& curTriPoints = triPatch[curTri];