Use the PackedList unset() method in a few places

- also PackedBoolList.get(x) == 1 can be written without the ==
  comparison since the unsigned -> bool conversion is fast
This commit is contained in:
Mark Olesen
2009-12-08 11:16:43 +01:00
parent d2d39c32be
commit 41fc71458b
5 changed files with 66 additions and 63 deletions

View File

@ -228,14 +228,14 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
label f0 = baffles[i].first();
label f1 = baffles[i].second();
if (isMasterFace.get(f0) == 1)
if (isMasterFace.get(f0))
{
// Make f1 a slave
isMasterFace.set(f1, 0);
isMasterFace.unset(f1);
}
else if (isMasterFace.get(f1) == 1)
else if (isMasterFace.get(f1))
{
isMasterFace.set(f0, 0);
isMasterFace.unset(f0);
}
else
{
@ -262,7 +262,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
{
label faceI = pFaces[pfI];
if (isMasterFace.get(pp.addressing()[faceI]) == 1)
if (isMasterFace.get(pp.addressing()[faceI]))
{
avgBoundary[patchPointI] += pp[faceI].centre(points);
nBoundary[patchPointI]++;
@ -451,7 +451,7 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
point newPos;
if (nonManifoldPoint.get(i) == 0u)
if (!nonManifoldPoint.get(i))
{
// Points that are manifold. Weight the internal and boundary
// by their number of faces and blend with
@ -1373,7 +1373,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::repatchToSurface
{
label faceI = pp.addressing()[i];
if (hitSurface[i] != -1 && (isZonedFace.get(faceI) == 0))
if (hitSurface[i] != -1 && !isZonedFace.get(faceI))
{
closestPatch[i] = globalToPatch_
[