Commit 6b6b36af authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: revert bitSet/HashSet setMany() to set() method (issue #837)

- improves backward compatibility and more naming consistency.
  Retain setMany(iter1, iter2) to avoid ambiguity with the
  PackedList::set(index, value) method.
parent 3de9b2f6
......@@ -188,10 +188,10 @@ int main(int argc, char *argv[])
Info<< "setB : " << setB << endl;
labelPair pair(12, 15);
setB.setMany(pair);
setB.set(pair);
Info<< "setB : " << setB << endl;
setB.unsetMany(pair);
setB.unset(pair);
labelHashSet setC(1);
......@@ -257,7 +257,7 @@ int main(int argc, char *argv[])
someLst[elemI] = elemI*elemI;
}
label added = setD.setMany(someLst);
label added = setD.set(someLst);
Info<< "added " << added << " from " << someLst.size() << endl;
Info<< "setD : " << flatOutput(setD) << endl;
......
......@@ -294,7 +294,7 @@ int main(int argc, char *argv[])
Info<< "\nclear/assign from labelList\n";
list4.clear();
list4.setMany(labelList{0, 1, 2, 3, 12, 13, 14, 19, 20, 21});
list4.set(labelList{0, 1, 2, 3, 12, 13, 14, 19, 20, 21});
report(list4, true);
......
......@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
e4.start() = e4.end() = -1;
Info<< "insert from list\n";
labelHashSet newIndices({2, -1, 2, 1, 4, 1, 2, 3});
e4.insertMany(newIndices.toc());
e4.insert(newIndices.toc());
printInfo(e4);
e4.start() = e4.end() = -1;
......@@ -105,12 +105,12 @@ int main(int argc, char *argv[])
FixedList<label, 8> otherIndices{12, 2, -1, 1, 4, 1, 2, 3};
e4.start() = e4.end() = -1;
Info<< "insert from list: " << otherIndices << nl;
e4.insertMany(otherIndices);
e4.insert(otherIndices);
printInfo(e4);
e4.start() = e4.end();
Info<< "erase from list: " << otherIndices << nl;
Info<< "removed " << e4.eraseMany(otherIndices) << " values" << nl;
Info<< "removed " << e4.erase(otherIndices) << " values" << nl;
printInfo(e4);
for (label i : {-1, 0, 1, 3})
......
......@@ -374,7 +374,7 @@ void Foam::cellSplitter::setRefinement
const cell& cFaces = mesh_.cells()[celli];
faceUpToDate.unsetMany(cFaces);
faceUpToDate.unset(cFaces);
}
forAll(faceUpToDate, facei)
......
......@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
{
const labelList& pCells = mesh.pointCells()[meshPointi];
cutCells.insertMany(pCells);
cutCells.insert(pCells);
}
}
......@@ -153,7 +153,7 @@ int main(int argc, char *argv[])
const polyPatch& pp = mesh.boundaryMesh()[patchi];
const labelList& meshPoints = pp.meshPoints();
vertOnPatch.setMany(meshPoints);
vertOnPatch.set(meshPoints);
}
for (const label patchi : patchSet)
......
......@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
const DynamicList<label>& bin = bins[binI];
cellSet cells(mesh, "vol" + name(binI), bin.size());
cells.insertMany(bin);
cells.insert(bin);
Info<< " " << lowerLimits[binI] << " .. " << upperLimits[binI]
<< " : writing " << bin.size() << " cells to cellSet "
......
......@@ -633,7 +633,7 @@ int main(int argc, char *argv[])
);
cellSet cutSet(mesh, "cutSet", cutCells.size());
cutSet.insertMany(cutCells);
cutSet.insert(cutCells);
// Gets cuts across cells from cuts through edges.
Info<< "Writing " << cutSet.size() << " cells to cut to cellSet "
......
......@@ -956,7 +956,7 @@ int main(int argc, char *argv[])
forAll(dofVertIndices, patchi)
{
const labelList& foamVerts = dofVertIndices[patchi];
dofGroups[patchi].insertMany(foamVerts);
dofGroups[patchi].insert(foamVerts);
}
List<DynamicList<face>> dynPatchFaces(dofVertIndices.size());
......
......@@ -344,7 +344,7 @@ void writePointCells
{
const labelList& cEdges = mesh.cellEdges()[pCells[i]];
allEdges.insertMany(cEdges);
allEdges.insert(cEdges);
}
......
......@@ -795,7 +795,7 @@ int main(int argc, char *argv[])
forAll(addedCells, facei)
{
const labelList& aCells = addedCells[facei];
addedCellsSet.insertMany(aCells);
addedCellsSet.insert(aCells);
}
}
}
......
......@@ -527,7 +527,7 @@ label findUncoveredPatchFace
{
// Make set of extruded faces.
labelHashSet extrudeFaceSet(extrudeMeshFaces.size());
extrudeFaceSet.insertMany(extrudeMeshFaces);
extrudeFaceSet.insert(extrudeMeshFaces);
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
......@@ -561,7 +561,7 @@ label findUncoveredCyclicPatchFace
{
// Make set of extruded faces.
labelHashSet extrudeFaceSet(extrudeMeshFaces.size());
extrudeFaceSet.insertMany(extrudeMeshFaces);
extrudeFaceSet.insert(extrudeMeshFaces);
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
......
......@@ -1053,7 +1053,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
nInvalidPolyhedra++;
wrongFaces.insertMany(cells[cI]);
wrongFaces.insert(cells[cI]);
}
}
......@@ -1093,7 +1093,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
if (nInternalFaces[cI] <= 1)
{
oneInternalFaceCells++;
wrongFaces.insertMany(cells[cI]);
wrongFaces.insert(cells[cI]);
}
}
......@@ -1109,7 +1109,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
{
const face f = pMesh.faces()[facei];
ptToBeLimited.setMany(f);
ptToBeLimited.set(f);
}
// // Limit connected cells
......@@ -1126,7 +1126,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
// {
// label ptI = f[fPtI];
// const labelList& pC = ptCells[ptI];
// limitCells.insertMany(pC);
// limitCells.insert(pC);
// }
// }
......@@ -1136,7 +1136,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
// {
// const labelList& cP = cellPts[celli];
// ptToBeLimited.setMany(cP);
// ptToBeLimited.set(cP);
// }
......@@ -2537,7 +2537,7 @@ void Foam::conformalVoronoiMesh::removeUnusedPoints
{
const face& f = faces[fI];
ptUsed.setMany(f);
ptUsed.set(f);
}
label pointi = 0;
......@@ -2587,8 +2587,8 @@ Foam::labelList Foam::conformalVoronoiMesh::removeUnusedCells
// Scan all faces to find all of the cells that are used
cellUsed.setMany(owner);
cellUsed.setMany(neighbour);
cellUsed.set(owner);
cellUsed.set(neighbour);
label celli = 0;
......
......@@ -1369,7 +1369,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findRemainingProtrusionSet
for (const label pointi : protrudingBoundaryPoints)
{
const labelList& pCells = mesh.pointCells()[pointi];
protrudingCells.insertMany(pCells);
protrudingCells.insert(pCells);
}
label protrudingCellsSize = protrudingCells.size();
......
......@@ -891,7 +891,7 @@ void Foam::meshDualiser::setRefinement
{
const labelList& fEdges = mesh_.faceEdges()[facei];
isBoundaryEdge.setMany(fEdges);
isBoundaryEdge.set(fEdges);
}
......
......@@ -349,7 +349,7 @@ int main(int argc, char *argv[])
forAll(oldToNew, oldCelli)
{
const labelList& added = oldToNew[oldCelli];
newCells.insertMany(added);
newCells.insert(added);
}
Info<< "Writing refined cells ("
......
......@@ -300,7 +300,7 @@ void Foam::regionSide::walkAllPointConnectedFaces
{
const labelList& fEdges = mesh.faceEdges()[facei];
regionEdges.insertMany(fEdges);
regionEdges.insert(fEdges);
}
......
......@@ -311,7 +311,7 @@ int main(int argc, char *argv[])
wordHashSet names;
forAllConstIters(rp, iter)
{
names.insertMany(iter.object());
names.insert(iter.object());
}
regionNames = names.sortedToc();
......
......@@ -451,7 +451,7 @@ void Foam::domainDecomposition::decomposeMesh()
const labelList& facePoints = fcs[mag(facei) - 1];
// Mark the face points as being used
pointsInUse.setMany(facePoints);
pointsInUse.set(facePoints);
}
procPointAddressing_[proci] = pointsInUse.sortedToc();
......
......@@ -186,7 +186,7 @@ int main(int argc, char *argv[])
wordHashSet names;
forAllConstIters(rp, iter)
{
names.insertMany(iter.object());
names.insert(iter.object());
}
regionNames = names.sortedToc();
......
......@@ -227,7 +227,7 @@ void Foam::vtkPVFoam::updateInfoLagrangian
for (const instant& t : dbPtr_().times())
{
names.insertMany
names.insert
(
readDir
(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment