diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C b/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C index ce6eb6c03d..898b69d991 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C @@ -260,7 +260,7 @@ cellShape create3DCellShape meshFaceLabels[i - 1] = meshFaceLabels[i]; } - meshFaceLabels[meshFaceLabels.size() - 1] = firstLabel; + meshFaceLabels.last() = firstLabel; } } diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C index d0e47d6c79..01621bb1d1 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C +++ b/applications/utilities/mesh/manipulation/mergeMeshes/mergePolyMesh.C @@ -80,7 +80,7 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p) << pName << " in mesh " << caseName << " already exists, but patch types " << " do not match.\nCreating a composite name as " - << patchNames_[patchNames_.size() - 1] << endl; + << patchNames_.last() << endl; } else { diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C index 53afd8e346..6b227cc24c 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C @@ -150,7 +150,7 @@ void Foam::processorLduInterface::compressedSend fArray[i] = sArray[i] - slast[i%nCmpts]; } - reinterpret_cast(fArray[nm1]) = f[f.size() - 1]; + reinterpret_cast(fArray[nm1]) = f.last(); if (commsType == Pstream::blocking || commsType == Pstream::scheduled) { @@ -235,7 +235,7 @@ void Foam::processorLduInterface::compressedReceive const float *fArray = reinterpret_cast(receiveBuf_.begin()); - f[f.size() - 1] = reinterpret_cast(fArray[nm1]); + f.last() = reinterpret_cast(fArray[nm1]); scalar *sArray = reinterpret_cast(f.begin()); const scalar *slast = &sArray[nm1]; diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index 97c1abfd8b..b478c03a27 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -750,7 +750,7 @@ Foam::edgeList Foam::face::edges() const } // add last edge - e[points.size() - 1] = edge(points[points.size() - 1], points[0]); + e.last() = edge(points.last(), points[0]); return e; } diff --git a/src/conversion/meshReader/createPolyBoundary.C b/src/conversion/meshReader/createPolyBoundary.C index 16ea5d2a98..712ed643e0 100644 --- a/src/conversion/meshReader/createPolyBoundary.C +++ b/src/conversion/meshReader/createPolyBoundary.C @@ -305,7 +305,7 @@ void Foam::meshReader::createPolyBoundary() if (nMissingFaces > 0) { - patchSizes_[patchSizes_.size() - 1] = nMissingFaces; + patchSizes_.last() = nMissingFaces; } else { diff --git a/src/dynamicMesh/polyMeshAdder/polyMeshAdder.C b/src/dynamicMesh/polyMeshAdder/polyMeshAdder.C index d5041792f1..845150a035 100644 --- a/src/dynamicMesh/polyMeshAdder/polyMeshAdder.C +++ b/src/dynamicMesh/polyMeshAdder/polyMeshAdder.C @@ -127,7 +127,7 @@ Foam::label Foam::polyMeshAdder::patchIndex << pName << " in mesh " << caseName << " already exists, but patch types" << " do not match.\nCreating a composite name as " - << allPatchNames[allPatchNames.size() - 1] << endl; + << allPatchNames.last() << endl; return allPatchNames.size() - 1; } diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C index 5744a7b379..ffc999328b 100644 --- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C +++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C @@ -519,7 +519,7 @@ void Foam::enrichedPatch::calcCutFaces() const // Reverse the face such that it // points out of the master patch - cf[cf.size() - 1].flip(); + cf.last().flip(); if (debug) { diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C index 57cce2960f..7c9774abfa 100644 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C +++ b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C @@ -101,8 +101,8 @@ Foam::swirlInjector::swirlInjector ( mag ( - massFlowRateProfile_[massFlowRateProfile_.size() - 1][0] - - injectionPressureProfile_[injectionPressureProfile_.size() - 1][0] + massFlowRateProfile_.last()[0] + - injectionPressureProfile_.last()[0] ) > SMALL ) { diff --git a/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C b/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C index de78e0fd93..f8ed7766b5 100644 --- a/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C +++ b/src/meshTools/polyMeshZipUpCells/polyMeshZipUpCells.C @@ -447,9 +447,7 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh) point startPoint = Points[unorderedEdge[0]]; dist[0] = 0; - vector dir = - Points[unorderedEdge[unorderedEdge.size() - 1]] - - startPoint; + vector dir = Points[unorderedEdge.last()] - startPoint; for (label i = 1; i < dist.size(); i++) { @@ -509,7 +507,7 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh) edge testEdge ( orderedEdge[0], - orderedEdge[orderedEdge.size() - 1] + orderedEdge.last() ); // In order to avoid edge-to-edge comparison, get faces using diff --git a/src/meshTools/searchableSurface/searchableSurfaceCollection.C b/src/meshTools/searchableSurface/searchableSurfaceCollection.C index a182841060..97a2b9301e 100644 --- a/src/meshTools/searchableSurface/searchableSurfaceCollection.C +++ b/src/meshTools/searchableSurface/searchableSurfaceCollection.C @@ -292,7 +292,7 @@ const Foam::wordList& Foam::searchableSurfaceCollection::regions() const Foam::label Foam::searchableSurfaceCollection::size() const { - return indexOffset_[indexOffset_.size()-1]; + return indexOffset_.last(); } diff --git a/src/meshTools/searchableSurface/triSurfaceMesh.C b/src/meshTools/searchableSurface/triSurfaceMesh.C index 058c26a0d4..937b3945c0 100644 --- a/src/meshTools/searchableSurface/triSurfaceMesh.C +++ b/src/meshTools/searchableSurface/triSurfaceMesh.C @@ -238,7 +238,7 @@ void Foam::triSurfaceMesh::getNextIntersections while (true) { // Start tracking from last hit. - point pt = hits[hits.size()-1].hitPoint() + perturbVec; + point pt = hits.last().hitPoint() + perturbVec; if (((pt-start)&dirVec) > magSqrDirVec) { diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C index 4af0d616d4..172ec32ef5 100644 --- a/src/triSurface/triSurface/triSurface.C +++ b/src/triSurface/triSurface/triSurface.C @@ -514,7 +514,7 @@ Foam::surfacePatchList Foam::triSurface::calcPatches(labelList& faceMap) const maxRegion = max ( maxRegion, - operator[](faceMap[faceMap.size() - 1]).region() + operator[](faceMap.last()).region() ); }