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

@ -61,8 +61,7 @@ Foam::functionObjects::runTimePostPro::functionObjectLine::functionObjectLine
)
:
pathline(parent, dict, colours),
fieldVisualisationBase(parent, dict, colours),
functionObject_(dict.lookup("functionObject")),
functionObjectBase(parent, dict, colours),
actor_()
{
actor_ = vtkSmartPointer<vtkActor>::New();
@ -89,23 +88,12 @@ addGeometryToScene
return;
}
dictionary dict;
if (!geometryBase::parent_.getObjectDict(functionObject_, fieldName_, dict))
{
WarningInFunction
<< "Unable to find function object " << functionObject_
<< " output for field " << fieldName_
<< ". Line 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_
<< ". Line will not be processed"
<< endl;
return;
@ -140,5 +128,15 @@ void Foam::functionObjects::runTimePostPro::functionObjectLine::updateActors
actor_->GetProperty()->SetOpacity(opacity(position));
}
bool Foam::functionObjects::runTimePostPro::functionObjectLine::clear()
{
if (functionObjectBase::clear())
{
return removeFile("file", fieldName_);
}
return false;
}
// ************************************************************************* //