ENH: consistency of HashSet setMany(), insertMany() with packed-list version

- this also provides a better separation of the intent
  (ie, inserting a single value, or inserting multiply values)
This commit is contained in:
Mark Olesen
2018-03-14 21:08:29 +01:00
parent 5d1fb23555
commit d17bc72585
64 changed files with 516 additions and 631 deletions

View File

@ -300,10 +300,7 @@ void Foam::cellClassification::markCells
// Mark faces of celli
const labelList& myFaces = mesh_.cells()[celli];
forAll(myFaces, myFacei)
{
outsideFacesMap.insert(myFaces[myFacei]);
}
outsideFacesMap.insertMany(myFaces);
}
}

View File

@ -172,11 +172,7 @@ Foam::label Foam::cellDistFuncs::getPointNeighbours
forAll(f, fp)
{
const labelList& pointNbs = patch.pointFaces()[f[fp]];
forAll(pointNbs, i)
{
nbs.insert(pointNbs[i]);
}
nbs.insertMany(pointNbs);
}
// Subtract ours.

View File

@ -301,11 +301,7 @@ void Foam::meshTools::writeOBJ
forAll(cellLabels, i)
{
const cell& cFaces = cells[cellLabels[i]];
forAll(cFaces, j)
{
usedFaces.insert(cFaces[j]);
}
usedFaces.insertMany(cFaces);
}
writeOBJ(os, faces, points, usedFaces.toc());

View File

@ -160,10 +160,7 @@ void Foam::normalToFace::applyToSet
}
}
forAll(toBeRemoved, i)
{
set.erase(toBeRemoved[i]);
}
set.eraseMany(toBeRemoved);
}
}

View File

@ -384,11 +384,7 @@ Foam::labelHashSet Foam::triSurfaceTools::getCollapsedFaces
const labelList& myFaces = surf.edgeFaces()[edgeI];
labelHashSet facesToBeCollapsed(2*myFaces.size());
forAll(myFaces, myFacei)
{
facesToBeCollapsed.insert(myFaces[myFacei]);
}
facesToBeCollapsed.insertMany(myFaces);
// From faces using v1 check if they share an edge with faces
// using v2.