mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
postProcess: Added call to functionObject::end() at end of time-loop
Resolves bug-report http://bugs.openfoam.org/view.php?id=2148
This commit is contained in:
@ -59,7 +59,8 @@ void executeFunctionObjects
|
|||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
fvMesh& mesh,
|
fvMesh& mesh,
|
||||||
const HashSet<word>& selectedFields,
|
const HashSet<word>& selectedFields,
|
||||||
functionObjectList& functions
|
functionObjectList& functions,
|
||||||
|
bool lastTime
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< nl << "Reading fields:" << endl;
|
Info<< nl << "Reading fields:" << endl;
|
||||||
@ -115,6 +116,12 @@ void executeFunctionObjects
|
|||||||
// Execute the functionObjects in post-processing mode
|
// Execute the functionObjects in post-processing mode
|
||||||
functions.execute();
|
functions.execute();
|
||||||
|
|
||||||
|
// Execute the functionObject 'end()' function for the last time
|
||||||
|
if (lastTime)
|
||||||
|
{
|
||||||
|
functions.end();
|
||||||
|
}
|
||||||
|
|
||||||
while (!storedObjects.empty())
|
while (!storedObjects.empty())
|
||||||
{
|
{
|
||||||
storedObjects.pop()->checkOut();
|
storedObjects.pop()->checkOut();
|
||||||
@ -164,9 +171,9 @@ int main(int argc, char *argv[])
|
|||||||
functionObjectList::New(args, runTime, functionsDict, selectedFields)
|
functionObjectList::New(args, runTime, functionsDict, selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
forAll(timeDirs, timei)
|
||||||
{
|
{
|
||||||
runTime.setTime(timeDirs[timeI], timeI);
|
runTime.setTime(timeDirs[timei], timei);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
@ -192,7 +199,8 @@ int main(int argc, char *argv[])
|
|||||||
runTime,
|
runTime,
|
||||||
mesh,
|
mesh,
|
||||||
selectedFields,
|
selectedFields,
|
||||||
functionsPtr()
|
functionsPtr(),
|
||||||
|
timei == timeDirs.size()-1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (IOerror& err)
|
catch (IOerror& err)
|
||||||
|
|||||||
@ -104,9 +104,9 @@ if (argList::postProcess(argc, argv))
|
|||||||
functionObjectList::New(args, runTime, functionsDict, selectedFields)
|
functionObjectList::New(args, runTime, functionsDict, selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
forAll(timeDirs, timei)
|
||||||
{
|
{
|
||||||
runTime.setTime(timeDirs[timeI], timeI);
|
runTime.setTime(timeDirs[timei], timei);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
@ -137,6 +137,12 @@ if (argList::postProcess(argc, argv))
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
functionsPtr->execute();
|
functionsPtr->execute();
|
||||||
|
|
||||||
|
// Execute the functionObject 'end()' function for the last time
|
||||||
|
if (timei == timeDirs.size()-1)
|
||||||
|
{
|
||||||
|
functionsPtr->end();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (IOerror& err)
|
catch (IOerror& err)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user