diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C index 140babc1b9..536e7dd8a9 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C @@ -200,7 +200,7 @@ int main(int argc, char *argv[]) ) { patchMasterBlocks[patchi] = -1; - rawPatches[patchi].setSize(0); + rawPatches[patchi].clear(); } else { diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index 3700bc8b87..0fdc03b2c7 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -1211,7 +1211,7 @@ int main(int argc, char *argv[]) { meshMod.addPoint(points[pointi], pointi, -1, true); } - points.setSize(0); + points.clear(); // Add all cells for (label celli = 0; celli < nCells; celli++) @@ -1411,9 +1411,9 @@ int main(int argc, char *argv[]) } // Reclaim storage - faces.setSize(0); - owner.setSize(0); - neighbour.setSize(0); + faces.clear(); + owner.clear(); + neighbour.clear(); // Modify mesh diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 1d9f361e9d..125995083d 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -1059,7 +1059,7 @@ int main(int argc, char *argv[]) } } - patchFaces.setSize(0); // Assume that this is no patch at all + patchFaces.clear(); // Assume that this is no patch at all if (cellCorrespondence[faceIndices[0]] >= 0) { diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/uniform/uniform.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/uniform/uniform.C index cd522974fe..779996d500 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/uniform/uniform.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/uniform/uniform.C @@ -71,8 +71,8 @@ bool uniform::sizeLocations scalarField& shapeSizes ) const { - shapePts.setSize(0); - shapeSizes.setSize(0); + shapePts.clear(); + shapeSizes.clear(); return true; } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C index 255c6a4389..f8314ce489 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C @@ -245,10 +245,10 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing // Clear the temporary storage for the coarse cell data - cCellnFaces.setSize(0); - cCellFaces.setSize(0); - initCoarseNeighb.setSize(0); - coarseFaceMap.setSize(0); + cCellnFaces.clear(); + cCellFaces.clear(); + initCoarseNeighb.clear(); + coarseFaceMap.clear(); // Create coarse-level interfaces diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C index 75703ddaeb..a7d76831b7 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C @@ -208,10 +208,10 @@ void Foam::polyMesh::clearPrimitives() { resetMotion(); - points_.setSize(0); - faces_.setSize(0); - owner_.setSize(0); - neighbour_.setSize(0); + points_.clear(); + faces_.clear(); + owner_.clear(); + neighbour_.clear(); clearedPrimitives_ = true; } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C index c850d08db2..0419af3041 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C @@ -324,10 +324,10 @@ void Foam::coupledPolyPatch::calcTransformTensors if (Cf.size() == 0) { // Dummy geometry. Assume non-separated, parallel. - separation_.setSize(0); + separation_.clear(); forwardT_.clear(); reverseT_.clear(); - collocated_.setSize(0); + collocated_.clear(); } else { @@ -352,7 +352,7 @@ void Foam::coupledPolyPatch::calcTransformTensors // Assume per-face differing transformation, correct later - separation_.setSize(0); + separation_.clear(); forwardT_.setSize(Cf.size()); reverseT_.setSize(Cf.size()); @@ -390,8 +390,8 @@ void Foam::coupledPolyPatch::calcTransformTensors { // Translational or (unknown and normals aligned) - forwardT_.setSize(0); - reverseT_.setSize(0); + forwardT_.clear(); + reverseT_.clear(); separation_ = Cr - Cf; @@ -443,7 +443,7 @@ void Foam::coupledPolyPatch::calcTransformTensors << ". Assuming zero separation." << endl; } - separation_.setSize(0); + separation_.clear(); collocated_ = boolList(1, true); } else diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index b2e912e00f..f42eb85f15 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -294,7 +294,7 @@ void Foam::cyclicPolyPatch::calcTransforms const_cast(forwardT()) = tensorField(1, revT.T()); const_cast(reverseT()) = tensorField(1, revT); - const_cast(separation()).setSize(0); + const_cast(separation()).clear(); const_cast(collocated()) = boolList(1, false); } else diff --git a/src/conversion/polyDualMesh/polyDualMesh.C b/src/conversion/polyDualMesh/polyDualMesh.C index 89b89bb7f7..f60f0106d7 100644 --- a/src/conversion/polyDualMesh/polyDualMesh.C +++ b/src/conversion/polyDualMesh/polyDualMesh.C @@ -1229,20 +1229,20 @@ void Foam::polyDualMesh::calcDual // Create cells. cellList dualCells(mesh.nPoints()); - forAll(dualCells, celli) - { - dualCells[celli].setSize(0); - } + // unnecessary... + // forAll(dualCells, celli) + // { + // dualCells[celli].clear(); + // } forAll(dualOwner, facei) { label celli = dualOwner[facei]; - labelList& cFaces = dualCells[celli]; - - label sz = cFaces.size(); - cFaces.setSize(sz+1); - cFaces[sz] = facei; + if (celli != -1) + { + dualCells[celli].push_back(facei); + } } forAll(dualNeighbour, facei) { @@ -1250,11 +1250,7 @@ void Foam::polyDualMesh::calcDual if (celli != -1) { - labelList& cFaces = dualCells[celli]; - - label sz = cFaces.size(); - cFaces.setSize(sz+1); - cFaces[sz] = facei; + dualCells[celli].push_back(facei); } } diff --git a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C index 3d8a01bcb5..c63e3c0ca7 100644 --- a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C +++ b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C @@ -1006,7 +1006,7 @@ Foam::label Foam::polyMeshFilter::filterEdges label nOuterIterations = 0; minEdgeLen_.resize(mesh_.nEdges(), minLen()); - faceFilterFactor_.resize(0); + faceFilterFactor_.clear(); labelList pointErrorCount(mesh_.nPoints(), Zero); diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index 28609e9891..8bbd96b67b 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -445,7 +445,7 @@ void Foam::InteractionLists::buildInteractionLists() // At this point, wallFaceBbsToExchange does not need to be // maintained or distributed as it is not longer needed. - wallFaceBbsToExchange.setSize(0); + wallFaceBbsToExchange.clear(); wallFaceMap().reverseDistribute ( @@ -615,9 +615,9 @@ void Foam::InteractionLists::findExtendedProcBbsInRange List