From 4b933332924e29ca2f8914ff7bc0a46d6096e15a Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Tue, 7 Mar 2017 10:53:40 +0100
Subject: [PATCH] ENH: improve handling of noFunctionObjects /
 withFunctionObjects (issue #352)

- do not enable function objects by default if there is no means of
  disabling them.
---
 src/OpenFOAM/db/Time/Time.C | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C
index 12e62219c03..6aabf93eabe 100644
--- a/src/OpenFOAM/db/Time/Time.C
+++ b/src/OpenFOAM/db/Time/Time.C
@@ -515,7 +515,9 @@ Foam::Time::Time
         *this,
         argList::validOptions.found("withFunctionObjects")
       ? args.optionFound("withFunctionObjects")
-      : !args.optionFound("noFunctionObjects")
+      : argList::validOptions.found("noFunctionObjects")
+      ? !args.optionFound("noFunctionObjects")
+      : false
     )
 {
     libs_.open(controlDict_, "libs");
@@ -590,7 +592,6 @@ Foam::Time::Time
 {
     libs_.open(controlDict_, "libs");
 
-
     // Explicitly set read flags on objectRegistry so anything constructed
     // from it reads as well (e.g. fvSolution).
     readOpt() = IOobject::MUST_READ_IF_MODIFIED;
-- 
GitLab