From a93d17fd0ff7c716ac8ace330bd2ef6a683aaf37 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Fri, 6 Apr 2012 23:28:50 -0400 Subject: [PATCH] Add -noFunctionObjects runtime option. Useful with mergeMeshes when problems with certain functionObjects --- .../mesh/manipulation/mergeMeshes/createTimes.H | 10 ++++++++-- .../mesh/manipulation/mergeMeshes/setRoots.H | 1 + src/OpenFOAM/db/Time/Time.C | 15 +++++++++------ src/OpenFOAM/db/Time/Time.H | 9 ++++++--- src/OpenFOAM/global/argList/argList.C | 1 + src/OpenFOAM/include/createTime.H | 5 ++++- 6 files changed, 29 insertions(+), 12 deletions(-) diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/createTimes.H b/applications/utilities/mesh/manipulation/mergeMeshes/createTimes.H index 4098a89e6..2e69bfb49 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/createTimes.H +++ b/applications/utilities/mesh/manipulation/mergeMeshes/createTimes.H @@ -4,12 +4,18 @@ ( Time::controlDictName, rootDirMaster, - caseDirMaster + caseDirMaster, + "system", + "constant", + !args.optionFound("noFunctionObjects") ); Time runTimeToAdd ( Time::controlDictName, rootDirToAdd, - caseDirToAdd + caseDirToAdd, + "system", + "constant", + !args.optionFound("noFunctionObjects") ); diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/setRoots.H b/applications/utilities/mesh/manipulation/mergeMeshes/setRoots.H index cfbf59cf6..dc708eeaf 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/setRoots.H +++ b/applications/utilities/mesh/manipulation/mergeMeshes/setRoots.H @@ -7,6 +7,7 @@ argList::validArgs.append("root to add"); argList::validArgs.append("case to add"); argList::validOptions.insert("addRegion", "name"); + argList::validOptions.insert("noFunctionObjects", ""); argList args(argc, argv); diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index a2d302523..041dd3343 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -191,7 +191,8 @@ Foam::Time::Time const fileName& rootPath, const fileName& caseName, const word& systemName, - const word& constantName + const word& constantName, + const bool enableFunctionObjects ) : TimePaths @@ -234,7 +235,7 @@ Foam::Time::Time runTimeModifiable_(true), readLibs_(controlDict_, "libs"), - functionObjects_(*this) + functionObjects_(*this, enableFunctionObjects) { setControls(); } @@ -246,7 +247,8 @@ Foam::Time::Time const fileName& rootPath, const fileName& caseName, const word& systemName, - const word& constantName + const word& constantName, + const bool enableFunctionObjects ) : TimePaths @@ -290,7 +292,7 @@ Foam::Time::Time runTimeModifiable_(true), readLibs_(controlDict_, "libs"), - functionObjects_(*this) + functionObjects_(*this, enableFunctionObjects) { setControls(); } @@ -301,7 +303,8 @@ Foam::Time::Time const fileName& rootPath, const fileName& caseName, const word& systemName, - const word& constantName + const word& constantName, + const bool enableFunctionObjects ) : TimePaths @@ -344,7 +347,7 @@ Foam::Time::Time runTimeModifiable_(true), readLibs_(controlDict_, "libs"), - functionObjects_(*this) + functionObjects_(*this, enableFunctionObjects) {} diff --git a/src/OpenFOAM/db/Time/Time.H b/src/OpenFOAM/db/Time/Time.H index 2c6658aed..26909f3b5 100644 --- a/src/OpenFOAM/db/Time/Time.H +++ b/src/OpenFOAM/db/Time/Time.H @@ -187,7 +187,8 @@ public: const fileName& rootPath, const fileName& caseName, const word& systemName = "system", - const word& constantName = "constant" + const word& constantName = "constant", + const bool enableFunctionObjects = true ); //- Construct given dictionary, rootPath and casePath @@ -197,7 +198,8 @@ public: const fileName& rootPath, const fileName& caseName, const word& systemName = "system", - const word& constantName = "constant" + const word& constantName = "constant", + const bool enableFunctionObjects = true ); //- Construct given endTime, rootPath and casePath @@ -206,7 +208,8 @@ public: const fileName& rootPath, const fileName& caseName, const word& systemName = "system", - const word& constantName = "constant" + const word& constantName = "constant", + const bool enableFunctionObjects = true ); diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 26ed4b7a9..9a9fba1a0 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -48,6 +48,7 @@ Foam::argList::initValidTables::initValidTables() validOptions.set("case", "dir"); validOptions.set("parallel", ""); validParOptions.set("parallel", ""); + validOptions.set("noFunctionObjects", ""); Pstream::addValidParOptions(validParOptions); } diff --git a/src/OpenFOAM/include/createTime.H b/src/OpenFOAM/include/createTime.H index 057814a87..18a3d1521 100644 --- a/src/OpenFOAM/include/createTime.H +++ b/src/OpenFOAM/include/createTime.H @@ -8,5 +8,8 @@ ( Foam::Time::controlDictName, args.rootPath(), - args.caseName() + args.caseName(), + "system", + "constant", + !args.optionFound("noFunctionObjects") );