From 6c6b3ad1097918c137ca6c3a1d7dd24cc40ee01d Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 16 Apr 2010 10:59:40 +0100 Subject: [PATCH] BUG: missing initialisation of boolList --- src/meshTools/sets/topoSets/faceSet.C | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/meshTools/sets/topoSets/faceSet.C b/src/meshTools/sets/topoSets/faceSet.C index 8a984a9aea..c3d48cd6b5 100644 --- a/src/meshTools/sets/topoSets/faceSet.C +++ b/src/meshTools/sets/topoSets/faceSet.C @@ -113,27 +113,30 @@ faceSet::~faceSet() void faceSet::sync(const polyMesh& mesh) { - boolList set(mesh.nFaces()); + boolList set(mesh.nFaces(), false); + forAllConstIter(faceSet, *this, iter) { set[iter.key()] = true; } - boolList syncSet(set); - syncTools::syncFaceList(mesh, syncSet, orEqOp()); + syncTools::syncFaceList(mesh, set, orEqOp()); label nAdded = 0; forAll(set, faceI) { - if (!set[faceI] && syncSet[faceI]) + if (set[faceI]) { - if (!insert(faceI)) + if (insert(faceI)) { - FatalErrorIn("faceSet::sync(const polyMesh&)") - << "Problem at face " << faceI - << abort(FatalError); + nAdded++; } - nAdded++; + } + else if (found(faceI)) + { + FatalErrorIn("faceSet::sync(const polyMesh&)") + << "Problem : syncing removed faces from set." + << abort(FatalError); } }