ENH: runTimePostProcessing - added option to clear/remove objects after use

This commit is contained in:
Andrew Heather
2016-12-15 15:45:02 +00:00
parent 83dab87568
commit 4ff1c7dca4
18 changed files with 370 additions and 75 deletions

View File

@ -62,14 +62,8 @@ functionObjectSurface
)
:
geometrySurface(parent, dict, colours, List<fileName>()),
fieldVisualisationBase(parent, dict, colours),
functionObject_("")
{
if (visible_)
{
dict.lookup("functionObject") >> functionObject_;
}
}
functionObjectBase(parent, dict, colours)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -93,23 +87,12 @@ addGeometryToScene
return;
}
dictionary dict;
if (!geometryBase::parent_.getObjectDict(functionObject_, fieldName_, dict))
{
WarningInFunction
<< "Unable to find function object " << functionObject_
<< " output for field " << fieldName_
<< ". Surface will not be processed"
<< endl;
return;
}
fileName fName;
if (!dict.readIfPresent("file", fName))
fileName fName = getFileName("file", fieldName_);
if (fName.empty())
{
WarningInFunction
<< "Unable to read file name from function object "
<< functionObject_ << " for field " << fieldName_
<< functionObjectName_ << " for field " << fieldName_
<< ". Surface will not be processed"
<< endl;
return;
@ -167,4 +150,15 @@ addGeometryToScene
}
bool Foam::functionObjects::runTimePostPro::functionObjectSurface::clear()
{
if (functionObjectBase::clear())
{
return removeFile("file", fieldName_);
}
return false;
}
// ************************************************************************* //