From 0c893278c34b2aa9dd5ee6a8502fb94b5b9412c8 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 30 Oct 2017 09:44:31 +0100 Subject: [PATCH] STYLE: update iterator looping - use range-for when iterating over HashSet - prefer forAllIters(), forAllConstIters() with automatic decltype --- .../cartesianMeshExtractorPolyMesh.C | 5 +- .../boundaryLayers/boundaryLayerCells.C | 25 ++--- .../boundaryLayers/boundaryLayers.C | 15 ++- .../boundaryLayersFacesAndCells.C | 7 +- .../boundaryLayers/boundaryLayersI.H | 18 ++-- .../detectBoundaryLayersFunctions.C | 9 +- .../extrudeLayer/extrudeLayer.C | 23 ++--- .../refineBoundaryLayers.C | 7 +- .../utilities/checkMeshDict/checkMeshDict.C | 17 +--- .../helperFunctionsFrontalMarking.C | 8 +- .../helperFunctionsGeometryQueriesI.H | 32 +++---- .../helperFunctions/helperFunctionsPar.C | 25 +++-- .../findCellsIntersectingSurface.C | 30 +++--- .../meshes/partTetMesh/partTetMesh.C | 4 +- .../partTetMeshParallelAddressing.C | 14 +-- .../meshes/partTriMesh/partTriMesh.C | 2 +- .../partTriMesh/partTriMeshAddressing.C | 10 +- .../partTriMeshParallelAddressing.C | 29 ++---- .../meshes/polyMeshGen/polyMeshGenCells.C | 13 +-- .../meshes/polyMeshGen/polyMeshGenCellsI.H | 37 ++------ .../meshes/polyMeshGen/polyMeshGenFaces.C | 13 +-- .../meshes/polyMeshGen/polyMeshGenFacesI.H | 33 +------ .../meshes/polyMeshGen/polyMeshGenPoints.C | 9 +- .../meshes/polyMeshGen/polyMeshGenPointsI.H | 25 +---- .../polyMeshGenAddressingParallelAddressing.C | 12 +-- .../polyMeshGenModifierAddBufferCells.C | 10 +- .../primitives/meshSubsets/meshSubsetI.H | 28 +++--- .../utilities/meshes/triSurf/triSurf.C | 11 +-- .../meshes/triSurf/triSurfAddressing.C | 7 +- .../utilities/meshes/triSurf/triSurfFacets.C | 4 +- .../utilities/meshes/triSurf/triSurfFacetsI.H | 21 +---- .../meshes/triSurf/triSurfFeatureEdges.C | 4 +- .../meshes/triSurf/triSurfFeatureEdgesI.H | 21 +---- .../utilities/meshes/triSurf/triSurfPoints.C | 4 +- .../utilities/meshes/triSurf/triSurfPointsI.H | 21 +---- .../meshOctreeAddressing.C | 6 +- .../meshOctreeAddressingCreation.C | 18 ++-- .../meshOctreeAddressingGluedMesh.C | 3 +- ...meshOctreeAddressingIrregularConnections.C | 4 +- .../meshOctreeAddressingParallelAddressing.C | 5 +- .../meshOctreeInsideOutside.C | 30 ++---- .../meshOctreeModifierLoadDistribution.C | 21 ++--- .../meshOctreeModifierParallelRefinement.C | 3 +- .../meshOctreeModifierRefineSelectedBoxes.C | 2 +- .../boundaryLayerOptimisationNormals.C | 20 ++-- .../boundaryLayerOptimisationThickness.C | 2 +- .../geometry/meshOptimizer/meshOptimizer.C | 12 ++- .../geometry/meshOptimizer/optimizeMeshFV.C | 38 +++++--- .../symmetryPlaneOptimisation.C | 12 ++- .../tetMeshOptimisationParallel.C | 12 +-- .../meshSurfaceOptimizer.C | 14 ++- .../meshSurfaceOptimizerI.H | 4 +- .../meshSurfaceOptimizerOptimizeSurface.C | 14 ++- .../checkBoundaryFacesSharingTwoEdges.C | 4 +- ...heckIrregularSurfaceConnectionsFunctions.C | 89 ++++++------------ .../checkNonMappableCellConnections.C | 6 +- ...orrectEdgesBetweenPatchesDistributeFaces.C | 24 +++-- .../edgeExtractor/edgeExtractor.C | 22 ++--- .../edgeExtractor/edgeExtractorCorners.C | 92 ++++++++----------- .../meshSurfaceCheckEdgeTypes.C | 10 +- .../meshSurfaceCheckInvertedVertices.C | 24 ++--- ...faceEngineCalculateBoundaryNodesAndFaces.C | 11 +-- .../meshSurfaceEngineModifier.C | 10 +- .../meshSurfaceEngineParallelAddressing.C | 20 ++-- .../meshSurfaceMapperCornersAndEdges.C | 12 ++- .../meshSurfaceMapperPremapVertices.C | 2 +- .../meshSurfaceMapper2D/meshSurfaceMapper2D.C | 2 +- .../meshSurfacePartitionerFunctions.C | 8 +- .../triSurfaceCleanupDuplicatesFunctions.C | 19 ++-- .../triSurfaceCurvatureEstimatorCalculate.C | 38 ++++---- .../triSurfacePartitioner.C | 15 +-- .../triSurfacePatchManipulator.C | 6 +- .../workflowControls/workflowControls.C | 7 +- .../testBndLayerSmoothing.C | 10 +- 74 files changed, 487 insertions(+), 717 deletions(-) diff --git a/meshLibrary/cartesianMesh/cartesianMeshExtractor/cartesianMeshExtractorPolyMesh.C b/meshLibrary/cartesianMesh/cartesianMeshExtractor/cartesianMeshExtractorPolyMesh.C index 38f902f..361d0a9 100644 --- a/meshLibrary/cartesianMesh/cartesianMeshExtractor/cartesianMeshExtractorPolyMesh.C +++ b/meshLibrary/cartesianMesh/cartesianMeshExtractor/cartesianMeshExtractorPolyMesh.C @@ -154,8 +154,7 @@ void cartesianMeshExtractor::createPolyMesh() label nProcBoundaries(nFaces), patchI(0); // allocate memory for processor patches - std::map::const_iterator iter; - for (iter = procFaces.begin(); iter!=procFaces.end(); ++iter) + forAllConstIters(procFaces, iter) { const label procI = iter->first; @@ -182,7 +181,7 @@ void cartesianMeshExtractor::createPolyMesh() // create processor faces // they need to be created here because of the correct ordering patchI = 0; - for (iter = procFaces.begin(); iter!=procFaces.end(); ++iter) + forAllConstIters(procFaces, iter) { procBoundaries[patchI].patchStart() = nProcBoundaries; diff --git a/meshLibrary/utilities/boundaryLayers/boundaryLayers/boundaryLayerCells.C b/meshLibrary/utilities/boundaryLayers/boundaryLayers/boundaryLayerCells.C index eb767f8..19b1ff1 100644 --- a/meshLibrary/utilities/boundaryLayers/boundaryLayers/boundaryLayerCells.C +++ b/meshLibrary/utilities/boundaryLayers/boundaryLayers/boundaryLayerCells.C @@ -203,12 +203,7 @@ void boundaryLayers::createLayerCells(const labelList& patchLabels) const Map