STYLE: argList::opt method instead of the longer argList::lookupOrDefault

- also replaced a few instances of readIfPresent with opt<> for
  constant values.
This commit is contained in:
Mark Olesen
2018-12-12 12:10:39 +01:00
parent f38190213c
commit 29a5793b5b
70 changed files with 112 additions and 148 deletions

View File

@ -237,7 +237,7 @@ int main(int argc, char *argv[])
ensightCase::options caseOpts(format);
caseOpts.nodeValues(args.found("nodeValues"));
caseOpts.width(args.lookupOrDefault<label>("width", 8));
caseOpts.width(args.opt<label>("width", 8));
caseOpts.overwrite(true); // remove existing output directory
// Can also have separate directory for lagrangian
@ -247,7 +247,7 @@ int main(int argc, char *argv[])
// Define sub-directory name to use for EnSight data.
// The path to the ensight directory is at case level only
// - For parallel cases, data only written from master
fileName outputDir = args.lookupOrDefault<word>("name", "EnSight");
fileName outputDir = args.opt<word>("name", "EnSight");
if (!outputDir.isAbsolute())
{
outputDir = args.globalPath()/outputDir;

View File

@ -203,7 +203,7 @@ int main(int argc, char *argv[])
//
ensightCase::options caseOpts(format);
caseOpts.width(args.lookupOrDefault<label>("width", 8));
caseOpts.width(args.opt<label>("width", 8));
caseOpts.overwrite(false); // leave existing output directory
// Can also have separate directory for lagrangian
@ -212,7 +212,7 @@ int main(int argc, char *argv[])
// Define sub-directory name to use for EnSight data.
// The path to the ensight directory is at case level only
// - For parallel cases, data only written from master
fileName ensightDir = args.lookupOrDefault<word>("name", "Ensight");
fileName ensightDir = args.opt<word>("name", "Ensight");
if (!ensightDir.isAbsolute())
{
ensightDir = args.globalPath()/ensightDir;

View File

@ -564,8 +564,7 @@ int main(int argc, char *argv[])
else
{
regionNames.resize(1);
regionNames.first() =
args.lookupOrDefault<word>("region", fvMesh::defaultRegion);
regionNames.first() = args.opt<word>("region", fvMesh::defaultRegion);
}
@ -627,7 +626,7 @@ int main(int argc, char *argv[])
// Directory management
// Sub-directory for output
const word vtkDirName = args.lookupOrDefault<word>("name", "VTK");
const word vtkDirName = args.opt<word>("name", "VTK");
const fileName outputDir(runTime.globalPath()/vtkDirName);