functionObjects::fieldAverage: Print warning if used with foamPostProcess

Field averaging can only be performed during the run as the averaging is
performed every time-step.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3922
This commit is contained in:
Henry Weller
2022-11-03 15:54:50 +00:00
parent 488ffd9fd1
commit ee4f05411d

View File

@ -374,11 +374,22 @@ Foam::wordList Foam::functionObjects::fieldAverage::fields() const
bool Foam::functionObjects::fieldAverage::execute() bool Foam::functionObjects::fieldAverage::execute()
{
if (functionObject::postProcess)
{
WarningInFunction
<< "fieldAverage is not supported with the foamPostProcess utility"
<< endl;
return false;
}
else
{ {
calcAverages(); calcAverages();
return true; return true;
} }
}
bool Foam::functionObjects::fieldAverage::write() bool Foam::functionObjects::fieldAverage::write()