mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: provide operator[] for accessing argList options.
- operator[] with label -> get args at index - operator[] with word -> get named option
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -80,7 +80,10 @@ Foam::ensightMesh::ensightMesh
|
||||
|
||||
if (args.optionFound("patches"))
|
||||
{
|
||||
wordList patchNameList(args.optionLookup("patches")());
|
||||
wordList patchNameList
|
||||
(
|
||||
args.optionLookup("patches")()
|
||||
);
|
||||
|
||||
if (patchNameList.empty())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -215,9 +215,8 @@ int main(int argc, char *argv[])
|
||||
word cellSetName;
|
||||
string vtkName;
|
||||
|
||||
if (args.optionFound("cellSet"))
|
||||
if (args.optionReadIfPresent("cellSet", cellSetName))
|
||||
{
|
||||
cellSetName = args.option("cellSet");
|
||||
vtkName = cellSetName;
|
||||
}
|
||||
else if (Pstream::parRun())
|
||||
@ -738,7 +737,7 @@ int main(int argc, char *argv[])
|
||||
if (args.optionFound("faceSet"))
|
||||
{
|
||||
// Load the faceSet
|
||||
word setName(args.option("faceSet"));
|
||||
const word setName = args["faceSet"];
|
||||
labelList faceLabels(faceSet(mesh, setName).toc());
|
||||
|
||||
// Filename as if patch with same name.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -329,9 +329,8 @@ int main(int argc, char *argv[])
|
||||
word cellSetName;
|
||||
string vtkName = runTime.caseName();
|
||||
|
||||
if (args.optionFound("cellSet"))
|
||||
if (args.optionReadIfPresent("cellSet", cellSetName))
|
||||
{
|
||||
cellSetName = args.option("cellSet");
|
||||
vtkName = cellSetName;
|
||||
}
|
||||
else if (Pstream::parRun())
|
||||
@ -423,7 +422,7 @@ int main(int argc, char *argv[])
|
||||
if (args.optionFound("faceSet"))
|
||||
{
|
||||
// Load the faceSet
|
||||
faceSet set(mesh, args.option("faceSet"));
|
||||
faceSet set(mesh, args["faceSet"]);
|
||||
|
||||
// Filename as if patch with same name.
|
||||
mkDir(fvPath/set.name());
|
||||
@ -446,7 +445,7 @@ int main(int argc, char *argv[])
|
||||
if (args.optionFound("pointSet"))
|
||||
{
|
||||
// Load the pointSet
|
||||
pointSet set(mesh, args.option("pointSet"));
|
||||
pointSet set(mesh, args["pointSet"]);
|
||||
|
||||
// Filename as if patch with same name.
|
||||
mkDir(fvPath/set.name());
|
||||
|
||||
Reference in New Issue
Block a user