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:
@ -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]);
|
||||
|
||||
@ -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_
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user