Commit e0f83938 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: ignore -noFunctionObjects option when disabled

- With argList::noFunctionObjects() we use the logic added in
  4b933332 (issue #352)

  By removing the '-noFunctionObjects' option, we automatically
  suppress the creation of function-objects via Time (with argList
  as a parameter).
  There is generally no need in these cases for an additional

      runTime.functionObjects().off()  statement

  Use the argList::noFunctionObjects() for more direct configuration
  and reduce unnecessary clutter in the -help information.

  In previous versions, the -noFunctionObjects would have been redundant
  anyhow, so we can also just ignore it now instead.
parent 822acaf6
......@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
argList::addBoolOption
(
"withFunctionObjects",
"execute functionObjects"
"Execute functionObjects"
);
#include "setRootCase.H"
......
......@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
argList::addBoolOption
(
"withFunctionObjects",
"execute functionObjects"
"Execute functionObjects"
);
#include "addCheckCaseOptions.H"
......
......@@ -37,10 +37,12 @@ Description
int main(int argc, char *argv[])
{
argList::addArgument("cloud");
argList::noFunctionObjects();
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
runTime.functionObjects().off();
const word cloudName = args[1];
......
......@@ -623,9 +623,11 @@ label findPatch(const polyBoundaryMesh& patches, const word& patchName)
int main(int argc, char *argv[])
{
#include "addOverwriteOption.H"
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createNamedMesh.H"
// Read control dictionary
......
......@@ -85,10 +85,12 @@ int main(int argc, char *argv[])
#include "addDictOption.H"
#include "addOverwriteOption.H"
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
instantList timeDirs = timeSelector::selectIfPresent(runTime, args);
#include "createNamedMesh.H"
......
......@@ -358,10 +358,12 @@ int main(int argc, char *argv[])
"Read user-defined mesh quality criterions from system/meshQualityDict"
);
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const scalar featureAngle = args.read<scalar>(1);
......
......@@ -339,10 +339,12 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H"
#include "addDictOption.H"
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const bool overwrite = args.found("overwrite");
......
......@@ -66,10 +66,12 @@ int main(int argc, char *argv[])
" (default is to extend set)"
);
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
word cellSetName(args[1]);
......
......@@ -72,12 +72,12 @@ int main(int argc, char *argv[])
"Restrict cells to refine based on specified cellSet name"
);
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
// Find set of patches from the list of regular expressions provided
......
......@@ -56,10 +56,12 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H"
argList::addArgument("faceSet");
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
const word setName = args[1];
......
......@@ -548,10 +548,12 @@ int main(int argc, char *argv[])
"Edge snap tolerance (default 0.2)"
);
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const scalar featureAngle = args.read<scalar>(1);
......
......@@ -156,9 +156,12 @@ int main(int argc, char *argv[])
"The default is to remove them."
);
argList::noFunctionObjects(); // Never use function objects
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
runTime.functionObjects().off();
runTime.functionObjects().off(); // Extra safety
const bool optList = args.found("list");
......
......@@ -116,11 +116,12 @@ int main(int argc, char *argv[])
"Convert results only"
);
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
// get times list
// The times list
instantList timeDirs = Foam::timeSelector::select0(runTime, args);
const bool optMesh = args.found("mesh");
......
......@@ -422,9 +422,10 @@ int main(int argc, char *argv[])
);
#include "addRegionOption.H"
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
const bool patchFaces = args.found("patchFaces");
const bool patchEdges = args.found("patchEdges");
......
......@@ -114,6 +114,8 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H"
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
Info<< "Create time\n" << endl;
......@@ -125,6 +127,7 @@ int main(int argc, char *argv[])
args.caseName()
);
// For safety
runTimeExtruded.functionObjects().off();
const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
......@@ -301,7 +304,7 @@ int main(int argc, char *argv[])
if (!overwrite)
{
runTimeExtruded++;
++runTimeExtruded;
}
else
{
......
......@@ -57,11 +57,11 @@ int main(int argc, char *argv[])
"Conform to the initial points without any point motion"
);
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
const bool checkGeometry = args.found("checkGeometry");
const bool conformationOnly = args.found("conformationOnly");
......
......@@ -396,9 +396,10 @@ int main(int argc, char *argv[])
"The merge distance relative to the bounding box size (default 1e-6)"
);
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
const bool writeMesh = args.found("writeMesh");
......
......@@ -368,11 +368,13 @@ int main(int argc, char *argv[])
(
"Re-sample surfaces used in foamyHexMesh operation"
);
argList::addArgument("outputName");
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
const fileName exportName = args[1];
......
......@@ -56,9 +56,10 @@ int main(int argc, char *argv[])
argList::addArgument("(nx ny nz)");
argList::addArgument("outputName");
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
const labelVector n(args.read<labelVector>(1));
const fileName exportName = args[2];
......
......@@ -710,9 +710,10 @@ int main(int argc, char *argv[])
#include "addProfilingOption.H"
#include "addDictOption.H"
argList::noFunctionObjects(); // Never use function objects
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
const bool overwrite = args.found("overwrite");
const bool checkGeometry = args.found("checkGeometry");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment