Skip to content
Snippets Groups Projects
Commit 797c4a74 authored by mattijs's avatar mattijs
Browse files

ENH: functionObjects: force writing when used through execFlowFunctionObjects

parent 3a2822ec
Branches
Tags
No related merge requests found
...@@ -68,13 +68,13 @@ namespace Foam ...@@ -68,13 +68,13 @@ namespace Foam
functionObjectList fol(runTime, dict); functionObjectList fol(runTime, dict);
fol.start(); fol.start();
fol.execute(); fol.execute(true); // override outputControl - force writing
} }
else else
{ {
functionObjectList fol(runTime); functionObjectList fol(runTime);
fol.start(); fol.start();
fol.execute(); fol.execute(true); // override outputControl - force writing
} }
} }
} }
......
...@@ -128,7 +128,10 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start() ...@@ -128,7 +128,10 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
template<class OutputFilter> template<class OutputFilter>
bool Foam::OutputFilterFunctionObject<OutputFilter>::execute() bool Foam::OutputFilterFunctionObject<OutputFilter>::execute
(
const bool forceWrite
)
{ {
if (enabled_) if (enabled_)
{ {
...@@ -139,7 +142,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute() ...@@ -139,7 +142,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute()
ptr_->execute(); ptr_->execute();
if (outputControl_.output()) if (forceWrite || outputControl_.output())
{ {
ptr_->write(); ptr_->write();
} }
......
...@@ -183,7 +183,7 @@ public: ...@@ -183,7 +183,7 @@ public:
virtual bool start(); virtual bool start();
//- Called at each ++ or += of the time-loop //- 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 //- Called when Time::run() determines that the time-loop exits
virtual bool end(); virtual bool end();
......
...@@ -112,7 +112,7 @@ const Foam::word& Foam::functionObject::name() const ...@@ -112,7 +112,7 @@ const Foam::word& Foam::functionObject::name() const
bool Foam::functionObject::end() bool Foam::functionObject::end()
{ {
return execute(); return execute(false);
} }
......
...@@ -147,8 +147,9 @@ public: ...@@ -147,8 +147,9 @@ public:
//- Called at the start of the time-loop //- Called at the start of the time-loop
virtual bool start() = 0; virtual bool start() = 0;
//- Called at each ++ or += of the time-loop //- Called at each ++ or += of the time-loop. forceWrite overrides the
virtual bool execute() = 0; // outputControl behaviour.
virtual bool execute(const bool forceWrite) = 0;
//- Called when Time::run() determines that the time-loop exits. //- Called when Time::run() determines that the time-loop exits.
// By default it simply calls execute(). // By default it simply calls execute().
......
...@@ -144,7 +144,7 @@ bool Foam::functionObjectList::start() ...@@ -144,7 +144,7 @@ bool Foam::functionObjectList::start()
} }
bool Foam::functionObjectList::execute() bool Foam::functionObjectList::execute(const bool forceWrite)
{ {
bool ok = true; bool ok = true;
...@@ -157,7 +157,7 @@ bool Foam::functionObjectList::execute() ...@@ -157,7 +157,7 @@ bool Foam::functionObjectList::execute()
forAll(*this, objectI) forAll(*this, objectI)
{ {
ok = operator[](objectI).execute() && ok; ok = operator[](objectI).execute(forceWrite) && ok;
} }
} }
......
...@@ -153,8 +153,10 @@ public: ...@@ -153,8 +153,10 @@ public:
//- Called at the start of the time-loop //- Called at the start of the time-loop
virtual bool start(); virtual bool start();
//- Called at each ++ or += of the time-loop //- Called at each ++ or += of the time-loop. forceWrite overrides
virtual bool execute(); // 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 //- Called when Time::run() determines that the time-loop exits
virtual bool end(); virtual bool end();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment