functionObjects: Simplified the handling of the post-processing mode

Replaced the 'postProcess' argument to the 'write' and 'execute'
functions with the single static member 'postProcess' in the
functionObject base-class.
This commit is contained in:
Henry Weller
2016-06-13 08:36:03 +01:00
parent 18b632e71d
commit ae1a6dd12d
102 changed files with 190 additions and 254 deletions

View File

@ -122,9 +122,9 @@ bool Foam::IOOutputFilter<OutputFilter>::read()
template<class OutputFilter>
bool Foam::IOOutputFilter<OutputFilter>::write(const bool postProcess)
bool Foam::IOOutputFilter<OutputFilter>::write()
{
return OutputFilter::write(postProcess);
return OutputFilter::write();
}

View File

@ -126,7 +126,7 @@ public:
using regIOobject::write;
//- Sample and write
virtual bool write(const bool postProcess = false);
virtual bool write();
//- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh& mpm);

View File

@ -211,12 +211,12 @@ public:
//- 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) = 0;
virtual bool execute() = 0;
//- 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) = 0;
virtual bool write() = 0;
//- Called when Time::run() determines that the time-loop exits.
// By default it simply calls execute().

View File

@ -145,7 +145,7 @@ bool Foam::functionObjectList::readFunctionObject
// 'patchAverage(patch=inlet, p)' -> funcName = patchAverage;
// args = (patch=inlet, p); field = p
word funcName;
word funcName(funcNameArgs);
int argLevel = 0;
wordList args;
@ -436,7 +436,7 @@ bool Foam::functionObjectList::start()
}
bool Foam::functionObjectList::execute(const bool postProcess)
bool Foam::functionObjectList::execute()
{
bool ok = true;
@ -449,8 +449,8 @@ bool Foam::functionObjectList::execute(const bool postProcess)
forAll(*this, objectI)
{
ok = operator[](objectI).execute(postProcess) && ok;
ok = operator[](objectI).write(postProcess) && ok;
ok = operator[](objectI).execute() && ok;
ok = operator[](objectI).write() && ok;
}
}

View File

@ -235,7 +235,7 @@ public:
//- Called at each ++ or += of the time-loop.
// postProcess overrides the usual executeControl behaviour and
// forces execution (used in post-processing mode)
bool execute(const bool postProcess = false);
bool execute();
//- Called when Time::run() determines that the time-loop exits
bool end();

View File

@ -136,7 +136,7 @@ if (argList::postProcess(argc, argv))
#include INCLUDE_FILE(CREATE_FIELDS_3)
#endif
functionsPtr->execute(true);
functionsPtr->execute();
}
catch (IOerror& err)
{

View File

@ -85,7 +85,7 @@ Foam::functionObjects::timeControl::timeControl
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::timeControl::execute(const bool postProcess)
bool Foam::functionObjects::timeControl::execute()
{
if (active() && (postProcess || executeControl_.execute()))
{
@ -96,7 +96,7 @@ bool Foam::functionObjects::timeControl::execute(const bool postProcess)
}
bool Foam::functionObjects::timeControl::write(const bool postProcess)
bool Foam::functionObjects::timeControl::write()
{
if (active() && (postProcess || writeControl_.execute()))
{

View File

@ -151,12 +151,12 @@ public:
//- 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);
virtual bool execute();
//- Called at each ++ or += of the time-loop.
// postProcess overrides the usual writeControl behaviour and
// forces writing (used in post-processing mode)
virtual bool write(const bool postProcess = false);
virtual bool write();
//- Called when Time::run() determines that the time-loop exits
virtual bool end();

View File

@ -194,7 +194,7 @@ Foam::OFstream& Foam::functionObjects::writeFiles::file(const label i)
}
bool Foam::functionObjects::writeFiles::write(const bool postProcess)
bool Foam::functionObjects::writeFiles::write()
{
createFiles();

View File

@ -129,7 +129,7 @@ public:
OFstream& file(const label i);
//- Write function
virtual bool write(const bool postProcess = false);
virtual bool write();
};