mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects: Separated 'execute' and 'write' functions to simplify support for post-processing
This commit is contained in:
@ -168,10 +168,17 @@ Foam::functionObject& Foam::codedFunctionObject::redirectFunctionObject() const
|
||||
}
|
||||
|
||||
|
||||
bool Foam::codedFunctionObject::execute(const bool forceWrite)
|
||||
bool Foam::codedFunctionObject::execute(const bool postProcess)
|
||||
{
|
||||
updateLibrary(redirectType_);
|
||||
return redirectFunctionObject().execute(forceWrite);
|
||||
return redirectFunctionObject().execute(postProcess);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::codedFunctionObject::write(const bool postProcess)
|
||||
{
|
||||
updateLibrary(redirectType_);
|
||||
return redirectFunctionObject().write(postProcess);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -171,9 +171,15 @@ public:
|
||||
//- Dynamically compiled functionObject
|
||||
functionObject& redirectFunctionObject() const;
|
||||
|
||||
//- Called at each ++ or += of the time-loop. forceWrite overrides the
|
||||
// writeControl behaviour.
|
||||
virtual bool execute(const bool forceWrite);
|
||||
//- Called at each ++ or += of the time-loop.
|
||||
// postProcess overrides the usual executeControl behaviour and
|
||||
// forces execution (used in post-processing mode)
|
||||
virtual bool execute(const bool postProcess = false);
|
||||
|
||||
//- Called at each ++ or += of the time-loop.
|
||||
// postProcess overrides the usual writeControl behaviour and
|
||||
// forces writing always (used in post-processing mode)
|
||||
virtual bool write(const bool postProcess = false);
|
||||
|
||||
//- Called when Time::run() determines that the time-loop exits.
|
||||
// By default it simply calls execute().
|
||||
|
||||
@ -77,7 +77,16 @@ Foam::functionObjects::setTimeStepFunctionObject::time() const
|
||||
|
||||
bool Foam::functionObjects::setTimeStepFunctionObject::execute
|
||||
(
|
||||
const bool forceWrite
|
||||
const bool postProcess
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::setTimeStepFunctionObject::write
|
||||
(
|
||||
const bool postProcess
|
||||
)
|
||||
{
|
||||
return true;
|
||||
|
||||
@ -109,8 +109,15 @@ public:
|
||||
|
||||
// Function object control
|
||||
|
||||
//- Called at each ++ or += of the time-loop
|
||||
virtual bool execute(const bool forceWrite);
|
||||
//- Called at each ++ or += of the time-loop.
|
||||
// postProcess overrides the usual executeControl behaviour and
|
||||
// forces execution (used in post-processing mode)
|
||||
virtual bool execute(const bool postProcess = false);
|
||||
|
||||
//- Called at each ++ or += of the time-loop.
|
||||
// postProcess overrides the usual writeControl behaviour and
|
||||
// forces writing always (used in post-processing mode)
|
||||
virtual bool write(const bool postProcess = false);
|
||||
|
||||
//- Called when Time::run() determines that the time-loop exits
|
||||
virtual bool end();
|
||||
|
||||
Reference in New Issue
Block a user