mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: simplify method names for reading argList options and arguments
- use succincter method names that more closely resemble dictionary
and HashTable method names. This improves method name consistency
between classes and also requires less typing effort:
args.found(optName) vs. args.optionFound(optName)
args.readIfPresent(..) vs. args.optionReadIfPresent(..)
...
args.opt<scalar>(optName) vs. args.optionRead<scalar>(optName)
args.read<scalar>(index) vs. args.argRead<scalar>(index)
- the older method names forms have been retained for code compatibility,
but are now deprecated
This commit is contained in:
@ -148,7 +148,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<coordinateSystem> fromCsys;
|
||||
autoPtr<coordinateSystem> toCsys;
|
||||
|
||||
if (args.optionFound("from") || args.optionFound("to"))
|
||||
if (args.found("from") || args.found("to"))
|
||||
{
|
||||
autoPtr<IOobject> csDictIoPtr;
|
||||
|
||||
@ -158,7 +158,7 @@ int main(int argc, char *argv[])
|
||||
// is in constant
|
||||
|
||||
fileName dictPath;
|
||||
if (args.optionReadIfPresent("dict", dictPath) && isDir(dictPath))
|
||||
if (args.readIfPresent("dict", dictPath) && isDir(dictPath))
|
||||
{
|
||||
dictPath = dictPath / dictName;
|
||||
}
|
||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
coordinateSystems csLst(csDictIoPtr());
|
||||
|
||||
if (args.optionFound("from"))
|
||||
if (args.found("from"))
|
||||
{
|
||||
const word csName = args["from"];
|
||||
|
||||
@ -220,7 +220,7 @@ int main(int argc, char *argv[])
|
||||
fromCsys.reset(new coordinateSystem(csLst[csIndex]));
|
||||
}
|
||||
|
||||
if (args.optionFound("to"))
|
||||
if (args.found("to"))
|
||||
{
|
||||
const word csName = args["to"];
|
||||
|
||||
@ -250,13 +250,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
MeshedSurface<face> surf(importName);
|
||||
|
||||
if (args.optionFound("clean"))
|
||||
if (args.found("clean"))
|
||||
{
|
||||
surf.cleanup(true);
|
||||
}
|
||||
|
||||
scalar scaleIn = 0;
|
||||
if (args.optionReadIfPresent("scaleIn", scaleIn) && scaleIn > 0)
|
||||
if (args.readIfPresent("scaleIn", scaleIn) && scaleIn > 0)
|
||||
{
|
||||
Info<< " -scaleIn " << scaleIn << endl;
|
||||
surf.scalePoints(scaleIn);
|
||||
@ -278,13 +278,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
scalar scaleOut = 0;
|
||||
if (args.optionReadIfPresent("scaleOut", scaleOut) && scaleOut > 0)
|
||||
if (args.readIfPresent("scaleOut", scaleOut) && scaleOut > 0)
|
||||
{
|
||||
Info<< " -scaleOut " << scaleOut << endl;
|
||||
surf.scalePoints(scaleOut);
|
||||
}
|
||||
|
||||
if (args.optionFound("tri"))
|
||||
if (args.found("tri"))
|
||||
{
|
||||
Info<< "triangulate" << endl;
|
||||
surf.triangulate();
|
||||
|
||||
Reference in New Issue
Block a user