functionObjects: Clear the result field from the objectRegistry if the argument fields are not available

This is needed to handle the processing of many time directories, some
of which may have the required fields and some not.
This commit is contained in:
Henry Weller
2016-05-25 15:40:58 +01:00
parent bae742112f
commit 0e3f655865
35 changed files with 435 additions and 370 deletions

View File

@ -45,6 +45,27 @@ namespace functionObjects
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool Foam::functionObjects::enstrophy::calc()
{
if (foundField<volVectorField>(fieldName_))
{
return store
(
resultName_,
0.5*magSqr(fvc::curl(lookupField<volVectorField>(fieldName_)))
);
}
else
{
return false;
}
return true;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::enstrophy::enstrophy
@ -64,25 +85,4 @@ Foam::functionObjects::enstrophy::~enstrophy()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::enstrophy::execute(const bool postProcess)
{
if (foundField<volVectorField>(fieldName_))
{
return store
(
resultName_,
0.5*magSqr(fvc::curl(lookupField<volVectorField>(fieldName_)))
);
}
else
{
return false;
}
return true;
}
// ************************************************************************* //