diff --git a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C index 7732c985b8484a2c822c846c3a5b554da162aa80..402b26295d5340ae26d512c2d2d23a3983281c8a 100644 --- a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C +++ b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C @@ -126,41 +126,41 @@ int main(int argc, char *argv[]) // Create bin0. Have upperlimit as factor times lowerlimit. bins.append(DynamicList<label>()); lowerLimits.append(sortedVols[0]); - upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]); + upperLimits.append(1.1 * lowerLimits.last()); forAll(sortedVols, i) { - if (sortedVols[i] > upperLimits[upperLimits.size()-1]) + if (sortedVols[i] > upperLimits.last()) { // New value outside of current bin // Shrink old bin. - DynamicList<label>& bin = bins[bins.size()-1]; + DynamicList<label>& bin = bins.last(); bin.shrink(); Info<< "Collected " << bin.size() << " elements in bin " - << lowerLimits[lowerLimits.size()-1] << " .. " - << upperLimits[upperLimits.size()-1] << endl; + << lowerLimits.last() << " .. " + << upperLimits.last() << endl; // Create new bin. bins.append(DynamicList<label>()); lowerLimits.append(sortedVols[i]); - upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]); + upperLimits.append(1.1 * lowerLimits.last()); - Info<< "Creating new bin " << lowerLimits[lowerLimits.size()-1] - << " .. " << upperLimits[upperLimits.size()-1] + Info<< "Creating new bin " << lowerLimits.last() + << " .. " << upperLimits.last() << endl; } // Append to current bin. - DynamicList<label>& bin = bins[bins.size()-1]; + DynamicList<label>& bin = bins.last(); bin.append(sortedVols.indices()[i]); } Info<< endl; - bins[bins.size()-1].shrink(); + bins.last().shrink(); bins.shrink(); lowerLimits.shrink(); upperLimits.shrink(); diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index b66b9512a8568717d59067426539aaea4f469210..35b268d3e8c25ceb686f617bf05e11e53447a9c7 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -324,7 +324,7 @@ endOfSection {space}")"{space} // point group type skipped strtol(endPtr, &endPtr, 16); - pointi = pointGroupStartIndex[pointGroupStartIndex.size()-1]; + pointi = pointGroupStartIndex.last(); // reset number of components to default pointGroupNumberOfComponents = 3; @@ -336,11 +336,11 @@ endOfSection {space}")"{space} } Info<< "PointGroup: " - << pointGroupZoneID[pointGroupZoneID.size()-1] + << pointGroupZoneID.last() << " start: " - << pointGroupStartIndex[pointGroupStartIndex.size()-1] + << pointGroupStartIndex.last() << " end: " - << pointGroupEndIndex[pointGroupEndIndex.size()-1] << flush; + << pointGroupEndIndex.last() << flush; } <readNumberOfPoints,readPointGroupData>{endOfSection} { @@ -387,14 +387,14 @@ endOfSection {space}")"{space} Info<< "done." << endl; // check read of points - if (pointi != pointGroupEndIndex[pointGroupEndIndex.size()-1]+1) + if (pointi != pointGroupEndIndex.last()+1) { Warning << "Problem with reading points: " << nl << " start index: " - << pointGroupStartIndex[pointGroupStartIndex.size()-1] + << pointGroupStartIndex.last() << " end index: " - << pointGroupEndIndex[pointGroupEndIndex.size()-1] + << pointGroupEndIndex.last() << " last points read: " << pointi << nl << " on line " << lineNo << endl; } @@ -440,14 +440,14 @@ endOfSection {space}")"{space} faceGroupElementType = strtol(endPtr, &endPtr, 16); - facei = faceGroupStartIndex[faceGroupStartIndex.size()-1]; + facei = faceGroupStartIndex.last(); Info<< "FaceGroup: " - << faceGroupZoneID[faceGroupZoneID.size()-1] + << faceGroupZoneID.last() << " start: " - << faceGroupStartIndex[faceGroupStartIndex.size()-1] + << faceGroupStartIndex.last() << " end: " - << faceGroupEndIndex[faceGroupEndIndex.size()-1] << flush; + << faceGroupEndIndex.last() << flush; } <readNumberOfFaces,readFaceGroupData>{space}{endOfSection} { @@ -507,14 +507,14 @@ endOfSection {space}")"{space} Info<< "done." << endl; // check read of fluentFaces - if (facei != faceGroupEndIndex[faceGroupEndIndex.size()-1]+1) + if (facei != faceGroupEndIndex.last()+1) { Warning << "Problem with reading fluentFaces: " << nl << " start index: " - << faceGroupStartIndex[faceGroupStartIndex.size()-1] + << faceGroupStartIndex.last() << " end index: " - << faceGroupEndIndex[faceGroupEndIndex.size()-1] + << faceGroupEndIndex.last() << " last fluentFaces read: " << facei << nl << " on line " << lineNo << endl; } @@ -560,13 +560,13 @@ endOfSection {space}")"{space} cellGroupType.append(strtol(endPtr, &endPtr, 16)); Info<< "CellGroup: " - << cellGroupZoneID[cellGroupZoneID.size()-1] + << cellGroupZoneID.last() << " start: " - << cellGroupStartIndex[cellGroupStartIndex.size()-1] + << cellGroupStartIndex.last() << " end: " - << cellGroupEndIndex[cellGroupEndIndex.size()-1] + << cellGroupEndIndex.last() << " type: " - << cellGroupType[cellGroupType.size()-1] + << cellGroupType.last() << endl; } @@ -587,13 +587,13 @@ endOfSection {space}")"{space} strtol(endPtr, &endPtr, 16); Info<< "CellGroup: " - << cellGroupZoneID[cellGroupZoneID.size()-1] + << cellGroupZoneID.last() << " start: " - << cellGroupStartIndex[cellGroupStartIndex.size()-1] + << cellGroupStartIndex.last() << " end: " - << cellGroupEndIndex[cellGroupEndIndex.size()-1] + << cellGroupEndIndex.last() << " type: " - << cellGroupType[cellGroupType.size()-1] + << cellGroupType.last() << endl; } diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index a7f9d01a7f0a3285844e29ccf60cf260c3b01643..2365f418d792ed78f2c932001d801d8bcfde3896 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -885,7 +885,7 @@ int main(int argc, char *argv[]) // Now use the patchFaces to patch up the outside faces of the mesh. // Get the patch for all the outside faces (= default patch added as last) - const polyPatch& pp = mesh.boundaryMesh()[mesh.boundaryMesh().size()-1]; + const polyPatch& pp = mesh.boundaryMesh().last(); // Storage for faceZones. List<DynamicList<label> > zoneFaces(patchFaces.size()); diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 1776285e462db03cd31365ece6e603c9304e18eb..3192f610ad25a4afb766cfee9d125940934ff242 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -324,13 +324,13 @@ void readCells cellVerts.append(cellShape(tet, cVerts, true)); cellMaterial.append(physProp); - if (cellVerts[cellVerts.size()-1].size() != cVerts.size()) + if (cellVerts.last().size() != cVerts.size()) { Pout<< "Line:" << is.lineNumber() << " element:" << cellI << " type:" << feID << " collapsed from " << cVerts << nl - << " to:" << cellVerts[cellVerts.size()-1] + << " to:" << cellVerts.last() << endl; } } @@ -347,13 +347,13 @@ void readCells cellVerts.append(cellShape(prism, cVerts, true)); cellMaterial.append(physProp); - if (cellVerts[cellVerts.size()-1].size() != cVerts.size()) + if (cellVerts.last().size() != cVerts.size()) { Pout<< "Line:" << is.lineNumber() << " element:" << cellI << " type:" << feID << " collapsed from " << cVerts << nl - << " to:" << cellVerts[cellVerts.size()-1] + << " to:" << cellVerts.last() << endl; } } @@ -371,13 +371,13 @@ void readCells cellVerts.append(cellShape(hex, cVerts, true)); cellMaterial.append(physProp); - if (cellVerts[cellVerts.size()-1].size() != cVerts.size()) + if (cellVerts.last().size() != cVerts.size()) { Pout<< "Line:" << is.lineNumber() << " element:" << cellI << " type:" << feID << " collapsed from " << cVerts << nl - << " to:" << cellVerts[cellVerts.size()-1] + << " to:" << cellVerts.last() << endl; } } @@ -511,7 +511,7 @@ void readDOFS } Info<< "For DOF set " << group - << " named " << patchNames[patchNames.size()-1] + << " named " << patchNames.last() << " trying to read vertex indices." << endl; @@ -534,7 +534,7 @@ void readDOFS } Info<< "For DOF set " << group - << " named " << patchNames[patchNames.size()-1] + << " named " << patchNames.last() << " read " << vertices.size() << " vertex indices." << endl; dofVertices.append(vertices.shrink()); diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index 5aadec52c9cba46ff39ed64e92031a848eb8e0fe..5ce4ec9446513fa370ffa17f98bddf8253727a5e 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -418,8 +418,8 @@ int main(int argc, char *argv[]) frontPatchFaces.setSize(layerFaces.size()); forAll(backPatchFaces, i) { - backPatchFaces[i] = layerFaces[i][0]; - frontPatchFaces[i] = layerFaces[i][layerFaces[i].size()-1]; + backPatchFaces[i] = layerFaces[i].first(); + frontPatchFaces[i] = layerFaces[i].last(); } // Create dummy fvSchemes, fvSolution diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index c6fa2012188efe580b77cd5527572b7a09cfd58f..64403919f39d4899c7d7093b619bd93bb16e7334 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) { newPatches.append(findPatchID(mesh, patchNames[i])); Info<< "Using additional patch " << patchNames[i] - << " at index " << newPatches[newPatches.size()-1] << endl; + << " at index " << newPatches.last() << endl; } } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index fc0c3db61cbc4e968edb040fe328a0c1fc66f41c..d0a59b5116f4cd0a5dd8d73a16807b16856a5fc6 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) ensightMesh eMesh(mesh, args, binary); // Set Time to the last time before looking for the lagrangian objects - runTime.setTime(Times[Times.size()-1], Times.size()-1); + runTime.setTime(Times.last(), Times.size()-1); IOobjectList objects(mesh, runTime.timeName()); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/findFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/findFields.H index 63ef5eef21d7baee8c01bc8683fc29c16516cd4c..7a6bd938dc466be02a3dfa887bf732dbcd7db6dd 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/findFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/findFields.H @@ -8,7 +8,7 @@ HashTable< HashTable<word> > cloudFields; if (timeDirs.size()) { - IOobjectList objs(mesh, timeDirs[timeDirs.size()-1].name()); + IOobjectList objs(mesh, timeDirs.last().name()); forAllConstIter(IOobjectList, objs, fieldIter) { @@ -34,7 +34,7 @@ if (timeDirs.size()) fileNameList cloudDirs = readDir ( runTime.path() - / timeDirs[timeDirs.size()-1].name() + / timeDirs.last().name() / regionPrefix / cloud::prefix, fileName::DIRECTORY @@ -54,7 +54,7 @@ if (timeDirs.size()) IOobjectList objs ( mesh, - timeDirs[timeDirs.size()-1].name(), + timeDirs.last().name(), cloud::prefix/cloudName ); diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H index 712ce53b869072019ca37fa40c749d35197b1b2f..61957c323cd41bddd9388d91b215f03bfc03f8c4 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H @@ -87,7 +87,7 @@ int USERD_set_filenames // set the number of fields and store their names // a valid field must exist for all time-steps - runTime.setTime(timeDirs[timeDirs.size()-1], timeDirs.size()-1); + runTime.setTime(timeDirs.last(), timeDirs.size()-1); IOobjectList objects(*meshPtr, runTime.timeName()); fieldNames = objects.names(); diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C index 3ad01ef870cbed3bad0679237c047cff41b22df7..1f58708d283aaab20e2ebf128e6e2f918a6b23f0 100644 --- a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) { startIds[i+1] += startIds[i] + numIds[i]; } - label nParticle = startIds[startIds.size()-1] + numIds[startIds.size()-1]; + label nParticle = startIds.last() + numIds[startIds.size()-1]; diff --git a/applications/utilities/postProcessing/scalarField/pPrime2/pPrime2.C b/applications/utilities/postProcessing/scalarField/pPrime2/pPrime2.C index 54a7b53c461a55f77fc3a8d698bb89dce87aeac4..0e12decde29a7fe48ac4d10f747fbe1b629364b6 100644 --- a/applications/utilities/postProcessing/scalarField/pPrime2/pPrime2.C +++ b/applications/utilities/postProcessing/scalarField/pPrime2/pPrime2.C @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) # include "createMesh.H" - runTime.setTime(timeDirs[timeDirs.size()-1], timeDirs.size()-1); + runTime.setTime(timeDirs.last(), timeDirs.size()-1); volScalarField pMean ( diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C index 76792dc2f83cdffdbe6382f81ab31076230d14c6..d889ca784d95198171d2f1347ee819a5a35c82b1 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/general/general.C @@ -93,13 +93,13 @@ Foam::scalar Foam::tabulatedWallFunctions::general::interpolate { case itLinear: { - if (xi < x[0]) + if (xi <= x[0]) { return fx[0]; } - else if (xi > x[x.size()-1]) + else if (xi >= x.last()) { - return fx[x.size()-1]; + return fx.last(); } else { diff --git a/applications/utilities/surface/surfaceClean/collapseBase.C b/applications/utilities/surface/surfaceClean/collapseBase.C index 58168e5722a9a3cc79d59b0866209dfc368d099d..f5370d0c6091c65df15b1957d8292d00382e0b1b 100644 --- a/applications/utilities/surface/surfaceClean/collapseBase.C +++ b/applications/utilities/surface/surfaceClean/collapseBase.C @@ -128,7 +128,7 @@ static void splitTri labelledTri ( f[fp2], - splitPoints[splitPoints.size()-1], + splitPoints.last(), f[fp1], f.region() ) @@ -144,7 +144,7 @@ static void splitTri ( f[fp1], f[fp2], - splitPoints[splitPoints.size()-1], + splitPoints.last(), f.region() ) ); diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 84524d1fc645365ec64019a851f1ce966482d8b5..2580a6592c033041928a5ea04f100664f7caecc1 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -129,7 +129,7 @@ void Foam::Time::setControls() { if (timeDirs.size()) { - startTime_ = timeDirs[timeDirs.size()-1].value(); + startTime_ = timeDirs.last().value(); } } else @@ -419,9 +419,9 @@ Foam::instant Foam::Time::findClosestTime(const scalar t) const { return timeDirs[1]; } - else if (t > timeDirs[timeDirs.size()-1].value()) + else if (t > timeDirs.last().value()) { - return timeDirs[timeDirs.size()-1]; + return timeDirs.last(); } label nearestIndex = -1; diff --git a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsCheck.C b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsCheck.C index a644cd1934901290b85d83305034cb6f2bdf3d9d..1d74afb48ab435342d4136dac8095641df0432d3 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsCheck.C @@ -95,7 +95,7 @@ Foam::PatchTools::checkOrientation const Face& f = p[faceI]; const point& p0 = p.points()[f[0]]; const point& p1 = p.points()[f[1]]; - const point& p2 = p.points()[f[f.size()-1]]; + const point& p2 = p.points()[f.last()]; const vector pointNormal((p1 - p0) ^ (p2 - p0)); if ((pointNormal & p.faceNormals()[faceI]) < 0) diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index 5dda9f504d68d0a1fbf342e46bea069585dfc19d..a6aaaf3b16918d7cffd1a39cb01ccec113b337fd 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -856,7 +856,7 @@ bool Foam::primitiveMesh::checkFaceAngles const face& f = fcs[faceI]; // Get edge from f[0] to f[size-1]; - vector ePrev(p[f[0]] - p[f[f.size()-1]]); + vector ePrev(p[f.first()] - p[f.last()]); scalar magEPrev = mag(ePrev); ePrev /= magEPrev + VSMALL; diff --git a/src/conversion/polyDualMesh/polyDualMesh.C b/src/conversion/polyDualMesh/polyDualMesh.C index 1332d90fd4bdab5cb3168c854f777a9d01ea5b49..1d04252b1e726a74d14a8b0d8688c1c22378a08e 100644 --- a/src/conversion/polyDualMesh/polyDualMesh.C +++ b/src/conversion/polyDualMesh/polyDualMesh.C @@ -1015,7 +1015,7 @@ void Foam::polyDualMesh::calcDual { // Check orientation. - const face& f = dynDualFaces[dynDualFaces.size()-1]; + const face& f = dynDualFaces.last(); vector n = f.normal(dualPoints); if (((mesh.points()[owner] - dualPoints[f[0]]) & n) > 0) { @@ -1130,7 +1130,7 @@ void Foam::polyDualMesh::calcDual { // Check orientation. - const face& f = dynDualFaces[dynDualFaces.size()-1]; + const face& f = dynDualFaces.last(); vector n = f.normal(dualPoints); if (((mesh.points()[owner] - dualPoints[f[0]]) & n) > 0) { diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C index c58fa9852e12b2a54976a86e5abf61451c49c01b..9660994749f9aae5d5c5f2f5dff43eb3d6e1a9c2 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C @@ -88,14 +88,14 @@ Foam::solidBodyMotionFunctions::tabulated6DoFMotion::transformation() const << exit(FatalError); } - if (t > times_[times_.size()-1]) + if (t > times_.last()) { FatalErrorIn ( "solidBodyMotionFunctions::tabulated6DoFMotion::transformation()" ) << "current time (" << t << ") is greater than the maximum in the data table (" - << times_[times_.size()-1] << ')' + << times_.last() << ')' << exit(FatalError); } diff --git a/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C b/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C index 9c4030ed81d95d295f21aad87fd26fa559c73df6..f42f2a4ef4130059d8aad52c65824d7e0e8b3a79 100644 --- a/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C +++ b/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C @@ -1276,7 +1276,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles faceNormal /= mag(faceNormal) + VSMALL; // Get edge from f[0] to f[size-1]; - vector ePrev(p[f[0]] - p[f[f.size()-1]]); + vector ePrev(p[f.first()] - p[f.last()]); scalar magEPrev = mag(ePrev); ePrev /= magEPrev + VSMALL; diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C index 41ba56aedba532d58a11226e2a264598cf558e1a..11b4178d3f0e243baa23696be44cac21fe4e80c1 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C @@ -1278,7 +1278,7 @@ void Foam::addPatchCellLayer::setRefinement doneEdge[fEdges[fp]] = true; fp = f.fcIndex(fp); } - stringedVerts[stringedVerts.size()-1] = f[fp]; + stringedVerts.last() = f[fp]; // Now stringedVerts contains the vertices in order of face f. @@ -1296,7 +1296,7 @@ void Foam::addPatchCellLayer::setRefinement for (label i = 0; i < numEdgeSideFaces; i++) { - label vEnd = stringedVerts[stringedVerts.size()-1]; + label vEnd = stringedVerts.last(); label vStart = stringedVerts[0]; // calculate number of points making up a face diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C index 51c92b035cecb17744c91f7d59f24cc5fabdffda..bb07db3eb8950c1abd8d44124b7551ca62e27f6f 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/combineFaces.C @@ -62,7 +62,7 @@ bool Foam::combineFaces::convexFace n /= mag(n); // Get edge from f[0] to f[size-1]; - vector ePrev(points[f[0]] - points[f[f.size()-1]]); + vector ePrev(points[f.first()] - points[f.last()]); scalar magEPrev = mag(ePrev); ePrev /= magEPrev + VSMALL; diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C index a47f8a06f11547ebd222a722a9b13c69af147a09..be15413fab57194b3408893063ff00cfc93a39e1 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C @@ -2222,7 +2222,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement faceCount ) ); - allFaceInfo[faceI] = seedFacesInfo[seedFacesInfo.size()-1]; + allFaceInfo[faceI] = seedFacesInfo.last(); } else { @@ -2238,7 +2238,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement faceCount ) ); - allFaceInfo[faceI] = seedFacesInfo[seedFacesInfo.size()-1]; + allFaceInfo[faceI] = seedFacesInfo.last(); } } diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C index 86be16d7a072c1febfce44b63b28066e6c3b41ae..3239c6a8e0efbf2118bf80a66eba35bb1e287ec2 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C @@ -745,7 +745,7 @@ Pout<< "refinementHistory::distribute :" newSplitCells.append(splitCells_[index]); Pout<< "Added oldCell " << index - << " info " << newSplitCells[newSplitCells.size()-1] + << " info " << newSplitCells.last() << " at position " << newSplitCells.size()-1 << endl; } diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C index cdd5a999ec1290068d5fb02c141830c419a28c53..80fc0d9bc4ac61ce1b4f07796117c8e12ff91e23 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C @@ -179,7 +179,7 @@ displacementInterpolationFvMotionSolver // Slightly tweak min and max face zone so points sort within zoneCoordinates[0] -= SMALL; - zoneCoordinates[zoneCoordinates.size()-1] += SMALL; + zoneCoordinates.last() += SMALL; // Check if we have static min and max mesh bounds const scalarField meshCoords = points0().component(dir); @@ -237,7 +237,7 @@ displacementInterpolationFvMotionSolver } rangeI++; } - if (maxCoord > zoneCoordinates[zoneCoordinates.size()-1]) + if (maxCoord > zoneCoordinates.last()) { label sz = rangeToCoord.size(); rangeToCoord.setSize(sz+1); diff --git a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C index 72acb4167969fbb2899b004c33ad4d80f1d73863..78cf9367b086f2291e0fcf76b37c76ca3d5f1185 100644 --- a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C +++ b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C @@ -104,8 +104,8 @@ Foam::commonRailInjector::commonRailInjector if ( - mag(injectionPressureProfile_[injectionPressureProfile_.size()-1][0] - - massFlowRateProfile_[massFlowRateProfile_.size()-1][0]) + mag(injectionPressureProfile_.last()[0] + - massFlowRateProfile_.last()[0]) > SMALL ) { @@ -330,13 +330,13 @@ Foam::scalar Foam::commonRailInjector::T(const scalar time) const Foam::scalar Foam::commonRailInjector::tsoi() const { - return massFlowRateProfile_[0][0]; + return massFlowRateProfile_.first()[0]; } Foam::scalar Foam::commonRailInjector::teoi() const { - return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; + return massFlowRateProfile_.last()[0]; } diff --git a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C index 4cd8780535accd344672733b51379515086e9dce..76c9e4ea5df4d8bbac8c708e52e8e7df40d72bad 100644 --- a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C +++ b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C @@ -99,8 +99,7 @@ Foam::definedInjector::definedInjector if ( - mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0] - - velocityProfile_[velocityProfile_.size()-1][0]) + mag(massFlowRateProfile_.last()[0] - velocityProfile_.last()[0]) > SMALL ) { @@ -331,13 +330,13 @@ Foam::scalar Foam::definedInjector::T(const scalar time) const Foam::scalar Foam::definedInjector::tsoi() const { - return massFlowRateProfile_[0][0]; + return massFlowRateProfile_.first()[0]; } Foam::scalar Foam::definedInjector::teoi() const { - return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; + return massFlowRateProfile_.last()[0]; } diff --git a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C index 4b2367c41a8dc6f2147ba0d435872239d2fe4b8d..ac5a1c3c3d93876fdbbd74ac4b8706a845fba915 100644 --- a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C +++ b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C @@ -91,8 +91,7 @@ Foam::multiHoleInjector::multiHoleInjector if ( - mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0] - - TProfile_[TProfile_.size()-1][0]) + mag(massFlowRateProfile_.last()[0] - TProfile_.last()[0]) > SMALL ) { @@ -351,13 +350,13 @@ Foam::scalar Foam::multiHoleInjector::T(const scalar time) const Foam::scalar Foam::multiHoleInjector::tsoi() const { - return massFlowRateProfile_[0][0]; + return massFlowRateProfile_.first()[0]; } Foam::scalar Foam::multiHoleInjector::teoi() const { - return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; + return massFlowRateProfile_.last()[0]; } diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C index 7d05a29a5c2526006631e75d5567f92e68ee3a2b..e1e0fe26f408f78d4baa00b79bce7b4aa564742f 100644 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C +++ b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C @@ -384,13 +384,13 @@ Foam::scalar Foam::swirlInjector::T(const scalar time) const Foam::scalar Foam::swirlInjector::tsoi() const { - return massFlowRateProfile_[0][0]; + return massFlowRateProfile_.first()[0]; } Foam::scalar Foam::swirlInjector::teoi() const { - return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; + return massFlowRateProfile_.last()[0]; } diff --git a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C index a3a1093eb624a12d152b7c6bee958ba5fe03ce2f..1e054f2d41fe3c1f506305be567c32b054002f6f 100644 --- a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C +++ b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C @@ -83,8 +83,8 @@ Foam::unitInjector::unitInjector if ( - mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0] - - TProfile_[TProfile_.size()-1][0]) + mag(massFlowRateProfile_.last()[0] + - TProfile_.last()[0]) > SMALL ) { @@ -306,13 +306,13 @@ Foam::scalar Foam::unitInjector::T(const scalar time) const Foam::scalar Foam::unitInjector::tsoi() const { - return massFlowRateProfile_[0][0]; + return massFlowRateProfile_.first()[0]; } Foam::scalar Foam::unitInjector::teoi() const { - return massFlowRateProfile_[massFlowRateProfile_.size()-1][0]; + return massFlowRateProfile_.last()[0]; } diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.C b/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.C index 98abaf6e67e533db1dfe4d19b0656ba548d9d333..ed009f8f3347eb6d97e4c82349711131836b41b2 100644 --- a/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.C +++ b/src/lagrangian/intermediate/submodels/IO/DataEntry/Table/Table.C @@ -64,7 +64,7 @@ template<class Type> Type Foam::Table<Type>::value(const scalar x) const { // Return zero if out of bounds - if ((x > table_[table_.size()-1].first()) || (x < table_[0].first())) + if (x < table_[0].first() || x > table_.last().first()) { return pTraits<Type>::zero; } diff --git a/src/lagrangian/molecularDynamics/molecularMeasurements/distribution/distribution.C b/src/lagrangian/molecularDynamics/molecularMeasurements/distribution/distribution.C index 7cc9e70c0ef6413a086dc1f33c8aefdaaa242840..a714a36924dda00814b6c0529535c823f4c1b3ab 100644 --- a/src/lagrangian/molecularDynamics/molecularMeasurements/distribution/distribution.C +++ b/src/lagrangian/molecularDynamics/molecularMeasurements/distribution/distribution.C @@ -256,7 +256,7 @@ void Foam::distribution::insertMissingKeys() if (keys.size()) { - for (label k = keys[0]; k < keys[keys.size()-1]; k++) + for (label k = keys[0]; k < keys.last(); k++) { iter = find(k); diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C index 8f47f9de8cec7d1cbc0f99b3228abc2084ff41fb..78c2fabfc251afe00763aefc95c4dc2a9a771d27 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C @@ -835,7 +835,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo vector::zero // passive data ) ); - pointMedialDist[pointI] = maxInfo[maxInfo.size()-1]; + pointMedialDist[pointI] = maxInfo.last(); } } } @@ -879,7 +879,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo vector::zero // passive data ) ); - pointMedialDist[pointI] = maxInfo[maxInfo.size()-1]; + pointMedialDist[pointI] = maxInfo.last(); } } } diff --git a/src/mesh/blockMesh/curvedEdges/polyLine.C b/src/mesh/blockMesh/curvedEdges/polyLine.C index e8872de6a2b983bddc0fb2c99e9a6cc0ba9f60c7..a08ab8fc4033a632d5e9a2fc1295f759b07c2905 100644 --- a/src/mesh/blockMesh/curvedEdges/polyLine.C +++ b/src/mesh/blockMesh/curvedEdges/polyLine.C @@ -47,7 +47,7 @@ void Foam::polyLine::calcDistances() } // normalize - lineLength_ = distances_[distances_.size()-1]; + lineLength_ = distances_.last(); for (label i=1; i<distances_.size(); i++) { distances_[i] /= lineLength_; @@ -95,7 +95,7 @@ Foam::vector Foam::polyLine::position(const scalar lambda) const } else if (lambda > 1 - SMALL) { - return controlPoints_[controlPoints_.size()-1]; + return controlPoints_.last(); } diff --git a/src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C b/src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C index 91afa7c23ee6fa7ce92f36ab3d01a107f4480bad..e20a0dddb607f418839d867cd686c10416098113 100644 --- a/src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C +++ b/src/meshTools/primitiveMeshGeometry/primitiveMeshGeometry.C @@ -796,7 +796,7 @@ bool Foam::primitiveMeshGeometry::checkFaceAngles faceNormal /= mag(faceNormal) + VSMALL; // Get edge from f[0] to f[size-1]; - vector ePrev(p[f[0]] - p[f[f.size()-1]]); + vector ePrev(p[f.first()] - p[f.last()]); scalar magEPrev = mag(ePrev); ePrev /= magEPrev + VSMALL; diff --git a/src/meshTools/searchableSurface/searchableBox.C b/src/meshTools/searchableSurface/searchableBox.C index 8b4c0f5c76c5c8abfd0b0ab5f432e268766769a8..a4cc593562a6460ac80f4998d7dc570c4651da71 100644 --- a/src/meshTools/searchableSurface/searchableBox.C +++ b/src/meshTools/searchableSurface/searchableBox.C @@ -496,7 +496,7 @@ void Foam::searchableBox::findLineAll if ( !inter.hit() - || (inter.index() == hits[hits.size()-1].index()) + || (inter.index() == hits.last().index()) ) { break; diff --git a/src/meshTools/searchableSurface/searchableSurfacesQueries.C b/src/meshTools/searchableSurface/searchableSurfacesQueries.C index b0d6322a740b3fe42012a114fa4687a24d89aac8..6b8c2841f32ce074702f903120821675caaed8f0 100644 --- a/src/meshTools/searchableSurface/searchableSurfacesQueries.C +++ b/src/meshTools/searchableSurface/searchableSurfacesQueries.C @@ -730,7 +730,7 @@ Foam::pointIndexHit Foam::searchableSurfacesQueries::facesIntersection } } - nearest[nearest.size()-1] = sumNearest / surfacesToTest.size(); + nearest.last() = sumNearest / surfacesToTest.size(); // Get the sum of distances (initial evaluation) diff --git a/src/meshTools/searchableSurface/triSurfaceMesh.C b/src/meshTools/searchableSurface/triSurfaceMesh.C index 950cd13285334a4849f187b61f678f0dc21b309d..5f9a846ace2144d0b2da506417959b5bdba0e067 100644 --- a/src/meshTools/searchableSurface/triSurfaceMesh.C +++ b/src/meshTools/searchableSurface/triSurfaceMesh.C @@ -632,7 +632,7 @@ void Foam::triSurfaceMesh::findLineAll if ( !inter.hit() - || (inter.index() == hits[hits.size()-1].index()) + || (inter.index() == hits.last().index()) ) { break; diff --git a/src/meshTools/triSurface/booleanOps/intersectedSurface/edgeSurface.C b/src/meshTools/triSurface/booleanOps/intersectedSurface/edgeSurface.C index 5caa377e0549a686d9388865c9bc7bf88e2ff04a..2e7ba2f8819aa16cd937ca1ac628b807bd55c544 100644 --- a/src/meshTools/triSurface/booleanOps/intersectedSurface/edgeSurface.C +++ b/src/meshTools/triSurface/booleanOps/intersectedSurface/edgeSurface.C @@ -213,7 +213,7 @@ Foam::edgeSurface::edgeSurface ( edge ( - extraVerts[extraVerts.size()-1] + nSurfacePoints_, + extraVerts.last() + nSurfacePoints_, e.end() ) ); diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C index 47c31f04bf049800c62eb0fd2fe4e1f740e9246c..86e97a49d385f90b9780eac412c707cd341c4346 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C @@ -258,12 +258,12 @@ bool Foam::edgeIntersections::inlinePerturb bool perturbEnd = false; // Check first intersection. - if (edgeEnds[0] == 0) + if (edgeEnds.first() == 0) { perturbStart = true; } - if (edgeEnds[edgeEnds.size()-1] == 1) + if (edgeEnds.last() == 1) { perturbEnd = true; } diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C index 33940989b8228a358caa1c19ebfda82404a94344..fffcd6792d4cb573fb967cdc63ad130948f6d8d4 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C @@ -242,8 +242,7 @@ void Foam::surfaceIntersection::storeIntersection // Check whether perhaps degenerate const point& prevHit = allCutPoints[*iter]; - - const point& thisHit = allCutPoints[allCutPoints.size()-1]; + const point& thisHit = allCutPoints.last(); if (mag(prevHit - thisHit) < SMALL) { diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C index b2a5eec086885c647d557aef1b4969bf236429f3..cdaf91b2e4207f94d5483deef15a8c1e5e83bad0 100644 --- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C +++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersectionFuncs.C @@ -160,7 +160,7 @@ void Foam::surfaceIntersection::removeDuplicates // Insert others only if they differ from one before label newVertI = map[oldElems[vertI]]; - if (newVertI != elems[elems.size()-1]) + if (newVertI != elems.last()) { elems[elemI++] = newVertI; } @@ -300,7 +300,7 @@ void Foam::surfaceIntersection::writeIntersectedEdges << extraVerts[i] + surf.nPoints() + 1 << endl; } - os << "l " << extraVerts[extraVerts.size()-1] + surf.nPoints() + 1 + os << "l " << extraVerts.last() + surf.nPoints() + 1 << ' ' << e.end()+1 << endl; } } diff --git a/src/parallel/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C b/src/parallel/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C index 4ee04a7cdfca385dbcb6f154d2096d9112bd6f10..5fa638649d42825ceb0b861cfff432e22778890d 100644 --- a/src/parallel/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C +++ b/src/parallel/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C @@ -165,7 +165,7 @@ void Foam::hierarchGeomDecomp::calculateSortedWeightedSizes // Non-dimensionalise and multiply by size. scalar globalCurrentLength = returnReduce ( - sortedWeightedSizes[current.size()], + sortedWeightedSizes[current.size()], sumOp<scalar>() ); // Normalise weights by global sum of weights and multiply through @@ -238,7 +238,7 @@ void Foam::hierarchGeomDecomp::findBinary if (returnReduce(hasNotChanged, andOp<bool>())) { WarningIn("hierarchGeomDecomp::findBinary(..)") - << "unable to find desired deomposition split, making do!" + << "unable to find desired deomposition split, making do!" << endl; break; } @@ -288,7 +288,7 @@ void Foam::hierarchGeomDecomp::findBinary Pout<< " low:" << low << " lowValue:" << lowValue << " high:" << high << " highValue:" << highValue << " mid:" << mid << " midValue:" << midValue << endl - << " globalSize:" << weightedSize + << " globalSize:" << weightedSize << " wantedSize:" << wantedSize << " sizeTol:" << sizeTol << endl; } @@ -318,7 +318,7 @@ void Foam::hierarchGeomDecomp::findBinary if (returnReduce(hasNotChanged, andOp<bool>())) { WarningIn("hierarchGeomDecomp::findBinary(..)") - << "unable to find desired deomposition split, making do!" + << "unable to find desired deomposition split, making do!" << endl; break; } @@ -375,7 +375,7 @@ void Foam::hierarchGeomDecomp::sortComponent ( ( sortedCoord.size() - ? sortedCoord[sortedCoord.size()-1] + ? sortedCoord.last() : -GREAT ), maxOp<scalar>() @@ -562,14 +562,14 @@ void Foam::hierarchGeomDecomp::sortComponent ( ( sortedCoord.size() - ? sortedCoord[sortedCoord.size()-1] + ? sortedCoord.last() : -GREAT ), maxOp<scalar>() ); if (debug) - { + { Pout<< "sortComponent : minCoord:" << minCoord << " maxCoord:" << maxCoord << endl; } @@ -592,7 +592,7 @@ void Foam::hierarchGeomDecomp::sortComponent // Value at right of bin (leftIndex+localSize-1) scalar rightCoord = -GREAT; - + if (bin == n_[compI]-1) { // Last bin. Copy all. @@ -602,7 +602,7 @@ void Foam::hierarchGeomDecomp::sortComponent else { // For the current bin (starting at leftCoord) we want a rightCoord - // such that the sum of all weighted sizes are + // such that the sum of all weighted sizes are // globalCurrentLength/n_[compI]. // We have to iterate to obtain this. diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C index f344fa870f151adba1bf62357491b574815b3dc8..c39b6188871026ece1c9cf16b83da7a5d934210b 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C @@ -84,7 +84,7 @@ Foam::vector Foam::streamLineParticle::interpolateFields const DynamicList<vector>& U = sampledVectors_[td.UIndex_]; - return U[U.size()-1]; + return U.last(); } @@ -226,21 +226,21 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td) // Transfer particle data into trackData. //td.allPositions_.append(sampledPositions_); td.allPositions_.append(vectorList()); - vectorList& top = td.allPositions_[td.allPositions_.size()-1]; + vectorList& top = td.allPositions_.last(); top.transfer(sampledPositions_); forAll(sampledScalars_, i) { //td.allScalars_[i].append(sampledScalars_[i]); td.allScalars_[i].append(scalarList()); - scalarList& top = td.allScalars_[i][td.allScalars_[i].size()-1]; + scalarList& top = td.allScalars_[i].last(); top.transfer(sampledScalars_[i]); } forAll(sampledVectors_, i) { //td.allVectors_[i].append(sampledVectors_[i]); td.allVectors_[i].append(vectorList()); - vectorList& top = td.allVectors_[i][td.allVectors_[i].size()-1]; + vectorList& top = td.allVectors_[i].last(); top.transfer(sampledVectors_[i]); } } diff --git a/src/surfMesh/MeshedSurface/MeshedSurfaceZones.C b/src/surfMesh/MeshedSurface/MeshedSurfaceZones.C index a31e8d6314ee75d921e8a340a04a0836b8596fc8..8e837e6f8572bffd61b4082b5abf012fe425b9d4 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurfaceZones.C +++ b/src/surfMesh/MeshedSurface/MeshedSurfaceZones.C @@ -53,7 +53,7 @@ void Foam::MeshedSurface<Face>::checkZones() << " ... extending final zone" << endl; - zones[zones.size()-1].size() += count - this->size(); + zones.last().size() += count - this->size(); } else if (count > this->size()) { diff --git a/src/surfMesh/surfMesh/surfMesh.C b/src/surfMesh/surfMesh/surfMesh.C index 71f6fd82c463d81f3b92f72afd200d015fbeab10..686271da9af8bf43c34efd1d08a3e40738976147 100644 --- a/src/surfMesh/surfMesh/surfMesh.C +++ b/src/surfMesh/surfMesh/surfMesh.C @@ -377,7 +377,7 @@ void Foam::surfMesh::checkZones() << " ... extending final zone" << endl; - zones[zones.size()-1].size() += count - nFaces(); + zones.last().size() += count - nFaces(); } else if (count > size()) {