functionObjects: Renamed dictionary entry 'functionObjectLibs' -> 'libs'

This changes simplifies the specification of functionObjects in
controlDict and is consistent with the 'libs' option in controlDict to
load special solver libraries.

Support for the old 'functionObjectLibs' name is supported for backward compatibility.
This commit is contained in:
Henry Weller
2016-05-16 22:09:01 +01:00
parent a44857b4f2
commit 83bae2efd3
128 changed files with 191 additions and 166 deletions

View File

@ -61,12 +61,24 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
Info<< "Selecting function " << functionType << endl;
}
const_cast<Time&>(t).libs().open
(
dict,
"functionObjectLibs",
dictionaryConstructorTablePtr_
);
if (dict.found("functionObjectLibs"))
{
const_cast<Time&>(t).libs().open
(
dict,
"functionObjectLibs",
dictionaryConstructorTablePtr_
);
}
else
{
const_cast<Time&>(t).libs().open
(
dict,
"libs",
dictionaryConstructorTablePtr_
);
}
if (!dictionaryConstructorTablePtr_)
{

View File

@ -46,7 +46,7 @@ Description
myFunctionObject // Name of functionObject entry
{
type functionObjectType;
functionObjectLibs ("libMyFunctionObjectlib.so");
libs ("libMyFunctionObjectlib.so");
region defaultRegion;
enabled yes;
timeStart 0;
@ -62,7 +62,7 @@ Description
\table
Property | Description | Required | Default value
type | Type of function object | yes |
functionObjectLibs | Libraries containing implementation | yes |
libs | Libraries containing implementation | yes |
region | Name of region for multi-region cases | no |
enabled | On/off switch | no | yes
timeStart| Start time | no |

View File

@ -64,12 +64,6 @@ void Foam::functionObjects::writeFiles::createFiles()
}
void Foam::functionObjects::writeFiles::write()
{
createFiles();
}
void Foam::functionObjects::writeFiles::resetNames(const wordList& names)
{
names_.clear();
@ -200,4 +194,12 @@ Foam::OFstream& Foam::functionObjects::writeFiles::file(const label i)
}
bool Foam::functionObjects::writeFiles::write(const bool postProcess)
{
createFiles();
return true;
}
// ************************************************************************* //

View File

@ -74,9 +74,6 @@ protected:
//- Create the output file
virtual void createFiles();
//- Write function
virtual void write();
//- Reset the list of names from a wordList
virtual void resetNames(const wordList& names);
@ -130,6 +127,9 @@ public:
//- Return file 'i'
OFstream& file(const label i);
//- Write function
virtual bool write(const bool postProcess = false);
};