STYLE: use list methods find/found instead of findIndex function

This commit is contained in:
Mark Olesen
2017-10-24 19:07:34 +02:00
parent 5b8b689a37
commit 7d7b0bfe84
136 changed files with 369 additions and 441 deletions

View File

@ -68,7 +68,7 @@ void Foam::functionObjects::fieldValues::fieldValueDelta::writeFileHeader
DynamicList<word> commonFields(fields1.size());
forAll(fields1, fieldi)
{
label index = findIndex(fields2, fields1[fieldi]);
label index = fields2.find(fields1[fieldi]);
if (index != -1)
{
commonFields.append(fields1[fieldi]);

View File

@ -551,7 +551,7 @@ bool Foam::functionObjects::streamLineBase::read(const dictionary& dict)
Info<< " Employing velocity field " << UName_ << endl;
if (findIndex(fields_, UName_) == -1)
if (!fields_.found(UName_))
{
FatalIOErrorInFunction(dict)
<< "Velocity field for tracking " << UName_

View File

@ -129,14 +129,14 @@ void Foam::wallBoundedParticle::crossEdgeConnectedFace
{
// Edge is in the forward circulation of this face, so
// work with the start point of the edge
eIndex = findIndex(otherFace, e.start());
eIndex = otherFace.find(e.start());
}
else
{
// edDir == -1, so the edge is in the reverse
// circulation of this face, so work with the end
// point of the edge
eIndex = findIndex(otherFace, e.end());
eIndex = otherFace.find(e.end());
}
label tetBasePtI = mesh().tetBasePtIs()[facei];
@ -194,7 +194,7 @@ void Foam::wallBoundedParticle::crossEdgeConnectedFace(const edge& meshEdge)
// And adapt meshEdgeStart_.
const Foam::face& f = mesh().faces()[tetFace()];
label fp = findIndex(f, meshEdge[0]);
label fp = f.find(meshEdge[0]);
if (f.nextLabel(fp) == meshEdge[1])
{
@ -371,8 +371,8 @@ bool Foam::wallBoundedParticle::isTriAlongTrack
if
(
currentE[0] == currentE[1]
|| findIndex(triVerts, currentE[0]) == -1
|| findIndex(triVerts, currentE[1]) == -1
|| !triVerts.found(currentE[0])
|| !triVerts.found(currentE[1])
)
{
FatalErrorInFunction