ENH: for-range, forAllIters() ... in sampling/, surfMesh/

- reduced clutter when iterating over containers
This commit is contained in:
Mark Olesen
2019-01-07 09:20:51 +01:00
parent c2e4cccccd
commit 608b2607f3
3 changed files with 13 additions and 13 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2019 OpenFOAM Foundation
@ -298,7 +298,7 @@ void Foam::isoSurfaceTopo::fixTetBasePtIs()
// Check for any points with count 2
bool haveDangling = false;
forAllConstIter(Map<label>, pointCount, iter)
forAllConstIters(pointCount, iter)
{
if (iter() == 1)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -374,7 +374,7 @@ bool Foam::discreteSurface::update(const meshSearch& meshSearcher)
surfZoneList zoneLst(zoneSizes.size());
label start = 0;
label zoneI = 0;
forAllIter(Map<label>, zoneSizes, iter)
forAllIters(zoneSizes, iter)
{
// No negative regionids, so Map<label> sorts properly
const label regionid = iter.key();
@ -399,7 +399,7 @@ bool Foam::discreteSurface::update(const meshSearch& meshSearcher)
);
// Adjust start for the next zone and save (zoneId => zoneI) mapping
start += iter();
start += iter.val();
iter() = zoneI++;
}