From 2b501b7e856654b7da35ce76a8dece8352951b36 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 18 May 2016 09:05:24 +0100 Subject: [PATCH] timeControlFunctionObject: Updated the control logic in the 'end' function to correspond to the new default behavior of the 'end' function in functionObject which now calls 'execute' then 'write'. --- .../timeControl/timeControlFunctionObject.C | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C index 0d73f0b611..1f7d38410d 100644 --- a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C @@ -87,12 +87,9 @@ Foam::functionObjects::timeControl::timeControl bool Foam::functionObjects::timeControl::execute(const bool postProcess) { - if (active()) + if (active() && (postProcess || executeControl_.execute())) { - if (postProcess || executeControl_.execute()) - { - foPtr_->execute(); - } + foPtr_->execute(); } return true; @@ -101,12 +98,9 @@ bool Foam::functionObjects::timeControl::execute(const bool postProcess) bool Foam::functionObjects::timeControl::write(const bool postProcess) { - if (active()) + if (active() && (postProcess || writeControl_.execute())) { - if (postProcess || writeControl_.execute()) - { - foPtr_->write(); - } + foPtr_->write(); } return true; @@ -115,11 +109,9 @@ bool Foam::functionObjects::timeControl::write(const bool postProcess) bool Foam::functionObjects::timeControl::end() { - foPtr_->end(); - - if (writeControl_.execute()) + if (active() && (executeControl_.execute() || writeControl_.execute())) { - foPtr_->write(); + foPtr_->end(); } return true;