mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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;
}
}
This commit is contained in:
@ -50,7 +50,7 @@ Foam::functionObject::functionObject(const word& name)
|
|||||||
Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
|
Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
|
||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const Time& t,
|
const Time& runTime,
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -63,7 +63,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
|
|||||||
|
|
||||||
if (dict.found("functionObjectLibs"))
|
if (dict.found("functionObjectLibs"))
|
||||||
{
|
{
|
||||||
const_cast<Time&>(t).libs().open
|
const_cast<Time&>(runTime).libs().open
|
||||||
(
|
(
|
||||||
dict,
|
dict,
|
||||||
"functionObjectLibs",
|
"functionObjectLibs",
|
||||||
@ -72,7 +72,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const_cast<Time&>(t).libs().open
|
const_cast<Time&>(runTime).libs().open
|
||||||
(
|
(
|
||||||
dict,
|
dict,
|
||||||
"libs",
|
"libs",
|
||||||
@ -102,7 +102,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<functionObject>(cstrIter()(name, t, dict));
|
return autoPtr<functionObject>(cstrIter()(name, runTime, dict));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -160,8 +160,8 @@ public:
|
|||||||
autoPtr,
|
autoPtr,
|
||||||
functionObject,
|
functionObject,
|
||||||
dictionary,
|
dictionary,
|
||||||
(const word& name, const Time& t, const dictionary& dict),
|
(const word& name, const Time& runTime, const dictionary& dict),
|
||||||
(name, t, dict)
|
(name, runTime, dict)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -284,12 +284,19 @@ bool Foam::functionObjectList::read()
|
|||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
const dictionary& functionDicts = entryPtr->dict();
|
const dictionary& functionsDict = entryPtr->dict();
|
||||||
|
|
||||||
newPtrs.setSize(functionDicts.size());
|
const_cast<Time&>(time_).libs().open
|
||||||
newDigs.setSize(functionDicts.size());
|
(
|
||||||
|
functionsDict,
|
||||||
|
"libs",
|
||||||
|
functionObject::dictionaryConstructorTablePtr_
|
||||||
|
);
|
||||||
|
|
||||||
forAllConstIter(dictionary, functionDicts, iter)
|
newPtrs.setSize(functionsDict.size());
|
||||||
|
newDigs.setSize(functionsDict.size());
|
||||||
|
|
||||||
|
forAllConstIter(dictionary, functionsDict, iter)
|
||||||
{
|
{
|
||||||
const word& key = iter().keyword();
|
const word& key = iter().keyword();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user