Commit 40e22860 authored by Andrew Heather's avatar Andrew Heather
Browse files

added find(name) method + general updates

parent 8feabf5e
......@@ -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,9 +120,8 @@ public:
);
// Destructor
virtual ~functionObjectList();
//- Destructor
virtual ~functionObjectList();
// Member Functions
......@@ -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();
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment