From a50f01b079bef79ce934bc86a860c90abd44d1e5 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 12 Apr 2010 11:18:38 +0200 Subject: [PATCH] STYLE: use forAllIter, forAllConstIter instead of long-hand version STYLE: use 'forAll(' NOT 'forAll (', as per coding guide --- .../reactingParcelFilmFoam/createFields.H | 2 +- .../advanced/autoRefineMesh/autoRefineMesh.C | 39 ++--- .../refineWallLayer/refineWallLayer.C | 12 +- .../mesh/advanced/splitCells/splitCells.C | 10 +- .../mesh/conversion/ansysToFoam/ansysToFoam.L | 34 +---- .../mesh/conversion/kivaToFoam/readKivaGrid.H | 21 +-- .../conversion/tetgenToFoam/tetgenToFoam.C | 7 +- .../conversion/writeMeshObj/writeMeshObj.C | 7 +- .../manipulation/setsToZones/setsToZones.C | 21 +-- .../mesh/manipulation/splitMesh/regionSide.C | 36 +---- .../mesh/manipulation/stitchMesh/stitchMesh.C | 2 +- .../miscellaneous/foamInfoExec/foamInfoExec.C | 16 +- .../decomposePar/domainDecompositionMesh.C | 16 +- .../decomposePar/readFields.C | 17 +-- .../foamDataToFluent/foamDataToFluent.C | 70 +++------ .../dataConversion/foamToGMV/gmvOutput.H | 12 +- .../foamToGMV/gmvOutputLagrangian.H | 55 +++---- .../foamToGMV/gmvOutputParcels.H | 69 +++------ .../dataConversion/foamToGMV/gmvOutputSpray.H | 33 ++-- .../dataConversion/foamToGMV/gmvOutputTail.H | 5 +- .../foamToGMV/readConversionProperties.H | 3 +- .../foamToTecplot360/readFields.C | 7 +- .../dataConversion/foamToVTK/readFields.C | 7 +- .../dataConversion/foamToVTK/writeFaceSet.C | 17 +-- .../ensightFoamReader/USERD_get_part_coords.H | 14 +- .../USERD_get_part_node_ids.H | 16 +- .../mapFields/MapConsistentVolFields.H | 7 +- .../preProcessing/mapFields/MapVolFields.H | 7 +- .../preProcessing/mapFields/UnMapped.H | 9 +- .../surfaceSplitNonManifolds.C | 28 +--- .../equilibriumCO/equilibriumCO.C | 11 +- .../containers/Identifiers/Keyed/KeyedI.H | 4 +- src/OpenFOAM/db/IOobjectList/IOobjectList.C | 14 +- .../GeometricField/GeometricBoundaryField.C | 2 +- .../SlicedGeometricField.C | 4 +- .../pointPatchField/pointPatchField.C | 6 +- src/OpenFOAM/graph/graph.C | 15 +- .../graph/writers/gnuplotGraph/gnuplotGraph.C | 6 +- .../graph/writers/jplotGraph/jplotGraph.C | 4 +- .../graph/writers/xmgrGraph/xmgrGraph.C | 10 +- .../CalcPatchToPatchWeights.C | 14 +- .../PatchToPatchInterpolate.C | 6 +- .../lduMatrix/lduAddressing/lduAddressing.C | 14 +- .../lduMatrixUpdateMatrixInterfaces.C | 6 +- .../GAMGAgglomerateLduAddressing.C | 8 +- .../GAMGAgglomeration/GAMGAgglomeration.C | 2 +- .../pairGAMGAgglomerate.C | 12 +- .../pairGAMGAgglomerationCombineLevels.C | 2 +- .../lduMatrix/solvers/GAMG/GAMGSolver.C | 4 +- .../GAMG/GAMGSolverAgglomerateMatrix.C | 2 +- .../lduMatrix/solvers/GAMG/GAMGSolverSolve.C | 2 +- .../GAMGInterface/GAMGInterfaceTemplates.C | 2 +- .../cyclicGAMGInterface/cyclicGAMGInterface.C | 18 +-- .../processorGAMGInterface.C | 20 +-- .../meshes/bandCompression/bandCompression.C | 6 +- src/OpenFOAM/meshes/meshShapes/cell/cell.C | 26 ++-- .../meshes/meshShapes/cell/oppositeCellFace.C | 12 +- .../meshShapes/cellMatcher/cellMatcher.C | 9 +- .../meshes/meshShapes/cellModel/cellModelI.H | 2 +- src/OpenFOAM/meshes/meshShapes/face/face.C | 6 +- .../meshShapes/face/faceAreaInContact.C | 6 +- .../pointMeshMapper/pointBoundaryMeshMapper.H | 2 +- .../pointMesh/pointMeshMapper/pointMapper.C | 10 +- .../processor/processorPointPatch.C | 2 +- .../polyMesh/globalMeshData/globalMeshData.C | 4 +- .../mapPolyMesh/cellMapper/cellMapper.C | 22 +-- .../mapPolyMesh/faceMapper/faceMapper.C | 18 +-- .../polyBoundaryMesh/polyBoundaryMesh.C | 18 +-- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 16 +- src/OpenFOAM/meshes/polyMesh/polyMeshClear.C | 2 +- .../meshes/polyMesh/polyMeshFromShapeMesh.C | 12 +- src/OpenFOAM/meshes/polyMesh/polyMeshIO.C | 12 +- .../meshes/polyMesh/polyMeshInitMesh.C | 2 +- .../basic/coupled/coupledPolyPatch.C | 2 +- .../basic/generic/genericPolyPatch.C | 7 +- .../polyPatches/polyPatch/polyPatch.C | 2 +- .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C | 18 +-- .../meshes/polyMesh/zones/faceZone/faceZone.C | 6 +- .../PrimitivePatch/PrimitivePatchAddressing.C | 24 +-- .../PrimitivePatchLocalPointOrder.C | 6 +- .../PrimitivePatch/PrimitivePatchMeshEdges.C | 12 +- .../PrimitivePatchPointAddressing.C | 28 ++-- .../PrimitivePatchProjectPoints.C | 16 +- .../primitiveMeshCalcCellShapes.C | 2 +- .../primitiveMesh/primitiveMeshCellCells.C | 6 +- .../primitiveMeshCellCentresAndVols.C | 8 +- .../primitiveMesh/primitiveMeshCellEdges.C | 10 +- .../meshes/primitiveMesh/primitiveMeshCells.C | 10 +- .../primitiveMeshCheck/primitiveMeshCheck.C | 40 ++--- .../primitiveMeshCheckMotion.C | 4 +- .../primitiveMeshFaceCentresAndAreas.C | 2 +- .../primitiveMesh/primitiveMeshFindCell.C | 2 +- .../primitiveMesh/primitiveMeshPointCells.C | 10 +- .../primitiveMesh/primitiveMeshPointPoints.C | 4 +- .../ensight/part/ensightPartFaces.C | 2 +- .../meshWriter/starcd/STARCDMeshWriter.C | 6 +- src/dynamicMesh/attachDetach/attachDetach.C | 4 +- .../attachDetach/attachDetachPointMatchMap.C | 6 +- .../attachDetach/attachInterface.C | 16 +- .../attachDetach/detachInterface.C | 26 ++-- .../layerAdditionRemoval/addCellLayer.C | 24 +-- .../layerAdditionRemoval.C | 2 +- .../layerAdditionRemoval/removeCellLayer.C | 22 +-- .../layerAdditionRemoval/setLayerPairing.C | 4 +- .../meshCut/edgeVertex/edgeVertex.C | 32 +--- .../meshCutAndRemove/meshCutAndRemove.C | 15 +- .../meshModifiers/meshCutter/meshCutter.C | 23 +-- .../multiDirRefinement/multiDirRefinement.C | 32 +--- .../refinementIterator/refinementIterator.C | 14 +- .../undoableMeshCutter/undoableMeshCutter.C | 15 +- .../perfectInterface/perfectInterface.C | 10 +- src/dynamicMesh/polyMeshAdder/polyMeshAdder.C | 6 +- .../attachPolyTopoChanger.C | 2 +- .../polyTopoChange/faceCollapser.C | 14 +- .../polyTopoChange/polyTopoChange.C | 2 +- .../polyTopoChanger/polyTopoChanger.C | 16 +- .../setUpdater/setUpdaterTemplates.C | 7 +- .../slidingInterface/coupleSlidingInterface.C | 76 +++++----- .../decoupleSlidingInterface.C | 20 +-- .../enrichedPatch/enrichedPatch.C | 12 +- .../enrichedPatch/enrichedPatchCutFaces.C | 18 +-- .../enrichedPatch/enrichedPatchFaces.C | 16 +- .../enrichedPatch/enrichedPatchMasterPoints.C | 8 +- .../enrichedPatch/enrichedPatchPointMap.C | 4 +- .../enrichedPatch/enrichedPatchPointPoints.C | 10 +- .../slidingInterface/slidingInterface.C | 2 +- .../slidingInterfaceAttachedAddressing.C | 30 ++-- .../slidingInterfaceClearCouple.C | 4 +- .../slidingInterfaceProjectPoints.C | 48 +++--- .../layeredEngineMesh/layeredEngineMesh.C | 22 +-- src/engine/engineValve/valveBank.H | 2 +- src/engine/ignition/ignite.H | 2 +- .../errorEstimate/errorEstimate.C | 2 +- .../errorEstimate/resErrorDiv.C | 6 +- .../errorEstimate/resErrorLaplacian.C | 6 +- .../cfdTools/general/adjustPhi/adjustPhi.C | 4 +- .../general/porousMedia/porousZoneTemplates.C | 8 +- .../ddtSchemes/ddtScheme/ddtScheme.C | 6 +- .../extendedLeastSquaresVectors.C | 7 +- .../leastSquaresGrad/leastSquaresVectors.C | 7 +- .../fvMatrices/fvMatrix/fvMatrix.C | 4 +- .../fvMatrices/solvers/MULES/MULESTemplates.C | 2 +- .../fvMesh/fvBoundaryMesh/fvBoundaryMesh.C | 23 +-- src/finiteVolume/fvMesh/fvMesh.C | 2 +- src/finiteVolume/fvMesh/fvMeshLduAddressing.H | 2 +- .../fvMeshMapper/fvBoundaryMeshMapper.H | 2 +- .../fvMesh/fvMeshMapper/fvPatchMapper.C | 10 +- .../fvMesh/fvMeshMapper/fvSurfaceMapper.C | 6 +- .../fvMesh/fvMeshSubset/fvMeshSubset.C | 50 +++--- .../fvMeshSubset/fvMeshSubsetInterpolate.C | 6 +- .../fvMesh/fvPatches/fvPatch/fvPatch.C | 2 +- .../fvFieldMappers/MapFvSurfaceField.H | 2 +- .../schemes/clippedLinear/clippedLinear.H | 2 +- .../schemes/cubic/cubic.H | 2 +- .../schemes/reverseLinear/reverseLinear.H | 2 +- .../surfaceInterpolationScheme.C | 4 +- .../MGridGenGAMGAgglomerate.C | 8 +- .../inverseFaceDistanceDiffusivity.C | 2 +- .../inversePointDistanceDiffusivity.C | 2 +- .../genericFvPatchField/genericFvPatchField.C | 143 ++++++++---------- .../genericPointPatchField.C | 141 +++++++---------- .../dieselSpray/spray/sprayFunctions.C | 109 +++++-------- .../atomizationModel/LISA/LISA.C | 2 +- .../gradientDispersionRAS.C | 19 +-- .../stochasticDispersionRAS.C | 17 +-- .../Templates/ReactingCloud/ReactingCloudI.H | 2 +- .../phaseProperties/phaseProperties.C | 2 +- .../distribution/distribution.C | 4 +- .../directInteractionList.C | 2 +- .../interactionLists/interactionLists.C | 6 +- .../referralLists/receivingReferralList.C | 6 +- .../referralLists/sendingReferralList.C | 6 +- .../referredCellList/referredCellList.C | 24 +-- .../molecule/mdTools/averageMDFields.H | 10 +- .../calculateAutoCorrelationFunctions.H | 33 +--- .../molecule/mdTools/createMDFields.H | 10 +- .../mdTools/meanMomentumEnergyAndNMols.H | 6 +- .../molecule/moleculeCloud/moleculeCloud.C | 8 +- .../cellClassification/cellClassification.C | 20 +-- src/meshTools/cellQuality/cellQuality.C | 16 +- src/meshTools/meshSearch/meshSearch.C | 2 +- src/meshTools/octree/octreeDataFace.C | 2 +- .../polyMeshZipUpCells/polyMeshZipUpCells.C | 60 ++++---- .../distributedTriSurfaceMesh.C | 4 +- .../sets/cellSources/faceToCell/faceToCell.C | 34 ++--- .../cellSources/pointToCell/pointToCell.C | 10 +- .../sets/faceSources/cellToFace/cellToFace.C | 12 +- .../faceSources/pointToFace/pointToFace.C | 24 +-- .../pointSources/cellToPoint/cellToPoint.C | 10 +- .../pointSources/faceToPoint/faceToPoint.C | 7 +- src/meshTools/sets/topoSets/faceSet.C | 4 +- src/meshTools/sets/topoSets/topoSet.C | 54 ++----- src/meshTools/surfaceSets/surfaceSets.C | 24 +-- .../intersectedSurface/edgeSurface.C | 9 +- .../surfaceFeatures/surfaceFeatures.C | 25 +-- .../triSurfaceTools/triSurfaceTools.C | 43 +----- .../twoDPointCorrector/twoDPointCorrector.C | 8 +- .../fvFieldReconstructorReconstructFields.C | 10 +- .../reconstruct/pointFieldReconstructor.C | 4 +- ...pointFieldReconstructorReconstructFields.C | 4 +- .../reconstruct/reconstruct/processorMeshes.C | 8 +- src/randomProcesses/noise/noiseFFT.C | 10 +- .../calculateMeshToMeshAddressing.C | 16 +- .../meshToMesh/calculateMeshToMeshWeights.C | 6 +- .../meshToMesh/meshToMesh.C | 10 +- .../meshToMesh/meshToMeshInterpolate.C | 8 +- .../radiationModel/fvDOM/fvDOM/fvDOM.C | 2 +- .../chemkinReader/chemkinLexer.L | 2 +- .../chemkinReader/chemkinReader.C | 16 +- .../multiComponentMixture.C | 2 +- .../thirdBodyEfficienciesI.H | 4 +- .../specie/speciesTable/speciesTable.C | 4 +- .../thermalPorousZone/thermalPorousZone.C | 2 +- .../thermalPorousZoneTemplates.C | 4 +- .../linearValveFvMesh/linearValveFvMesh.C | 12 +- .../linearValveLayersFvMesh.C | 16 +- .../mixerFvMesh/mixerFvMesh.C | 18 +-- .../movingConeTopoFvMesh.C | 4 +- .../triSurface/interfaces/OBJ/readOBJ.C | 7 +- .../triSurface/interfaces/TRI/readTRI.C | 9 +- 220 files changed, 1144 insertions(+), 1898 deletions(-) diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index f7c2caf8c6..9c196e2905 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -84,7 +84,7 @@ multivariateSurfaceInterpolationScheme::fieldTable fields; - forAll (Y, i) + forAll(Y, i) { fields.add(Y[i]); } diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C index 01c428016e..c2f3640f2d 100644 --- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C +++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C @@ -292,20 +292,14 @@ void addCutNeighbours labelHashSet addCutFaces(cutCells.size()); - for - ( - labelHashSet::const_iterator iter = cutCells.begin(); - iter != cutCells.end(); - ++iter - ) + forAllConstIter(labelHashSet, cutCells, iter) { - label cellI = iter.key(); - + const label cellI = iter.key(); const labelList& cFaces = mesh.cells()[cellI]; forAll(cFaces, i) { - label faceI = cFaces[i]; + const label faceI = cFaces[i]; if (mesh.isInternalFace(faceI)) { @@ -331,12 +325,7 @@ void addCutNeighbours Info<< " Selected an additional " << addCutFaces.size() << " neighbours of cutCells to refine" << endl; - for - ( - labelHashSet::const_iterator iter = addCutFaces.begin(); - iter != addCutFaces.end(); - ++iter - ) + forAllConstIter(labelHashSet, addCutFaces, iter) { cutCells.insert(iter.key()); } @@ -386,21 +375,15 @@ bool limitRefinementLevel labelHashSet addCutCells(cutCells.size()); - for - ( - labelHashSet::const_iterator iter = cutCells.begin(); - iter != cutCells.end(); - ++iter - ) + forAllConstIter(labelHashSet, cutCells, iter) { // cellI will be refined. - label cellI = iter.key(); - + const label cellI = iter.key(); const labelList& cCells = mesh.cellCells()[cellI]; forAll(cCells, i) { - label nbr = cCells[i]; + const label nbr = cCells[i]; if (!excludeCells.found(nbr) && !cutCells.found(nbr)) { @@ -419,12 +402,8 @@ bool limitRefinementLevel Info<< "Added an additional " << addCutCells.size() << " cells" << " to satisfy 1:" << limitDiff << " refinement level" << endl; - for - ( - labelHashSet::const_iterator iter = addCutCells.begin(); - iter != addCutCells.end(); - ++iter - ) + + forAllConstIter(labelHashSet, addCutCells, iter) { cutCells.insert(iter.key()); } diff --git a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C index fb7b97a32d..5e0ce9248f 100644 --- a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C +++ b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C @@ -112,12 +112,7 @@ int main(int argc, char *argv[]) << cells.instance()/cells.local()/cells.name() << nl << endl; - for - ( - cellSet::const_iterator iter = cells.begin(); - iter != cells.end(); - ++iter - ) + forAllConstIter(cellSet, cells, iter) { cutCells.erase(iter.key()); } @@ -131,7 +126,7 @@ int main(int argc, char *argv[]) forAll(meshPoints, pointI) { - label meshPointI = meshPoints[pointI]; + const label meshPointI = meshPoints[pointI]; vertOnPatch[meshPointI] = true; } @@ -151,8 +146,7 @@ int main(int argc, char *argv[]) forAll(pEdges, pEdgeI) { - label edgeI = pEdges[pEdgeI]; - + const label edgeI = pEdges[pEdgeI]; const edge& e = mesh.edges()[edgeI]; label otherPointI = e.otherVertex(meshPointI); diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index 1a55fd52f1..19828287bc 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -392,15 +392,9 @@ void collectCuts boolList edgeIsCut(mesh.nEdges(), false); scalarField edgeWeight(mesh.nEdges(), -GREAT); - for - ( - cellSet::const_iterator iter = cellsToCut.begin(); - iter != cellsToCut.end(); - ++iter - ) + forAllConstIter(cellSet, cellsToCut, iter) { - label cellI = iter.key(); - + const label cellI = iter.key(); const labelList& cEdges = cellEdges[cellI]; forAll(cEdges, i) diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index 52a29eb03f..2fb1c77043 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -268,13 +268,8 @@ int main(int argc, char *argv[]) pointField points(slPoints.size()); - label i=0; - for - ( - SLList::iterator pointIter = slPoints.begin(); - pointIter != slPoints.end(); - ++pointIter - ) + label i = 0; + forAllConstIter(SLList, slPoints, pointIter) { // Scale points for the given scale factor points[i++] = scaleFactor * pointIter(); @@ -283,13 +278,8 @@ int main(int argc, char *argv[]) labelList pointMap(maxNodei+1); - i=0; - for - ( - SLList