From 5f0e76fcf9f98fde95f0e991a92e4de6ce0851c8 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 15 Nov 2019 15:44:00 +0000 Subject: [PATCH] functionObjectList: Prevent execution during construction As of 2ebed5ec, functonObjectList::start contains run commands that trigger if some function objects are executable at time-zero. A call to this method in functionObjectList::New has been removed (and replaced with functonObjectList::read) as it was causing postProcess and -postProcess to execute twice; once on construction, and once at the selected initial time. This change also fixes lookup errors generated by postProcess which occured because fields (specified with -field or -fields arguments) are not read and registered prior to function object construction. Usage of functonObjectList::start within Time::run has not been altered. --- .../db/functionObjects/functionObjectList/functionObjectList.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 9dea8bcc4e..3f14dd4580 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -540,7 +540,7 @@ Foam::autoPtr Foam::functionObjectList::New functionsPtr.reset(new functionObjectList(runTime)); } - functionsPtr->start(); + functionsPtr->read(); return functionsPtr; }