diff --git a/applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C b/applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C index 78ac403e99..7573b8f537 100644 --- a/applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C +++ b/applications/solvers/combustion/PDRFoam/PDRFoamAutoRefine.C @@ -26,7 +26,7 @@ Application PDRFoam Description - Compressible premixed/partially-premixed combustion solver with turbulence + Compressible premixed/partially-premixed combustion solver with turbulence modelling. Combusting RANS code using the b-Xi two-equation model. @@ -121,7 +121,8 @@ scalar StCoNum = 0.0; // Test : disable refinement for some cells PackedList<1>& protectedCell = refCast(mesh).protectedCell(); - if (protectedCell.size() == 0) + + if (protectedCell.empty()) { protectedCell.setSize(mesh.nCells()); protectedCell = 0; @@ -135,7 +136,7 @@ scalar StCoNum = 0.0; } } - //volScalarField pIndicator("pIndicator", + //volScalarField pIndicator("pIndicator", // p*(fvc::laplacian(p)) // / ( // magSqr(fvc::grad(p)) diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C index 6ad19ab287..82e6f2c4c9 100644 --- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C +++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C @@ -413,7 +413,7 @@ bool limitRefinementLevel } } - if (addCutCells.size() > 0) + if (addCutCells.size()) { // Add cells to cutCells. @@ -479,7 +479,7 @@ void doRefinement { const labelList& added = addedCells[oldCellI]; - if (added.size() > 0) + if (added.size()) { // Give all cells resulting from split the refinement level // of the master. @@ -895,7 +895,7 @@ int main(int argc, char *argv[]) << " Selected for refinement :" << cutCells.size() << nl << endl; - if (cutCells.size() == 0) + if (cutCells.empty()) { Info<< "Stopping refining since 0 cells selected to be refined ..." << nl << endl; diff --git a/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C b/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C index a153b0ac66..67fdc0807e 100644 --- a/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C +++ b/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C @@ -358,18 +358,21 @@ int main(int argc, char *argv[]) ( dict.lookup("facesToTriangulate") ); + bool cutBoundary = - pointsToMove.size() > 0 - || edgesToSplit.size() > 0 - || facesToTriangulate.size() > 0; + ( + pointsToMove.size() + || edgesToSplit.size() + || facesToTriangulate.size() + ); List > edgesToCollapse(dict.lookup("edgesToCollapse")); - bool collapseEdge = edgesToCollapse.size() > 0; + bool collapseEdge = edgesToCollapse.size(); List > cellsToPyramidise(dict.lookup("cellsToSplit")); - bool cellsToSplit = cellsToPyramidise.size() > 0; + bool cellsToSplit = cellsToPyramidise.size(); //List > // cellsToCreate(dict.lookup("cellsToCreate")); @@ -523,7 +526,7 @@ int main(int argc, char *argv[]) Info<< nl << "There was a problem in one of the inputs in the" << " dictionary. Not modifying mesh." << endl; } - else if (cellToPyrCentre.size() > 0) + else if (cellToPyrCentre.size()) { Info<< nl << "All input cells located. Modifying mesh." << endl; @@ -555,7 +558,7 @@ int main(int argc, char *argv[]) Info << "Writing modified mesh to time " << runTime.value() << endl; mesh.write(); } - else if (edgeToPos.size() > 0) + else if (edgeToPos.size()) { Info<< nl << "All input edges located. Modifying mesh." << endl; diff --git a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C index 16747f4134..25b13eba88 100644 --- a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C +++ b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C @@ -336,7 +336,7 @@ int main(int argc, char *argv[]) ) {} - if (refCells.size() > 0) + if (refCells.size()) { Info<< "Collected " << refCells.size() << " cells that need to be" << " refined to get closer to overall 2:1 refinement level limit" diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index ff6d22940c..4e5b501b85 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -652,7 +652,7 @@ int main(int argc, char *argv[]) // Remove cut cells from cellsToCut (Note:only relevant if -readSet) forAll(cuts.cellLoops(), cellI) { - if (cuts.cellLoops()[cellI].size() > 0) + if (cuts.cellLoops()[cellI].size()) { //Info<< "Removing cut cell " << cellI << " from wishlist" // << endl; diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C index bb0a01fd1b..df84d13a79 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C @@ -584,7 +584,7 @@ int main(int argc, char *argv[]) forAll (rawPatches, patchI) { - if (rawPatches[patchI].size() > 0 && cfxPatchTypes[patchI] != "BLKBDY") + if (rawPatches[patchI].size() && cfxPatchTypes[patchI] != "BLKBDY") { // Check if this name has been already created label existingPatch = -1; diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L index b4acf24445..7b385bfe06 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | @@ -1486,7 +1486,7 @@ int main(int argc, char *argv[]) } defaultBoundaryFaces.shrink(); - if(defaultBoundaryFaces.size() != 0) + if (defaultBoundaryFaces.size()) { Warning << " fluent mesh has " << defaultBoundaryFaces.size() << " undefined boundary faces." << endl @@ -1695,7 +1695,7 @@ int main(int argc, char *argv[]) // soon negating the need for double output if (writeSets) { - if (cellGroupZoneID.size() > 1 ) + if (cellGroupZoneID.size() > 1) { Info<< "Writing cell sets" << endl; diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index d3d732205c..62edc15af0 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -667,7 +667,7 @@ void readCells const labelList& zCells = zoneCells[zoneI]; - if (zCells.size() > 0) + if (zCells.size()) { Info<< " " << zoneI << '\t' << zCells.size() << endl; } @@ -778,7 +778,7 @@ int main(int argc, char *argv[]) forAll(zoneCells, zoneI) { - if (zoneCells[zoneI].size() > 0) + if (zoneCells[zoneI].size()) { nValidCellZones++; } @@ -910,7 +910,7 @@ int main(int argc, char *argv[]) const labelList& zFaces = zoneFaces[zoneI]; - if (zFaces.size() > 0) + if (zFaces.size()) { nValidFaceZones++; @@ -940,7 +940,7 @@ int main(int argc, char *argv[]) forAll(zoneCells, zoneI) { - if (zoneCells[zoneI].size() > 0) + if (zoneCells[zoneI].size()) { label physReg = zoneToPhys[zoneI]; @@ -979,7 +979,7 @@ int main(int argc, char *argv[]) forAll(zoneFaces, zoneI) { - if (zoneFaces[zoneI].size() > 0) + if (zoneFaces[zoneI].size()) { label physReg = zoneToPhys[zoneI]; @@ -1011,7 +1011,7 @@ int main(int argc, char *argv[]) } } - if (cz.size() > 0 || fz.size() > 0) + if (cz.size() || fz.size()) { mesh.addZones(List(0), fz, cz); } diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 477d2ba06c..520be5b146 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -752,7 +752,7 @@ int main(int argc, char *argv[]) List patchFaceVerts; - if (dofVertIndices.size() > 0) + if (dofVertIndices.size()) { // Use the vertex constraints to patch. Is of course bit dodgy since // face goes on patch if all its vertices are on a constraint. diff --git a/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C b/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C index 546aaa7439..6d41c037e6 100644 --- a/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C +++ b/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C @@ -242,7 +242,7 @@ int main(int argc, char *argv[]) } - if (vertsToBoundary.size() > 0) + if (vertsToBoundary.size()) { // Didn't find cells connected to boundary faces. WarningIn(args.executable()) diff --git a/applications/utilities/mesh/conversion/polyDualMesh/makePolyDualMesh.C b/applications/utilities/mesh/conversion/polyDualMesh/makePolyDualMesh.C index 26eb18e26d..3470fd71cc 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/makePolyDualMesh.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/makePolyDualMesh.C @@ -229,7 +229,7 @@ void simpleMarkFeatures if (doNotPreserveFaceZones) { - if (faceZones.size() > 0) + if (faceZones.size()) { WarningIn("simpleMarkFeatures(..)") << "Detected " << faceZones.size() @@ -239,7 +239,7 @@ void simpleMarkFeatures } else { - if (faceZones.size() > 0) + if (faceZones.size()) { Info<< "Detected " << faceZones.size() << " faceZones. Preserving these by marking their" diff --git a/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C b/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C index 4492a6f6b6..2a307e5df2 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C @@ -38,10 +38,7 @@ Class // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam -{ - defineTypeNameAndDebug(meshDualiser, 0); -} +defineTypeNameAndDebug(Foam::meshDualiser, 0); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -735,7 +732,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint ) << "Walked from face on patch:" << patchI << " to face:" << faceI << " fc:" << mesh_.faceCentres()[faceI] - << " on patch:" << patches.whichPatch(faceI) + << " on patch:" << patches.whichPatch(faceI) << abort(FatalError); } @@ -886,7 +883,7 @@ Foam::meshDualiser::meshDualiser(const polyMesh& mesh) faceToDualPoint_(mesh_.nFaces(), -1), edgeToDualPoint_(mesh_.nEdges(), -1) {} - + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -1083,7 +1080,7 @@ void Foam::meshDualiser::setRefinement { label pointI = multiCellFeaturePoints[i]; - if (pointToDualCells_[pointI].size() > 0) + if (pointToDualCells_[pointI].size()) { FatalErrorIn ( @@ -1133,7 +1130,7 @@ void Foam::meshDualiser::setRefinement // Normal points forAll(mesh_.points(), pointI) { - if (pointToDualCells_[pointI].size() == 0) + if (pointToDualCells_[pointI].empty()) { pointToDualCells_[pointI].setSize(1); pointToDualCells_[pointI][0] = meshMod.addCell @@ -1241,7 +1238,7 @@ void Foam::meshDualiser::setRefinement const edge& e = mesh_.edges()[edgeI]; // We need a point on the edge if not all cells on both sides - // are the same. + // are the same. const labelList& eCells = mesh_.edgeCells()[edgeI]; diff --git a/applications/utilities/mesh/conversion/sammToFoam/readCouples.C b/applications/utilities/mesh/conversion/sammToFoam/readCouples.C index d55d49242d..161123803e 100644 --- a/applications/utilities/mesh/conversion/sammToFoam/readCouples.C +++ b/applications/utilities/mesh/conversion/sammToFoam/readCouples.C @@ -136,7 +136,7 @@ void sammMesh::readCouples() forAll (curFaces, faceI) { - if (curFaces[faceI].size() == 0) + if (curFaces[faceI].empty()) { zeroSizeFound++; } @@ -153,7 +153,7 @@ void sammMesh::readCouples() forAll (oldFaces, faceI) { - if (oldFaces[faceI].size() > 0) + if (oldFaces[faceI].size()) { curFaces[nFaces] = oldFaces[faceI]; diff --git a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C index c4ff20791a..910df915d8 100644 --- a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C +++ b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C @@ -45,12 +45,11 @@ void starMesh::createCoupleMatches() // existing points list // Estimate the number of cells affected by couple matches - const label cellMapSize = - min - ( - cellShapes_.size()/10, - couples_.size()*2 - ); + const label cellMapSize = min + ( + cellShapes_.size()/10, + couples_.size()*2 + ); // Store newly created faces for each cell Map > cellAddedFaces(cellMapSize); @@ -322,7 +321,7 @@ void starMesh::createCoupleMatches() // A new point is created. Warning: // using original edge for accuracy. - // + // coupleFacePoints.append (P + alpha*curMasterEdge.vec(points_)); } @@ -338,7 +337,7 @@ void starMesh::createCoupleMatches() // master edge and vice versa. The problem is that // no symmetry exists, i.e. both operations needs // to be done separately for both master and slave - // side. + // side. // Master side // check if the first or second point of slave edge is @@ -625,11 +624,11 @@ void starMesh::createCoupleMatches() // Eliminate all zero-length edges face newMasterFace(labelList(tmpMasterFace.size(), labelMax)); - + // insert first point by hand. Careful: the first one is // used for comparison to allow the edge collapse across // point zero. - // + // newMasterFace[0] = tmpMasterFace[0]; label nMaster = 0; @@ -823,7 +822,7 @@ void starMesh::createCoupleMatches() // insert first point by hand. Careful: the first one is // used for comparison to allow the edge collapse across // point zero. - // + // newSlaveFace[0] = tmpSlaveFace[0]; label nSlave = 0; @@ -1097,7 +1096,7 @@ void starMesh::createCoupleMatches() << "edges to consider: " << edgesToConsider << endl; # endif - if (edgesToConsider.size() == 0) + if (edgesToConsider.empty()) { FatalErrorIn("void starMesh::createCoupleMatches()") << setprecision(12) @@ -1420,7 +1419,7 @@ void starMesh::createCoupleMatches() } // end of arbitrary match } - if (couples_.size() > 0) + if (couples_.size()) { // Loop through all cells and reset faces for removal to zero size const labelList crfToc = cellRemovedFaces.toc(); @@ -1442,7 +1441,7 @@ void starMesh::createCoupleMatches() cellFaces_[curCell][curRemovedFacesIter()].setSize(0); } - if (curRemovedFaces.size() > 0) + if (curRemovedFaces.size()) { // reset the shape pointer to unknown cellShapes_[curCell] = cellShape(*unknownPtr_, labelList(0)); @@ -1468,7 +1467,7 @@ void starMesh::createCoupleMatches() // copy original faces that have not been removed forAll (oldFaces, faceI) { - if (oldFaces[faceI].size() > 0) + if (oldFaces[faceI].size()) { newFaces[nNewFaces] = oldFaces[faceI]; nNewFaces++; @@ -1491,7 +1490,7 @@ void starMesh::createCoupleMatches() // reset the size of the face list newFaces.setSize(nNewFaces); - if (curAddedFaces.size() > 0) + if (curAddedFaces.size()) { // reset the shape pointer to unknown cellShapes_[curCell] = cellShape(*unknownPtr_, labelList(0)); diff --git a/applications/utilities/mesh/conversion/starToFoam/starMesh.C b/applications/utilities/mesh/conversion/starToFoam/starMesh.C index f5fbb9f860..a495ae0362 100644 --- a/applications/utilities/mesh/conversion/starToFoam/starMesh.C +++ b/applications/utilities/mesh/conversion/starToFoam/starMesh.C @@ -264,7 +264,7 @@ starMesh::starMesh readCouples(); - if (couples_.size() > 0) + if (couples_.size()) { createCoupleMatches(); } diff --git a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C index 4f9c369c7d..7fcf2a586b 100644 --- a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C +++ b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) { nodeStream.getLine(line); } - while((line.size() > 0) && (line[0] == '#')); + while (line.size() && line[0] == '#'); IStringStream nodeLine(line); @@ -193,7 +193,7 @@ int main(int argc, char *argv[]) { nodeStream.getLine(line); - if ((line.size() > 0) && (line[0] != '#')) + if (line.size() && line[0] != '#') { IStringStream nodeLine(line); @@ -237,7 +237,7 @@ int main(int argc, char *argv[]) { eleStream.getLine(line); } - while((line.size() > 0) && (line[0] == '#')); + while (line.size() && line[0] == '#'); IStringStream eleLine(line); @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) { eleStream.getLine(line); - if ((line.size() > 0) && (line[0] != '#')) + if (line.size() && line[0] != '#') { IStringStream eleLine(line); @@ -356,7 +356,7 @@ int main(int argc, char *argv[]) { faceStream.getLine(line); } - while((line.size() > 0) && (line[0] == '#')); + while (line.size() && line[0] == '#'); IStringStream faceLine(line); @@ -398,7 +398,7 @@ int main(int argc, char *argv[]) { faceStream.getLine(line); - if ((line.size() > 0) && (line[0] != '#')) + if (line.size() && line[0] != '#') { IStringStream faceLine(line); diff --git a/applications/utilities/mesh/generation/blockMesh/blockMesh.C b/applications/utilities/mesh/generation/blockMesh/blockMesh.C index 5a273f7acb..640971ada0 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMesh.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMesh.C @@ -118,7 +118,7 @@ Foam::label Foam::blockMesh::numZonedBlocks() const forAll(*this, blockI) { - if (operator[](blockI).blockDef().zoneName().size() > 0) + if (operator[](blockI).blockDef().zoneName().size()) { num++; } diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index 1c3bd34a22..1723fa5101 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C @@ -278,7 +278,7 @@ int main(int argc, char *argv[]) const labelListList& blockCells = b.cells(); const word& zoneName = b.blockDef().zoneName(); - if (zoneName.size() > 0) + if (zoneName.size()) { HashTable