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-plus
Commits
b8f0823d
Commit
b8f0823d
authored
Oct 24, 2017
by
Mark Olesen
Browse files
STYLE: use list methods find/found instead of findIndex function
parent
e0b212e6
Changes
136
Hide whitespace changes
Inline
Side-by-side
applications/test/checkDecomposePar/Test-checkDecomposePar.C
View file @
b8f0823d
...
...
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
const
wordList
&
regions
=
iter
();
forAll
(
regions
,
i
)
{
if
(
findIndex
(
regionNames
,
regions
[
i
])
==
-
1
)
if
(
!
regionNames
.
found
(
regions
[
i
]))
{
regionNames
.
append
(
regions
[
i
]);
}
...
...
applications/test/decomposePar/Test-decomposePar.C
View file @
b8f0823d
...
...
@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
const
wordList
&
regions
=
iter
();
forAll
(
regions
,
i
)
{
if
(
findIndex
(
regionNames
,
regions
[
i
])
==
-
1
)
if
(
!
regionNames
.
found
(
regions
[
i
]))
{
regionNames
.
append
(
regions
[
i
]);
}
...
...
applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C
View file @
b8f0823d
...
...
@@ -97,7 +97,7 @@ Foam::label Foam::cellSplitter::newOwner
const
cell
&
cFaces
=
mesh_
.
cells
()[
oldOwn
];
return
newCells
[
findIndex
(
cFaces
,
facei
)];
return
newCells
[
cFaces
.
find
(
facei
)];
}
}
...
...
@@ -125,7 +125,7 @@ Foam::label Foam::cellSplitter::newNeighbour
const
cell
&
cFaces
=
mesh_
.
cells
()[
oldNbr
];
return
newCells
[
findIndex
(
cFaces
,
facei
)];
return
newCells
[
cFaces
.
find
(
facei
)];
}
}
...
...
@@ -261,8 +261,8 @@ void Foam::cellSplitter::setRefinement
// (since newly created cells are stored in cFaces order)
const
labelList
&
newCells
=
cellToCells
[
celli
];
label
cell0
=
newCells
[
findIndex
(
cFaces
,
face0
)];
label
cell1
=
newCells
[
findIndex
(
cFaces
,
face1
)];
label
cell0
=
newCells
[
cFaces
.
find
(
face0
)];
label
cell1
=
newCells
[
cFaces
.
find
(
face1
)];
if
(
cell0
<
cell1
)
{
...
...
@@ -271,7 +271,7 @@ void Foam::cellSplitter::setRefinement
const
face
&
f0
=
mesh_
.
faces
()[
face0
];
label
index
=
f
indIndex
(
f0
,
e
[
0
]);
label
index
=
f
0
.
find
(
e
[
0
]);
bool
edgeInFaceOrder
=
(
f0
[
f0
.
fcIndex
(
index
)]
==
e
[
1
]);
...
...
@@ -317,7 +317,7 @@ void Foam::cellSplitter::setRefinement
const
face
&
f1
=
mesh_
.
faces
()[
face1
];
label
index
=
f
indIndex
(
f1
,
e
[
0
]);
label
index
=
f
1
.
find
(
e
[
0
]);
bool
edgeInFaceOrder
=
(
f1
[
f1
.
fcIndex
(
index
)]
==
e
[
1
]);
...
...
applications/utilities/mesh/advanced/splitCells/splitCells.C
View file @
b8f0823d
...
...
@@ -225,8 +225,8 @@ bool splitHex
const
face
&
f
=
faces
[
facei
];
label
fp0
=
find
Index
(
f
,
e
[
0
]);
label
fp1
=
find
Index
(
f
,
e
[
1
]);
label
fp0
=
f
.
find
(
e
[
0
]);
label
fp1
=
f
.
find
(
e
[
1
]);
if
(
fp0
==
-
1
)
{
...
...
applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C
View file @
b8f0823d
...
...
@@ -136,7 +136,7 @@ label findFace(const primitivePatch& pp, const labelList& meshF)
forAll
(
f
,
fp
)
{
if
(
findIndex
(
meshF
,
f
[
fp
])
!=
-
1
)
if
(
meshF
.
found
(
f
[
fp
])
)
{
nMatched
++
;
}
...
...
@@ -168,7 +168,7 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
forAll
(
f
,
fp
)
{
if
(
findIndex
(
meshF
,
f
[
fp
])
!=
-
1
)
if
(
meshF
.
found
(
f
[
fp
])
)
{
nMatched
++
;
}
...
...
applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
View file @
b8f0823d
...
...
@@ -806,7 +806,7 @@ int main(int argc, char *argv[])
)
);
if
(
f
indIndex
(
foamVerts
,
-
1
)
!=
-
1
)
if
(
f
oamVerts
.
found
(
-
1
)
)
{
FatalErrorInFunction
<<
"Cell "
<<
celli
...
...
@@ -825,7 +825,7 @@ int main(int argc, char *argv[])
{
labelList
foamVerts
(
renumber
(
unvToFoam
,
boundaryFaces
[
bFacei
]));
if
(
f
indIndex
(
foamVerts
,
-
1
)
!=
-
1
)
if
(
f
oamVerts
.
found
(
-
1
)
)
{
FatalErrorInFunction
<<
"Boundary face "
<<
bFacei
...
...
applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.C
View file @
b8f0823d
...
...
@@ -29,7 +29,7 @@ License
bool
Foam
::
extrudedMesh
::
sameOrder
(
const
face
&
f
,
const
edge
&
e
)
{
label
i
=
find
Index
(
f
,
e
[
0
]);
label
i
=
f
.
find
(
e
[
0
]);
label
nextI
=
(
i
==
f
.
size
()
-
1
?
0
:
i
+
1
);
...
...
applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
View file @
b8f0823d
...
...
@@ -464,7 +464,7 @@ public:
{
forAll
(
y
,
yi
)
{
if
(
findIndex
(
x
,
y
[
yi
])
==
-
1
)
if
(
!
x
.
found
(
y
[
yi
])
)
{
label
sz
=
x
.
size
();
x
.
setSize
(
sz
+
1
);
...
...
@@ -2488,14 +2488,14 @@ int main(int argc, char *argv[])
if
(
isA
<
mappedWallPolyPatch
>
(
pp
))
{
if
(
findIndex
(
interRegionTopPatch
,
patchi
)
!=
-
1
)
if
(
interRegionTopPatch
.
found
(
patchi
))
{
label
zoneI
=
findIndex
(
interRegionTopPatch
,
patchi
);
label
zoneI
=
interRegionTopPatch
.
find
(
patchi
);
topOffsets
[
zoneI
]
=
calcOffset
(
extrudePatch
,
extruder
,
pp
);
}
else
if
(
findIndex
(
interRegionBottomPatch
,
patchi
)
!=
-
1
)
else
if
(
interRegionBottomPatch
.
found
(
patchi
))
{
label
zoneI
=
findIndex
(
interRegionBottomPatch
,
patchi
);
label
zoneI
=
interRegionBottomPatch
.
find
(
patchi
);
bottomOffsets
[
zoneI
]
=
calcOffset
(
extrudePatch
,
extruder
,
pp
);
}
}
...
...
applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/patchToPoly2DMesh/patchToPoly2DMesh.C
View file @
b8f0823d
...
...
@@ -45,7 +45,7 @@ void Foam::patchToPoly2DMesh::flipFaceOrder()
const
face
&
f
=
localFaces
[
edgeOwner
];
label
fp
=
find
Index
(
f
,
e
[
0
]);
label
fp
=
f
.
find
(
e
[
0
]);
if
(
f
.
nextLabel
(
fp
)
!=
e
[
1
])
{
...
...
@@ -207,7 +207,7 @@ void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
{
const
face
&
f
=
faces
[
owner_
[
bEdgeI
]];
label
fp
=
find
Index
(
f
,
e
[
0
]);
label
fp
=
f
.
find
(
e
[
0
]);
newOwner
[
bFacei
]
=
owner_
[
bEdgeI
];
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C
View file @
b8f0823d
...
...
@@ -660,7 +660,7 @@ Foam::face Foam::conformalVoronoiMesh::buildDualFace
if
(
cc1I
!=
cc2I
)
{
if
(
findIndex
(
verticesOnFace
,
cc1I
)
==
-
1
)
if
(
!
verticesOnFace
.
found
(
cc1I
)
)
{
nUniqueVertices
++
;
}
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C
View file @
b8f0823d
...
...
@@ -2119,8 +2119,8 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
patchIndex
=
max
(
findIndex
(
procNeighbours
,
vA
->
procIndex
()),
findIndex
(
procNeighbours
,
vB
->
procIndex
())
procNeighbours
.
find
(
vA
->
procIndex
()),
procNeighbours
.
find
(
vB
->
procIndex
())
);
// The lower processor index is the owner of the
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshI.H
View file @
b8f0823d
...
...
@@ -465,12 +465,12 @@ inline Foam::List<Foam::label> Foam::conformalVoronoiMesh::processorsAttached
forAll
(
c1Procs
,
aPI
)
{
if
(
findIndex
(
procsAttached
,
c1Procs
[
aPI
]
==
-
1
))
if
(
!
procsAttached
.
found
(
c1Procs
[
aPI
]))
{
procsAttached
.
append
(
c1Procs
[
aPI
]);
}
if
(
findIndex
(
procsAttached
,
c2Procs
[
aPI
]
==
-
1
))
if
(
!
procsAttached
.
found
(
c2Procs
[
aPI
]))
{
procsAttached
.
append
(
c2Procs
[
aPI
]);
}
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C
View file @
b8f0823d
...
...
@@ -306,7 +306,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// )()
// );
//
// label pointi =
findIndex(
pointDualAddressing
,
-1);
// label pointi = pointDualAddressing
.find(
-1);
// if (pointi != -1)
// {
// WarningInFunction
...
...
applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshZones.C
View file @
b8f0823d
...
...
@@ -471,7 +471,7 @@ void Foam::conformalVoronoiMesh::calcFaceZones
// a faceZone
if
(
surfHit
.
size
()
==
1
&&
surfHit
[
0
].
hit
())
{
if
(
findIndex
(
unclosedSurfaces
,
hitSurface
[
0
])
!=
-
1
)
if
(
unclosedSurfaces
.
found
(
hitSurface
[
0
]))
{
vectorField
norm
;
geometryToConformTo
().
getNormal
...
...
applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.C
View file @
b8f0823d
...
...
@@ -43,7 +43,7 @@ void Foam::shortEdgeFilter2D::addRegion
{
bPointRegions
.
append
(
regionI
);
}
else
if
(
findIndex
(
bPointRegions
,
regionI
)
==
-
1
)
else
if
(
!
bPointRegions
.
found
(
regionI
))
{
bPointRegions
.
append
(
regionI
);
}
...
...
applications/utilities/mesh/manipulation/autoPatch/autoPatch.C
View file @
b8f0823d
...
...
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
while
(
true
)
{
// Find first unset face.
label
unsetFacei
=
findIndex
(
patchIDs
,
-
1
);
label
unsetFacei
=
patchIDs
.
find
(
-
1
);
if
(
unsetFacei
==
-
1
)
{
...
...
applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C
View file @
b8f0823d
...
...
@@ -137,7 +137,7 @@ Foam::label Foam::meshDualiser::findDualCell
}
else
{
label
index
=
findIndex
(
mesh_
.
pointCells
()[
pointi
]
,
celli
);
label
index
=
mesh_
.
pointCells
()[
pointi
]
.
find
(
celli
);
return
dualCells
[
index
];
}
...
...
@@ -421,7 +421,7 @@ void Foam::meshDualiser::createFacesAroundEdge
}
if
(
faceToDualPoint_
[
ie
.
faceLabel
()]
!=
-
1
)
{
doneEFaces
[
findIndex
(
eFaces
,
ie
.
faceLabel
())]
=
true
;
doneEFaces
[
eFaces
.
find
(
ie
.
faceLabel
())]
=
true
;
verts
.
append
(
faceToDualPoint_
[
ie
.
faceLabel
()]);
}
if
(
cellToDualPoint_
[
ie
.
cellLabel
()]
!=
-
1
)
...
...
@@ -439,7 +439,7 @@ void Foam::meshDualiser::createFacesAroundEdge
label
facei
=
ie
.
faceLabel
();
// Mark face as visited.
doneEFaces
[
findIndex
(
eFaces
,
facei
)]
=
true
;
doneEFaces
[
eFaces
.
find
(
facei
)]
=
true
;
if
(
faceToDualPoint_
[
facei
]
!=
-
1
)
{
...
...
@@ -513,7 +513,7 @@ void Foam::meshDualiser::createFacesAroundEdge
{
label
startDual
=
faceToDualPoint_
[
startFaceLabel
];
if
(
startDual
!=
-
1
&&
findIndex
(
verts
,
startDual
)
==
-
1
)
if
(
startDual
!=
-
1
&&
!
verts
.
found
(
startDual
))
{
verts
.
append
(
startDual
);
}
...
...
@@ -666,7 +666,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
while
(
true
)
{
label
index
=
findIndex
(
pFaces
,
facei
-
pp
.
start
());
label
index
=
pFaces
.
find
(
facei
-
pp
.
start
());
// Has face been visited already?
if
(
donePFaces
[
index
])
...
...
@@ -682,7 +682,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
// Get the edge before the patchPointi
const
face
&
f
=
mesh_
.
faces
()[
facei
];
label
fp
=
find
Index
(
f
,
pointi
);
label
fp
=
f
.
find
(
pointi
);
label
prevFp
=
f
.
rcIndex
(
fp
);
label
edgeI
=
mesh_
.
faceEdges
()[
facei
][
prevFp
];
...
...
@@ -763,7 +763,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
// Find edge between pointi and next point on face.
const
labelList
&
fEdges
=
mesh_
.
faceEdges
()[
facei
];
label
nextEdgeI
=
fEdges
[
findIndex
(
mesh_
.
faces
()[
facei
]
,
pointi
)];
label
nextEdgeI
=
fEdges
[
mesh_
.
faces
()[
facei
]
.
find
(
pointi
)];
if
(
edgeToDualPoint_
[
nextEdgeI
]
!=
-
1
)
{
verts
.
append
(
edgeToDualPoint_
[
nextEdgeI
]);
...
...
@@ -771,7 +771,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
do
{
label
index
=
findIndex
(
pFaces
,
facei
-
pp
.
start
());
label
index
=
pFaces
.
find
(
facei
-
pp
.
start
());
// Has face been visited already?
if
(
donePFaces
[
index
])
...
...
@@ -786,7 +786,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
// Find edge before pointi on facei
const
labelList
&
fEdges
=
mesh_
.
faceEdges
()[
facei
];
const
face
&
f
=
mesh_
.
faces
()[
facei
];
label
prevFp
=
f
.
rcIndex
(
find
Index
(
f
,
pointi
));
label
prevFp
=
f
.
rcIndex
(
f
.
find
(
pointi
));
label
edgeI
=
fEdges
[
prevFp
];
if
(
edgeToDualPoint_
[
edgeI
]
!=
-
1
)
...
...
@@ -912,7 +912,7 @@ void Foam::meshDualiser::setRefinement
{
featureFaceSet
[
featureFaces
[
i
]]
=
true
;
}
label
facei
=
findIndex
(
featureFaceSet
,
false
);
label
facei
=
featureFaceSet
.
find
(
false
);
if
(
facei
!=
-
1
)
{
...
...
@@ -929,7 +929,7 @@ void Foam::meshDualiser::setRefinement
{
featureEdgeSet
[
featureEdges
[
i
]]
=
true
;
}
label
edgeI
=
findIndex
(
featureEdgeSet
,
false
);
label
edgeI
=
featureEdgeSet
.
find
(
false
);
if
(
edgeI
!=
-
1
)
{
...
...
applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C
View file @
b8f0823d
...
...
@@ -1574,7 +1574,7 @@ int main(int argc, char *argv[])
<<
" This requires all"
<<
" cells to be in one and only one cellZone."
<<
nl
<<
endl
;
label
unzonedCelli
=
findIndex
(
zoneID
,
-
1
);
label
unzonedCelli
=
zoneID
.
find
(
-
1
);
if
(
unzonedCelli
!=
-
1
)
{
FatalErrorInFunction
...
...
@@ -1623,7 +1623,7 @@ int main(int argc, char *argv[])
labelList
newNeiZoneID
(
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
());
getZoneID
(
mesh
,
newCellZones
,
newZoneID
,
newNeiZoneID
);
label
unzonedCelli
=
findIndex
(
newZoneID
,
-
1
);
label
unzonedCelli
=
newZoneID
.
find
(
-
1
);
if
(
unzonedCelli
!=
-
1
)
{
FatalErrorInFunction
...
...
applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C
View file @
b8f0823d
...
...
@@ -179,7 +179,7 @@ class uniqueEqOp
}
forAll
(
y
,
i
)
{
if
(
!
y
[
i
].
empty
()
&&
findIndex
(
x
,
y
[
i
])
==
-
1
)
if
(
!
y
[
i
].
empty
()
&&
!
x
.
found
(
y
[
i
])
)
{
newX
[
n
++
]
=
y
[
i
];
}
...
...
applications/utilities/miscellaneous/patchSummary/patchSummary.C
View file @
b8f0823d
...
...
@@ -173,7 +173,7 @@ int main(int argc, char *argv[])
collectFieldList
(
psytf
,
patchi
,
fieldToType
);
collectFieldList
(
ptf
,
patchi
,
fieldToType
);
label
groupI
=
findIndex
(
fieldToTypes
,
fieldToType
);
label
groupI
=
fieldToTypes
.
find
(
fieldToType
);
if
(
groupI
==
-
1
)
{
DynamicList
<
label
>
group
(
1
);
...
...
Prev
1
2
3
4
5
…
7
Next
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