Skip to content
Snippets Groups Projects
Commit cf51528d authored by mattijs's avatar mattijs
Browse files

BUG: orientedSurface: multiple parts of surfaces not visited

parent e5f921e7
No related branches found
No related tags found
No related merge requests found
...@@ -102,7 +102,7 @@ Foam::labelList Foam::orientedSurface::edgeToFace ...@@ -102,7 +102,7 @@ Foam::labelList Foam::orientedSurface::edgeToFace
{ {
if (flip[face1] == UNVISITED) if (flip[face1] == UNVISITED)
{ {
FatalErrorIn("orientedSurface::edgeToFace") << "Problem" FatalErrorIn("orientedSurface::edgeToFace(..)") << "Problem"
<< abort(FatalError); << abort(FatalError);
} }
else else
...@@ -283,8 +283,10 @@ bool Foam::orientedSurface::flipSurface ...@@ -283,8 +283,10 @@ bool Foam::orientedSurface::flipSurface
} }
} }
// Recalculate normals // Recalculate normals
s.clearOut(); if (hasFlipped)
{
s.clearOut();
}
return hasFlipped; return hasFlipped;
} }
...@@ -352,8 +354,28 @@ bool Foam::orientedSurface::orient ...@@ -352,8 +354,28 @@ bool Foam::orientedSurface::orient
// FLIP: need to flip // FLIP: need to flip
labelList flipState(s.size(), UNVISITED); labelList flipState(s.size(), UNVISITED);
flipState[0] = NOFLIP; label faceI = 0;
walkSurface(s, 0, flipState); while (true)
{
label startFaceI = -1;
while (faceI < s.size())
{
if (flipState[faceI] == UNVISITED)
{
startFaceI = faceI;
break;
}
faceI++;
}
if (startFaceI == -1)
{
break;
}
flipState[startFaceI] = NOFLIP;
walkSurface(s, startFaceI, flipState);
}
anyFlipped = flipSurface(s, flipState); anyFlipped = flipSurface(s, flipState);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment