mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use list methods find/found instead of findIndex function
This commit is contained in:
@ -29,7 +29,7 @@ License
|
||||
|
||||
bool Foam::extrudedMesh::sameOrder(const face& f, const edge& e)
|
||||
{
|
||||
label i = findIndex(f, e[0]);
|
||||
label i = f.find(e[0]);
|
||||
|
||||
label nextI = (i == f.size()-1 ? 0 : i+1);
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ void Foam::patchToPoly2DMesh::flipFaceOrder()
|
||||
|
||||
const face& f = localFaces[edgeOwner];
|
||||
|
||||
label fp = findIndex(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 = findIndex(f, e[0]);
|
||||
label fp = f.find(e[0]);
|
||||
|
||||
newOwner[bFacei] = owner_[bEdgeI];
|
||||
|
||||
|
||||
@ -660,7 +660,7 @@ Foam::face Foam::conformalVoronoiMesh::buildDualFace
|
||||
|
||||
if (cc1I != cc2I)
|
||||
{
|
||||
if (findIndex(verticesOnFace, cc1I) == -1)
|
||||
if (!verticesOnFace.found(cc1I))
|
||||
{
|
||||
nUniqueVertices++;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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]);
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user