From d8a4643e81bfca636599a90451da7a00b0b80e55 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 12 Aug 2016 21:46:21 +0100 Subject: [PATCH] functionObject: change default behavior of 'end()' to do nothing rather than calling execute and write Time: call functionObject 'execute()' and 'end()' for last time-step Now the operation of functionObject 'end()' call is consistent between running and post-processing --- src/OpenFOAM/db/Time/Time.C | 4 +--- .../db/functionObjects/functionObject/functionObject.C | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 3252c8039..cc2ba3a52 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -850,11 +850,9 @@ bool Foam::Time::run() const if (!subCycling_) { - // only execute when the condition is no longer true - // ie, when exiting the control loop if (!running && timeIndex_ != startTimeIndex_) { - // Note, end() also calls an indirect start() as required + functionObjects_.execute(); functionObjects_.end(); } } diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index c0cd27a97..b0a92bc5c 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -136,7 +136,7 @@ bool Foam::functionObject::read(const dictionary& dict) bool Foam::functionObject::end() { - return execute() && write(); + return true; }