added find(name) method + general updates
This commit is contained in:
parent
8feabf5e81
commit
40e22860e9
@ -106,6 +106,20 @@ void Foam::functionObjectList::clear()
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::functionObjectList::findObjectID(const word& name) const
|
||||
{
|
||||
forAll(*this, objectI)
|
||||
{
|
||||
if (operator[](objectI).name() == name)
|
||||
{
|
||||
return objectI;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::on()
|
||||
{
|
||||
execution_ = true;
|
||||
@ -142,14 +156,9 @@ bool Foam::functionObjectList::execute()
|
||||
read();
|
||||
}
|
||||
|
||||
forAllIter
|
||||
(
|
||||
PtrList<functionObject>,
|
||||
static_cast<PtrList<functionObject>&>(*this),
|
||||
iter
|
||||
)
|
||||
forAll(*this, objectI)
|
||||
{
|
||||
ok = iter().execute() && ok;
|
||||
ok = operator[](objectI).execute() && ok;
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,14 +177,9 @@ bool Foam::functionObjectList::end()
|
||||
read();
|
||||
}
|
||||
|
||||
forAllIter
|
||||
(
|
||||
PtrList<functionObject>,
|
||||
static_cast<PtrList<functionObject>&>(*this),
|
||||
iter
|
||||
)
|
||||
forAll(*this, objectI)
|
||||
{
|
||||
ok = iter().end() && ok;
|
||||
ok = operator[](objectI).end() && ok;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,8 +120,7 @@ public:
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
//- Destructor
|
||||
virtual ~functionObjectList();
|
||||
|
||||
|
||||
@ -139,6 +138,8 @@ public:
|
||||
//- Clear the list of function objects
|
||||
virtual void clear();
|
||||
|
||||
//- Find the ID of a given function object by name
|
||||
virtual label findObjectID(const word& name) const;
|
||||
|
||||
//- Switch the function objects on
|
||||
virtual void on();
|
||||
@ -161,7 +162,6 @@ public:
|
||||
|
||||
//- Read and set the function objects if their data have changed
|
||||
virtual bool read();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user