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:
Mark Olesen
2018-01-08 15:35:18 +01:00
parent 2feb11dbeb
commit 345a2a42f1
168 changed files with 1161 additions and 1040 deletions

View File

@ -53,7 +53,7 @@ int readNumProcs
{
const word dictName = "decomposeParDict";
fileName dictFile;
if (args.optionReadIfPresent(optionName, dictFile) && isDir(dictFile))
if (args.readIfPresent(optionName, dictFile) && isDir(dictFile))
{
dictFile = dictFile / dictName;
}
@ -296,7 +296,7 @@ int main(int argc, char *argv[])
Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
word sourceRegion = fvMesh::defaultRegion;
if (args.optionFound("sourceRegion"))
if (args.found("sourceRegion"))
{
sourceRegion = args["sourceRegion"];
Info<< "Source region: " << sourceRegion << endl;
@ -304,18 +304,18 @@ int main(int argc, char *argv[])
Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
word targetRegion = fvMesh::defaultRegion;
if (args.optionFound("targetRegion"))
if (args.found("targetRegion"))
{
targetRegion = args["targetRegion"];
Info<< "Target region: " << targetRegion << endl;
}
const bool parallelSource = args.optionFound("parallelSource");
const bool parallelTarget = args.optionFound("parallelTarget");
const bool consistent = args.optionFound("consistent");
const bool parallelSource = args.found("parallelSource");
const bool parallelTarget = args.found("parallelTarget");
const bool consistent = args.found("consistent");
meshToMesh0::order mapOrder = meshToMesh0::INTERPOLATE;
if (args.optionFound("mapMethod"))
if (args.found("mapMethod"))
{
const word mapMethod(args["mapMethod"]);
if (mapMethod == "mapNearest")
@ -341,7 +341,7 @@ int main(int argc, char *argv[])
Info<< "Mapping method: " << mapMethod << endl;
}
const bool subtract = args.optionFound("subtract");
const bool subtract = args.found("subtract");
if (subtract)
{
Info<< "Subtracting mapped source field from target" << endl;