mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support 'get()' for retrieving argList options
- previously only had 'opt<..>()' for options, but 'get<..>()' provides more similarity with dictionary methods. The 'opt<..>()' method is retained.
This commit is contained in:
committed by
Andrew Heather
parent
29ccc00c7d
commit
1310e85225
@ -245,7 +245,7 @@ int main(int argc, char *argv[])
|
||||
ensightCase::options caseOpts(format);
|
||||
|
||||
caseOpts.nodeValues(args.found("nodeValues"));
|
||||
caseOpts.width(args.opt<label>("width", 8));
|
||||
caseOpts.width(args.get<label>("width", 8));
|
||||
caseOpts.overwrite(true); // remove existing output directory
|
||||
|
||||
// Can also have separate directory for lagrangian
|
||||
@ -255,7 +255,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.opt<word>("name", "EnSight");
|
||||
fileName outputDir = args.get<word>("name", "EnSight");
|
||||
if (!outputDir.isAbsolute())
|
||||
{
|
||||
outputDir = args.globalPath()/outputDir;
|
||||
|
||||
@ -206,7 +206,7 @@ int main(int argc, char *argv[])
|
||||
//
|
||||
ensightCase::options caseOpts(format);
|
||||
|
||||
caseOpts.width(args.opt<label>("width", 8));
|
||||
caseOpts.width(args.get<label>("width", 8));
|
||||
caseOpts.overwrite(false); // leave existing output directory
|
||||
|
||||
// Can also have separate directory for lagrangian
|
||||
@ -215,7 +215,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.opt<word>("name", "Ensight");
|
||||
fileName ensightDir = args.get<word>("name", "Ensight");
|
||||
if (!ensightDir.isAbsolute())
|
||||
{
|
||||
ensightDir = args.globalPath()/ensightDir;
|
||||
|
||||
@ -637,7 +637,7 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
regionNames.resize(1);
|
||||
regionNames.first() = args.opt<word>("region", fvMesh::defaultRegion);
|
||||
regionNames.first() = args.get<word>("region", fvMesh::defaultRegion);
|
||||
}
|
||||
|
||||
|
||||
@ -699,7 +699,7 @@ int main(int argc, char *argv[])
|
||||
// Directory management
|
||||
|
||||
// Sub-directory for output
|
||||
const word vtkDirName = args.opt<word>("name", "VTK");
|
||||
const word vtkDirName = args.get<word>("name", "VTK");
|
||||
|
||||
const fileName outputDir(args.globalPath()/vtkDirName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user