Commit 83bae2ef authored by Henry Weller's avatar Henry Weller
Browse files

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.
parent a44857b4
......@@ -55,7 +55,7 @@ functions
type writeVTK;
// Where to load it from
functionObjectLibs ("libfoamToVTK.so");
libs ("libfoamToVTK.so");
// When to write:
// timeStep (with optional writeInterval)
......
......@@ -40,7 +40,7 @@ Description
writeVTK1
{
type writeVTK;
functionObjectLibs ("libIOFunctionObjects.so");
libs ("libIOFunctionObjects.so");
...
objectNames (obj1 obj2);
}
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl timeStep;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type Lambda2;
functionObjectLibs ("libutilityFunctionObjects.so");
libs ("libutilityFunctionObjects.so");
enabled true;
writeControl writeTime;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type Q;
functionObjectLibs ("libutilityFunctionObjects.so");
libs ("libutilityFunctionObjects.so");
enabled true;
writeControl writeTime;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type forces;
functionObjectLibs ( "libforces.so" );
libs ( "libforces.so" );
enabled true;
writeControl timeStep;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type sets;
functionObjectLibs ("libsampling.so");
libs ("libsampling.so");
enabled true;
writeControl writeTime;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type cellSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl timeStep;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl timeStep;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type fieldMinMax;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl timeStep;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type residuals;
functionObjectLibs ("libutilityFunctionObjects.so");
libs ("libutilityFunctionObjects.so");
enabled true;
writeControl timeStep;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type fieldValueDelta;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
operation subtract;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type pressureTools;
functionObjectLibs ("libutilityFunctionObjects.so");
libs ("libutilityFunctionObjects.so");
enabled true;
writeControl writeTime;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type sets;
functionObjectLibs ("libsampling.so");
libs ("libsampling.so");
enabled true;
writeControl writeTime;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type probes;
functionObjectLibs ("libsampling.so");
libs ("libsampling.so");
enabled true;
writeControl timeStep;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type scalarTransport;
functionObjectLibs ("libutilityFunctionObjects.so");
libs ("libutilityFunctionObjects.so");
enabled true;
writeControl timeStep;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type streamLine;
functionObjectLibs ( "libfieldFunctionObjects.so" );
libs ( "libfieldFunctionObjects.so" );
writeControl writeTime;
......
......@@ -15,7 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type surfaces;
functionObjectLibs ("libsampling.so");
libs ("libsampling.so");
enabled true;
writeControl writeTime;
......
......@@ -34,7 +34,7 @@ Description
FUNCTIONOBJECT1
{
type FUNCTIONOBJECT;
functionObjectLibs ("libFUNCTIONOBJECTFunctionObject.so");
libs ("libFUNCTIONOBJECTFunctionObject.so");
...
wordData someWord;
scalarData 1.0;
......
......@@ -17,7 +17,7 @@ FoamFile
graph
{
type sets;
functionObjectLibs ("libsampling.so");
libs ("libsampling.so");
writeControl writeTime;
interpolationScheme cellPointFace;
......
......@@ -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_)
{
......
......@@ -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 |
......
......@@ -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;
}
// ************************************************************************* //
......@@ -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);
};
......
......@@ -52,7 +52,7 @@ functions
type fieldAverage;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
// Function object enabled flag
enabled true;
......
......@@ -67,7 +67,7 @@ Description
fieldAverage1
{
type fieldAverage;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
restartOnRestart false;
restartOnOutput false;
......
......@@ -37,7 +37,7 @@ Description
fieldCoordinateSystemTransform1
{
type fieldCoordinateSystemTransform;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
fields
(
......
......@@ -22,7 +22,7 @@ functions
type fieldCoordinateSystemTransform;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
// Function object enabled flag
enabled true;
......
......@@ -52,7 +52,7 @@ functions
type fieldMinMax;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
// Function object enabled flag
enabled true;
......
......@@ -39,7 +39,7 @@ Description
fieldMinMax1
{
type fieldMinMax;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
write yes;
log yes;
......
......@@ -39,7 +39,7 @@ Description
cellSource1
{
type cellSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
log true;
valueOutput true;
......
......@@ -49,7 +49,7 @@ functions
faceObj1
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl writeTime;
......@@ -91,7 +91,7 @@ functions
faceObj2
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl writeTime;
log true;
......@@ -109,7 +109,7 @@ functions
cellObj1
{
type cellSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl writeTime;
log true;
......
......@@ -42,7 +42,7 @@ Description
faceSource1
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
log yes;
valueOutput true;
......
......@@ -36,7 +36,7 @@ Description
fieldValueDelta1
{
type fieldValueDelta;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
operation subtract;
fieldValue1
......
......@@ -36,7 +36,7 @@ Description
{
type histogram;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
field p;
nBins 100;
......
......@@ -49,7 +49,7 @@ functions
near
{
// Where to load it from
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
type nearWallFields;
......
......@@ -43,7 +43,7 @@ Description
nearWallFields1
{
type nearWallFields;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
fields ((p pNear)(U UNear));
patches (movingWall);
......
......@@ -22,7 +22,7 @@ functions
type processorField;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
// Function object enabled flag
enabled true;
......
......@@ -36,7 +36,7 @@ Description
processorField1
{
type processorField;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
}
\endverbatim
......
......@@ -19,7 +19,7 @@ functions
readFields1
{
type readFields;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl timeStep;
writeInterval 1;
......@@ -33,7 +33,7 @@ functions
faceObj2
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl timeStep;
writeInterval 1;
......
......@@ -36,7 +36,7 @@ Description
readFields1
{
type readFields;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
fields
(
......
......@@ -59,7 +59,7 @@ Description
regionSizeDistribution1
{
type regionSizeDistribution;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
field alpha;
patches (inlet);
......
......@@ -51,7 +51,7 @@ functions
type streamLine;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
// Output every
writeControl writeTime;
......
......@@ -37,7 +37,7 @@ Description
streamLine1
{
type streamLine;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
setFormat vtk;
UName U;
......
......@@ -43,7 +43,7 @@ Description
surfaceInterpolateFields1
{
type surfaceInterpolateFields;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
fields ((p pNear)(U UNear));
}
......
......@@ -49,7 +49,7 @@ functions
readFields
{
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
type readFields;
fields (p U k);
......@@ -58,7 +58,7 @@ functions
near
{
// Where to load it from
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
type nearWallFields;
......@@ -82,7 +82,7 @@ functions
streamLines
{
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
type wallBoundedStreamLine;
// Output every
......
......@@ -37,7 +37,7 @@ Description
wallBoundedStreamLine1
{
type wallBoundedStreamLine;
functionObjectLibs ("libfieldFunctionObjects.so");
libs ("libfieldFunctionObjects.so");
...
setFormat vtk;
UName UNear;
......
......@@ -37,7 +37,7 @@ Description
forceCoeffs1
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
libs ("libforces.so");
...
log yes;
patches (walls);
......
......@@ -40,7 +40,7 @@ Description
forces1
{
type forces;
functionObjectLibs ("libforces.so");