STYLE: use new argList argRead() method and operator[] for cleaner code.

- deprecate argList::additionalArgs() method and remove uses of it
This commit is contained in:
Mark Olesen
2010-02-16 17:57:49 +01:00
parent 51039eab00
commit d857d671ac
97 changed files with 341 additions and 395 deletions

View File

@ -84,21 +84,20 @@ int main(int argc, char *argv[])
<< " s\n" << endl << endl;
//
// Use boundaryMesh to reuse all the featureEdge stuff in there.
//
const scalar featureAngle = args.argRead<scalar>(1);
const bool overwrite = args.optionFound("overwrite");
boundaryMesh bMesh;
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
const bool overwrite = args.optionFound("overwrite");
scalar minCos = Foam::cos(degToRad(featureAngle));
const scalar minCos = Foam::cos(degToRad(featureAngle));
Info<< "Feature:" << featureAngle << endl
<< "minCos :" << minCos << endl
<< endl;
//
// Use boundaryMesh to reuse all the featureEdge stuff in there.
//
boundaryMesh bMesh;
bMesh.read(mesh);
// Set feature angle (calculate feature edges)

View File

@ -143,7 +143,7 @@ int main(int argc, char *argv[])
const faceZoneMesh& faceZones = mesh.faceZones();
// Faces to baffle
faceZoneID zoneID(args.additionalArgs()[0], faceZones);
faceZoneID zoneID(args[1], faceZones);
Info<< "Converting faces on zone " << zoneID.name()
<< " into baffles." << nl << endl;
@ -168,7 +168,7 @@ int main(int argc, char *argv[])
// Patches to put baffles into
DynamicList<label> newPatches(1);
word patchName(args.additionalArgs()[1]);
const word patchName = args[2];
newPatches.append(findPatchID(mesh, patchName));
Info<< "Using patch " << patchName
<< " at index " << newPatches[0] << endl;

View File

@ -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
@ -47,7 +47,7 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
const scalar scaleFactor = args.argRead<scalar>(1);
# include "createTime.H"
# include "createMesh.H"

View File

@ -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
@ -51,9 +51,8 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createPolyMesh.H"
fileName surfName(args.additionalArgs()[0]);
fileName setName(args.additionalArgs()[1]);
const fileName surfName = args[1];
const fileName setName = args[2];
// Read surface
Info<< "Reading surface from " << surfName << endl;

View File

@ -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

View File

@ -15,13 +15,13 @@
FatalError.exit();
}
fileName rootDirMaster(args.additionalArgs()[0]);
fileName caseDirMaster(args.additionalArgs()[1]);
fileName rootDirMaster = args[1];
fileName caseDirMaster = args[2];
word masterRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("masterRegion", masterRegion);
fileName rootDirToAdd(args.additionalArgs()[2]);
fileName caseDirToAdd(args.additionalArgs()[3]);
fileName rootDirToAdd = args[3];
fileName caseDirToAdd = args[4];
word addRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("addRegion", addRegion);
@ -29,3 +29,4 @@
<< " region " << masterRegion << nl
<< "mesh to add: " << rootDirToAdd << " " << caseDirToAdd
<< " region " << addRegion << endl;

View File

@ -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
@ -116,8 +116,8 @@ int main(int argc, char *argv[])
argList::validArgs.append("output VTK file");
argList::argList args(argc, argv);
fileName objName(args.additionalArgs()[0]);
fileName outName(args.additionalArgs()[1]);
const fileName objName = args[1];
const fileName outName = args[2];
std::ifstream OBJfile(objName.c_str());

View File

@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anispulation |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -75,10 +75,10 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
vector n1(IStringStream(args.additionalArgs()[0])());
vector n1 = args.argRead<vector>(1);
n1 /= mag(n1);
vector n2(IStringStream(args.additionalArgs()[1])());
vector n2 = args.argRead<vector>(2);
n2 /= mag(n2);
tensor T = rotationTensor(n1, n2);

View File

@ -123,10 +123,9 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
word setName(args.additionalArgs()[0]);
word masterPatch(args.additionalArgs()[1]);
word slavePatch(args.additionalArgs()[2]);
const word setName = args[1];
const word masterPatch = args[2];
const word slavePatch = args[3];
const bool overwrite = args.optionFound("overwrite");
// List of faces to split

View File

@ -113,9 +113,8 @@ int main(int argc, char *argv[])
# include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
word masterPatchName(args.additionalArgs()[0]);
word slavePatchName(args.additionalArgs()[1]);
const word masterPatchName = args[1];
const word slavePatchName = args[2];
const bool partialCover = args.optionFound("partial");
const bool perfectCover = args.optionFound("perfect");

View File

@ -161,7 +161,7 @@ int main(int argc, char *argv[])
# include "createMesh.H"
const word oldInstance = mesh.pointsInstance();
word setName(args.additionalArgs()[0]);
const word setName = args[1];
const bool overwrite = args.optionFound("overwrite");