ENH: improved argList handling of libs, functionObjects

- include -no-libs option by default, similar to '-lib',
  which makes it available to all solvers/utilities.
  Add argList allowLibs() method to query it.

- relocate with/no functionObjects logic from Time to argList
  itself as argList allowFunctionObjects()

- add libs/functionObjects override handling to decomposePar etc

ENH: report the stream relativeName for IOerrors (see c9333a5ac8)
This commit is contained in:
Mark Olesen
2022-09-22 10:17:11 +02:00
parent c031f7d00a
commit 88061f3b28
18 changed files with 73 additions and 37 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020-2021 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -65,8 +65,8 @@ int main(int argc, char *argv[])
profiling::disable(); // No profiling output
argList::noBanner();
argList::noParallel();
argList::noFunctionObjects();
argList::removeOption("case");
argList::removeOption("noFunctionObjects");
argList::addBoolOption
(
"or",

View File

@ -1014,7 +1014,9 @@ int main(int argc, char *argv[])
Time::controlDictName,
args.rootPath(),
args.caseName()
/ ("processor" + Foam::name(proci))
/ ("processor" + Foam::name(proci)),
args.allowFunctionObjects(),
args.allowLibs()
)
);
}

View File

@ -244,7 +244,9 @@ int main(int argc, char *argv[])
(
Time::controlDictName,
args.rootPath(),
args.caseName()/("processor" + Foam::name(proci))
args.caseName()/("processor" + Foam::name(proci)),
args.allowFunctionObjects(),
args.allowLibs()
)
);
}

View File

@ -731,7 +731,9 @@ int main(int argc, char *argv[])
(
Time::controlDictName,
args.rootPath(),
args.caseName()/("processor" + Foam::name(proci))
args.caseName()/("processor" + Foam::name(proci)),
args.allowFunctionObjects(),
args.allowLibs()
)
);
}

View File

@ -168,7 +168,6 @@ int main(int argc, char *argv[])
// Less frequently used - reduce some clutter
argList::setAdvanced("decomposeParDict");
argList::setAdvanced("noFunctionObjects");
argList::addVerboseOption("Additional verbosity");

View File

@ -268,7 +268,6 @@ int main(int argc, char *argv[])
// Less frequently used - reduce some clutter
argList::setAdvanced("decomposeParDict");
argList::setAdvanced("noFunctionObjects");
argList::addVerboseOption("Additional verbosity");

View File

@ -87,7 +87,6 @@ int main(int argc, char *argv[])
// Less frequently used - reduce some clutter
argList::setAdvanced("decomposeParDict");
argList::setAdvanced("noFunctionObjects");
argList::addOption
(

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -100,7 +100,9 @@ int main(int argc, char *argv[])
(
Time::controlDictName,
args.rootPath(),
args.caseName()/("processor" + Foam::name(proci))
args.caseName()/("processor" + Foam::name(proci)),
args.allowFunctionObjects(),
args.allowLibs()
)
);
}

View File

@ -56,6 +56,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
// Normally without functionObjects, with -withFunctionObjects to enable
argList::noFunctionObjects(true);
// No -constant, no special treatment for 0/

View File

@ -494,6 +494,7 @@ void evaluate
int main(int argc, char *argv[])
{
// Normally without functionObjects, with -withFunctionObjects to enable
argList::noFunctionObjects(true);
// No -constant, no special treatment for 0/
@ -741,7 +742,7 @@ int main(int argc, char *argv[])
);
}
if (args.found("withFunctionObjects"))
if (args.allowFunctionObjects())
{
runTime.functionObjects().start();
}

View File

@ -120,7 +120,6 @@ int main(int argc, char *argv[])
// Less frequently used - reduce some clutter
argList::setAdvanced("decomposeParDict");
argList::setAdvanced("noFunctionObjects");
argList::addArgument("output", "The output surface file");