Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
a766d386
Commit
a766d386
authored
Jan 07, 2019
by
Mark Olesen
Committed by
Andrew Heather
Jan 07, 2019
Browse files
ENH: for-range, forAllIters() ... in sampling/, surfMesh/
- reduced clutter when iterating over containers
parent
fd8379fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/meshTools/regionSplit/localPointRegion.C
View file @
a766d386
...
...
@@ -447,11 +447,11 @@ void Foam::localPointRegion::calcPointRegions
//// Print points with multiple regions. These points need to be duplicated.
//forAllConstIter(
Map<label>,
meshPointMap_, iter)
//forAllConstIter
s
(meshPointMap_, iter)
//{
// Pout<< "point:" << iter.key()
// << " coord:" << mesh.points()[iter.key()]
// << " regions:" << pointRegions_[iter()] << endl;
// << " regions:" << pointRegions_[iter
.val
()] << endl;
//}
}
...
...
@@ -685,13 +685,13 @@ void Foam::localPointRegion::updateMesh(const mapPolyMesh& map)
{
Map
<
label
>
newMap
(
meshFaceMap_
.
size
());
forAllConstIter
(
Map
<
label
>
,
meshFaceMap_
,
iter
)
forAllConstIter
s
(
meshFaceMap_
,
iter
)
{
label
newFacei
=
map
.
reverseFaceMap
()[
iter
.
key
()];
const
label
newFacei
=
map
.
reverseFaceMap
()[
iter
.
key
()];
if
(
newFacei
>=
0
)
{
newMap
.
insert
(
newFacei
,
iter
());
newMap
.
insert
(
newFacei
,
iter
.
val
());
}
}
meshFaceMap_
.
transfer
(
newMap
);
...
...
@@ -699,13 +699,13 @@ void Foam::localPointRegion::updateMesh(const mapPolyMesh& map)
{
Map
<
label
>
newMap
(
meshPointMap_
.
size
());
forAllConstIter
(
Map
<
label
>
,
meshPointMap_
,
iter
)
forAllConstIter
s
(
meshPointMap_
,
iter
)
{
label
newPointi
=
map
.
reversePointMap
()[
iter
.
key
()];
const
label
newPointi
=
map
.
reversePointMap
()[
iter
.
key
()];
if
(
newPointi
>=
0
)
{
newMap
.
insert
(
newPointi
,
iter
());
newMap
.
insert
(
newPointi
,
iter
.
val
());
}
}
...
...
src/sampling/surface/isoSurface/isoSurfaceTopo.C
View file @
a766d386
...
...
@@ -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
)
forAllConstIter
s
(
pointCount
,
iter
)
{
if
(
iter
()
==
1
)
{
...
...
src/sampling/surface/triSurfaceMesh/discreteSurface.C
View file @
a766d386
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-201
8
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-201
9
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
)
forAllIter
s
(
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
++
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment