Commit 95e7faf3 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: use the more succinct forms for argList (issue #307)

  * args[int]   vs  args.args()[int]
  * args[word]  vs  args.options()[word]
  etc.
parent 7b9fde84
......@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
const Switch inflate(args.args()[1]);
const Switch inflate(args[1]);
if (inflate)
{
......
......@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh));
const Switch inflate(args.args()[1]);
const Switch inflate(args[1]);
if (inflate)
{
......
......@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
word cellSetName(args.args()[1]);
word cellSetName(args[1]);
const bool overwrite = args.optionFound("overwrite");
const bool minSet = args.optionFound("minSet");
......
......@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
std::ifstream plot3dFile(args.args()[1].c_str());
std::ifstream plot3dFile(args[1].c_str());
string line;
std::getline(plot3dFile, line);
......
......@@ -811,7 +811,7 @@ int main(int argc, char *argv[])
args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
cubitFile = args.options().found("cubit");
cubitFile = args.optionFound("cubit");
if (cubitFile)
{
......
......@@ -374,7 +374,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
runTime.functionObjects().off();
const fileName exportName = args.args()[1];
const fileName exportName = args[1];
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
<< " writing a re-sampled surface to " << exportName
......
......@@ -36,6 +36,7 @@ Description
#include "searchableSurfaces.H"
#include "conformationSurfaces.H"
#include "triSurfaceMesh.H"
#include "labelVector.H"
#include "MarchingCubes.h"
......@@ -52,7 +53,6 @@ int main(int argc, char *argv[])
(
"Re-sample surfaces used in foamyHexMesh operation"
);
//argList::validArgs.append("inputFile");
argList::validArgs.append("(nx ny nz)");
argList::validArgs.append("outputName");
......@@ -60,8 +60,8 @@ int main(int argc, char *argv[])
#include "createTime.H"
runTime.functionObjects().off();
const Vector<label> n(IStringStream(args.args()[1])());
const fileName exportName = args.args()[2];
const labelVector n(args.argRead<labelVector>(1));
const fileName exportName = args[2];
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
<< " writing re-sampled " << n << " to " << exportName
......
......@@ -93,10 +93,9 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~~~~~~~~~~~~~
CV2D mesh(runTime, controlDict);
if (args.options().found("pointsFile"))
if (args.optionFound("pointsFile"))
{
fileName pointFileName(IStringStream(args.options()["pointsFile"])());
mesh.insertPoints(pointFileName);
mesh.insertPoints(args["pointsFile"]);
}
else
{
......
......@@ -297,13 +297,13 @@ int main(int argc, char *argv[])
// set up the tolerances for the sliding mesh
dictionary slidingTolerances;
if (args.options().found("toleranceDict"))
if (args.optionFound("toleranceDict"))
{
IOdictionary toleranceFile
(
IOobject
(
args.options()["toleranceDict"],
args["toleranceDict"],
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
......
......@@ -1558,12 +1558,14 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
word action(args.args()[1]);
const word action(args[1]);
HashTable<booleanSurface::booleanOpType> validActions;
validActions.insert("intersection", booleanSurface::INTERSECTION);
validActions.insert("union", booleanSurface::UNION);
validActions.insert("difference", booleanSurface::DIFFERENCE);
const HashTable<booleanSurface::booleanOpType> validActions
{
{"intersection", booleanSurface::INTERSECTION},
{"union", booleanSurface::UNION},
{"difference", booleanSurface::DIFFERENCE}
};
if (!validActions.found(action))
{
......@@ -1580,7 +1582,7 @@ int main(int argc, char *argv[])
}
const word surf1Name(args.args()[2]);
const word surf1Name(args[2]);
Info<< "Reading surface " << surf1Name << endl;
triSurfaceMesh surf1
(
......
......@@ -605,7 +605,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
runTime.functionObjects().off();
const word inputName(args.args()[1]);
const word inputName(args[1]);
const scalar distance(args.argRead<scalar>(2));
const scalar extendFactor(args.argRead<scalar>(3));
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment