mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
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:
@ -122,10 +122,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const labelList& pCells = mesh.pointCells()[meshPointi];
|
||||
|
||||
forAll(pCells, pCelli)
|
||||
{
|
||||
cutCells.insert(pCells[pCelli]);
|
||||
}
|
||||
cutCells.insertMany(pCells);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -184,11 +184,7 @@ int main(int argc, char *argv[])
|
||||
const DynamicList<label>& bin = bins[binI];
|
||||
|
||||
cellSet cells(mesh, "vol" + name(binI), bin.size());
|
||||
|
||||
forAll(bin, i)
|
||||
{
|
||||
cells.insert(bin[i]);
|
||||
}
|
||||
cells.insertMany(bin);
|
||||
|
||||
Info<< " " << lowerLimits[binI] << " .. " << upperLimits[binI]
|
||||
<< " : writing " << bin.size() << " cells to cellSet "
|
||||
|
||||
@ -633,10 +633,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
cellSet cutSet(mesh, "cutSet", cutCells.size());
|
||||
forAll(cutCells, i)
|
||||
{
|
||||
cutSet.insert(cutCells[i]);
|
||||
}
|
||||
cutSet.insertMany(cutCells);
|
||||
|
||||
// Gets cuts across cells from cuts through edges.
|
||||
Info<< "Writing " << cutSet.size() << " cells to cut to cellSet "
|
||||
|
||||
@ -956,11 +956,7 @@ int main(int argc, char *argv[])
|
||||
forAll(dofVertIndices, patchi)
|
||||
{
|
||||
const labelList& foamVerts = dofVertIndices[patchi];
|
||||
|
||||
forAll(foamVerts, i)
|
||||
{
|
||||
dofGroups[patchi].insert(foamVerts[i]);
|
||||
}
|
||||
dofGroups[patchi].insertMany(foamVerts);
|
||||
}
|
||||
|
||||
List<DynamicList<face>> dynPatchFaces(dofVertIndices.size());
|
||||
|
||||
@ -344,10 +344,7 @@ void writePointCells
|
||||
{
|
||||
const labelList& cEdges = mesh.cellEdges()[pCells[i]];
|
||||
|
||||
forAll(cEdges, i)
|
||||
{
|
||||
allEdges.insert(cEdges[i]);
|
||||
}
|
||||
allEdges.insertMany(cEdges);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -795,10 +795,7 @@ int main(int argc, char *argv[])
|
||||
forAll(addedCells, facei)
|
||||
{
|
||||
const labelList& aCells = addedCells[facei];
|
||||
forAll(aCells, i)
|
||||
{
|
||||
addedCellsSet.insert(aCells[i]);
|
||||
}
|
||||
addedCellsSet.insertMany(aCells);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -527,10 +527,7 @@ label findUncoveredPatchFace
|
||||
{
|
||||
// Make set of extruded faces.
|
||||
labelHashSet extrudeFaceSet(extrudeMeshFaces.size());
|
||||
forAll(extrudeMeshFaces, i)
|
||||
{
|
||||
extrudeFaceSet.insert(extrudeMeshFaces[i]);
|
||||
}
|
||||
extrudeFaceSet.insertMany(extrudeMeshFaces);
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
|
||||
@ -564,10 +561,7 @@ label findUncoveredCyclicPatchFace
|
||||
{
|
||||
// Make set of extruded faces.
|
||||
labelHashSet extrudeFaceSet(extrudeMeshFaces.size());
|
||||
forAll(extrudeMeshFaces, i)
|
||||
{
|
||||
extrudeFaceSet.insert(extrudeMeshFaces[i]);
|
||||
}
|
||||
extrudeFaceSet.insertMany(extrudeMeshFaces);
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
|
||||
|
||||
@ -1053,10 +1053,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
|
||||
|
||||
nInvalidPolyhedra++;
|
||||
|
||||
forAll(cells[cI], cFI)
|
||||
{
|
||||
wrongFaces.insert(cells[cI][cFI]);
|
||||
}
|
||||
wrongFaces.insertMany(cells[cI]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1096,11 +1093,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
|
||||
if (nInternalFaces[cI] <= 1)
|
||||
{
|
||||
oneInternalFaceCells++;
|
||||
|
||||
forAll(cells[cI], cFI)
|
||||
{
|
||||
wrongFaces.insert(cells[cI][cFI]);
|
||||
}
|
||||
wrongFaces.insertMany(cells[cI]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1132,13 +1125,8 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
|
||||
// forAll(f, fPtI)
|
||||
// {
|
||||
// label ptI = f[fPtI];
|
||||
|
||||
// const labelList& pC = ptCells[ptI];
|
||||
|
||||
// forAll(pC, pCI)
|
||||
// {
|
||||
// limitCells.insert(pC[pCI]);
|
||||
// }
|
||||
// limitCells.insertMany(pC);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -1366,15 +1366,10 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findRemainingProtrusionSet
|
||||
mesh.nCells()/1000
|
||||
);
|
||||
|
||||
forAllConstIter(labelHashSet, protrudingBoundaryPoints, iter)
|
||||
for (const label pointi : protrudingBoundaryPoints)
|
||||
{
|
||||
const label pointi = iter.key();
|
||||
const labelList& pCells = mesh.pointCells()[pointi];
|
||||
|
||||
forAll(pCells, pCI)
|
||||
{
|
||||
protrudingCells.insert(pCells[pCI]);
|
||||
}
|
||||
protrudingCells.insertMany(pCells);
|
||||
}
|
||||
|
||||
label protrudingCellsSize = protrudingCells.size();
|
||||
|
||||
@ -349,11 +349,7 @@ int main(int argc, char *argv[])
|
||||
forAll(oldToNew, oldCelli)
|
||||
{
|
||||
const labelList& added = oldToNew[oldCelli];
|
||||
|
||||
forAll(added, i)
|
||||
{
|
||||
newCells.insert(added[i]);
|
||||
}
|
||||
newCells.insertMany(added);
|
||||
}
|
||||
|
||||
Info<< "Writing refined cells ("
|
||||
|
||||
@ -301,10 +301,7 @@ void Foam::regionSide::walkAllPointConnectedFaces
|
||||
const label facei = iter.key();
|
||||
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||
|
||||
forAll(fEdges, fEdgeI)
|
||||
{
|
||||
regionEdges.insert(fEdges[fEdgeI]);
|
||||
}
|
||||
regionEdges.insertMany(fEdges);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -311,7 +311,7 @@ int main(int argc, char *argv[])
|
||||
wordHashSet names;
|
||||
forAllConstIters(rp, iter)
|
||||
{
|
||||
names.insert(iter.object());
|
||||
names.insertMany(iter.object());
|
||||
}
|
||||
|
||||
regionNames = names.sortedToc();
|
||||
|
||||
@ -186,7 +186,7 @@ int main(int argc, char *argv[])
|
||||
wordHashSet names;
|
||||
forAllConstIters(rp, iter)
|
||||
{
|
||||
names.insert(iter.object());
|
||||
names.insertMany(iter.object());
|
||||
}
|
||||
|
||||
regionNames = names.sortedToc();
|
||||
|
||||
@ -103,9 +103,9 @@ if (timeDirs.size())
|
||||
fileName::FILE
|
||||
);
|
||||
|
||||
forAll(contents, fileI)
|
||||
for (const fileName& file : contents)
|
||||
{
|
||||
missing.erase(contents[fileI].name());
|
||||
missing.erase(file.name());
|
||||
}
|
||||
|
||||
volumeFields.erase(missing);
|
||||
|
||||
@ -227,7 +227,7 @@ void Foam::vtkPVFoam::updateInfoLagrangian
|
||||
|
||||
for (const instant& t : dbPtr_().times())
|
||||
{
|
||||
names.insert
|
||||
names.insertMany
|
||||
(
|
||||
readDir
|
||||
(
|
||||
|
||||
@ -123,7 +123,7 @@ Foam::boundaryInfo::boundaryInfo(const Time& runTime, const word& regionName)
|
||||
if (dict.found("inGroups"))
|
||||
{
|
||||
dict.lookup("inGroups") >> groups_[patchI];
|
||||
allGroupNames_.insert(groups_[patchI]);
|
||||
allGroupNames_.insertMany(groups_[patchI]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,9 +225,9 @@ void syncEdges(const triSurface& p, labelHashSet& markedEdges)
|
||||
const edgeList& edges = p.edges();
|
||||
edgeHashSet edgeSet(2*markedEdges.size());
|
||||
|
||||
forAllConstIter(labelHashSet, markedEdges, iter)
|
||||
for (const label edgei : markedEdges)
|
||||
{
|
||||
edgeSet.insert(edges[iter.key()]);
|
||||
edgeSet.insert(edges[edgei]);
|
||||
}
|
||||
|
||||
forAll(edges, edgei)
|
||||
|
||||
@ -202,11 +202,7 @@ int main(int argc, char *argv[])
|
||||
for (const wordRe& zoneName : zoneNames)
|
||||
{
|
||||
labelList zoneIDs = findStrings(zoneName, allZoneNames);
|
||||
|
||||
forAll(zoneIDs, j)
|
||||
{
|
||||
includeFaceZones.insert(zoneIDs[j]);
|
||||
}
|
||||
includeFaceZones.insertMany(zoneIDs);
|
||||
|
||||
if (zoneIDs.empty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user