From 4b933332924e29ca2f8914ff7bc0a46d6096e15a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 7 Mar 2017 10:53:40 +0100 Subject: [PATCH 1/6] 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 12e62219c0..6aabf93eab 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; From 865f09e6239b2f4b87e2596b7db71616f677659c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 7 Mar 2017 18:48:57 +0100 Subject: [PATCH 2/6] STYLE: comments in codedFvOptionTemplate --- etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H index c276419362..a30727ccb6 100644 --- a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H +++ b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H @@ -39,11 +39,11 @@ Description setValue ( fvMatrix& eqn, - const label fieldi + const label fieldi ) where : - fld is the field in fieldNames + fieldi is the index in the fields entry eqn is the fvMatrix energySource @@ -55,7 +55,7 @@ Description scalarCodedSourceCoeffs { - fieldNames (h); + fields (h); name sourceTime; codeInclude From b7dc6d04418f3a11b4917ad0694b2fb34caf5c13 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 7 Mar 2017 17:00:30 +0100 Subject: [PATCH 3/6] ENH: add subsetList/inplaceSubsetList functions with unary predicate - these are suitable for use with lambda functions. - Deprecate the unused 3-parameter version of subset/inplaceSubset. - Deprecate initList and initListList in favour of initializer_list STYLE: adjust some comments, remove dead code in regionSizeDistribution.C --- applications/test/ListOps/Test-ListOps.C | 16 +++- .../containers/Lists/ListOps/ListOps.C | 9 +- .../containers/Lists/ListOps/ListOps.H | 91 ++++++++++++------- .../Lists/ListOps/ListOpsTemplates.C | 73 +++++++++++---- .../primitives/strings/lists/stringListOps.H | 10 +- .../regionSizeDistribution.C | 18 ---- 6 files changed, 135 insertions(+), 82 deletions(-) diff --git a/applications/test/ListOps/Test-ListOps.C b/applications/test/ListOps/Test-ListOps.C index fbbe90deb9..2efba98c7f 100644 --- a/applications/test/ListOps/Test-ListOps.C +++ b/applications/test/ListOps/Test-ListOps.C @@ -109,7 +109,21 @@ int main(int argc, char *argv[]) SubList