Commit 447c8509 authored by Henry Weller's avatar Henry Weller
Browse files

functionObjectList: Added support for 'libs' to load libraries for all functionObjects

e.g.

functions
{
    libs ("libfieldFunctionObjects.so");

    div
    {
        type            div;
        field           U;
        executeControl  writeTime;
        writeControl    writeTime;
    }

    Q
    {
        type            Q;
        executeControl  writeTime;
        writeControl    writeTime;
    }
}
parent af57fd2a
......@@ -50,7 +50,7 @@ Foam::functionObject::functionObject(const word& name)
Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
(
const word& name,
const Time& t,
const Time& runTime,
const dictionary& dict
)
{
......@@ -63,7 +63,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
if (dict.found("functionObjectLibs"))
{
const_cast<Time&>(t).libs().open
const_cast<Time&>(runTime).libs().open
(
dict,
"functionObjectLibs",
......@@ -72,7 +72,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
}
else
{
const_cast<Time&>(t).libs().open
const_cast<Time&>(runTime).libs().open
(
dict,
"libs",
......@@ -102,7 +102,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
<< exit(FatalError);
}
return autoPtr<functionObject>(cstrIter()(name, t, dict));
return autoPtr<functionObject>(cstrIter()(name, runTime, dict));
}
......
......@@ -160,8 +160,8 @@ public:
autoPtr,
functionObject,
dictionary,
(const word& name, const Time& t, const dictionary& dict),
(name, t, dict)
(const word& name, const Time& runTime, const dictionary& dict),
(name, runTime, dict)
);
......
......@@ -284,12 +284,19 @@ bool Foam::functionObjectList::read()
<< exit(FatalIOError);
}
const dictionary& functionDicts = entryPtr->dict();
const dictionary& functionsDict = entryPtr->dict();
newPtrs.setSize(functionDicts.size());
newDigs.setSize(functionDicts.size());
const_cast<Time&>(time_).libs().open
(
functionsDict,
"libs",
functionObject::dictionaryConstructorTablePtr_
);
newPtrs.setSize(functionsDict.size());
newDigs.setSize(functionsDict.size());
forAllConstIter(dictionary, functionDicts, iter)
forAllConstIter(dictionary, functionsDict, iter)
{
const word& key = iter().keyword();
......
Markdown is supported
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