mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: functionObjects: force writing when used through execFlowFunctionObjects
This commit is contained in:
@ -68,13 +68,13 @@ namespace Foam
|
||||
|
||||
functionObjectList fol(runTime, dict);
|
||||
fol.start();
|
||||
fol.execute();
|
||||
fol.execute(true); // override outputControl - force writing
|
||||
}
|
||||
else
|
||||
{
|
||||
functionObjectList fol(runTime);
|
||||
fol.start();
|
||||
fol.execute();
|
||||
fol.execute(true); // override outputControl - force writing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +128,10 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
|
||||
|
||||
|
||||
template<class OutputFilter>
|
||||
bool Foam::OutputFilterFunctionObject<OutputFilter>::execute()
|
||||
bool Foam::OutputFilterFunctionObject<OutputFilter>::execute
|
||||
(
|
||||
const bool forceWrite
|
||||
)
|
||||
{
|
||||
if (enabled_)
|
||||
{
|
||||
@ -139,7 +142,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute()
|
||||
|
||||
ptr_->execute();
|
||||
|
||||
if (outputControl_.output())
|
||||
if (forceWrite || outputControl_.output())
|
||||
{
|
||||
ptr_->write();
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ public:
|
||||
virtual bool start();
|
||||
|
||||
//- Called at each ++ or += of the time-loop
|
||||
virtual bool execute();
|
||||
virtual bool execute(const bool forceWrite);
|
||||
|
||||
//- Called when Time::run() determines that the time-loop exits
|
||||
virtual bool end();
|
||||
|
||||
@ -112,7 +112,7 @@ const Foam::word& Foam::functionObject::name() const
|
||||
|
||||
bool Foam::functionObject::end()
|
||||
{
|
||||
return execute();
|
||||
return execute(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -147,8 +147,9 @@ public:
|
||||
//- Called at the start of the time-loop
|
||||
virtual bool start() = 0;
|
||||
|
||||
//- Called at each ++ or += of the time-loop
|
||||
virtual bool execute() = 0;
|
||||
//- Called at each ++ or += of the time-loop. forceWrite overrides the
|
||||
// outputControl behaviour.
|
||||
virtual bool execute(const bool forceWrite) = 0;
|
||||
|
||||
//- Called when Time::run() determines that the time-loop exits.
|
||||
// By default it simply calls execute().
|
||||
|
||||
@ -144,7 +144,7 @@ bool Foam::functionObjectList::start()
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjectList::execute()
|
||||
bool Foam::functionObjectList::execute(const bool forceWrite)
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
@ -157,7 +157,7 @@ bool Foam::functionObjectList::execute()
|
||||
|
||||
forAll(*this, objectI)
|
||||
{
|
||||
ok = operator[](objectI).execute() && ok;
|
||||
ok = operator[](objectI).execute(forceWrite) && ok;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -153,8 +153,10 @@ public:
|
||||
//- Called at the start of the time-loop
|
||||
virtual bool start();
|
||||
|
||||
//- Called at each ++ or += of the time-loop
|
||||
virtual bool execute();
|
||||
//- Called at each ++ or += of the time-loop. forceWrite overrides
|
||||
// the usual outputControl behaviour and forces writing always
|
||||
// (used in postprocessing mode)
|
||||
virtual bool execute(const bool forceWrite = false);
|
||||
|
||||
//- Called when Time::run() determines that the time-loop exits
|
||||
virtual bool end();
|
||||
|
||||
Reference in New Issue
Block a user