mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use the more succinct forms for argList (issue #307)
* args[int] vs args.args()[int] * args[word] vs args.options()[word] etc.
This commit is contained in:
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
const Switch inflate(args.args()[1]);
|
const Switch inflate(args[1]);
|
||||||
|
|
||||||
if (inflate)
|
if (inflate)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh));
|
const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh));
|
||||||
|
|
||||||
const Switch inflate(args.args()[1]);
|
const Switch inflate(args[1]);
|
||||||
|
|
||||||
if (inflate)
|
if (inflate)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createNamedMesh.H"
|
#include "createNamedMesh.H"
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
word cellSetName(args.args()[1]);
|
word cellSetName(args[1]);
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.optionFound("overwrite");
|
||||||
|
|
||||||
const bool minSet = args.optionFound("minSet");
|
const bool minSet = args.optionFound("minSet");
|
||||||
|
|||||||
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
std::ifstream plot3dFile(args.args()[1].c_str());
|
std::ifstream plot3dFile(args[1].c_str());
|
||||||
|
|
||||||
string line;
|
string line;
|
||||||
std::getline(plot3dFile, line);
|
std::getline(plot3dFile, line);
|
||||||
|
|||||||
@ -811,7 +811,7 @@ int main(int argc, char *argv[])
|
|||||||
args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
|
args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
|
||||||
args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
|
args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
|
||||||
|
|
||||||
cubitFile = args.options().found("cubit");
|
cubitFile = args.optionFound("cubit");
|
||||||
|
|
||||||
if (cubitFile)
|
if (cubitFile)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -374,7 +374,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const fileName exportName = args.args()[1];
|
const fileName exportName = args[1];
|
||||||
|
|
||||||
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
|
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
|
||||||
<< " writing a re-sampled surface to " << exportName
|
<< " writing a re-sampled surface to " << exportName
|
||||||
|
|||||||
@ -36,6 +36,7 @@ Description
|
|||||||
#include "searchableSurfaces.H"
|
#include "searchableSurfaces.H"
|
||||||
#include "conformationSurfaces.H"
|
#include "conformationSurfaces.H"
|
||||||
#include "triSurfaceMesh.H"
|
#include "triSurfaceMesh.H"
|
||||||
|
#include "labelVector.H"
|
||||||
|
|
||||||
#include "MarchingCubes.h"
|
#include "MarchingCubes.h"
|
||||||
|
|
||||||
@ -52,7 +53,6 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"Re-sample surfaces used in foamyHexMesh operation"
|
"Re-sample surfaces used in foamyHexMesh operation"
|
||||||
);
|
);
|
||||||
//argList::validArgs.append("inputFile");
|
|
||||||
argList::validArgs.append("(nx ny nz)");
|
argList::validArgs.append("(nx ny nz)");
|
||||||
argList::validArgs.append("outputName");
|
argList::validArgs.append("outputName");
|
||||||
|
|
||||||
@ -60,8 +60,8 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const Vector<label> n(IStringStream(args.args()[1])());
|
const labelVector n(args.argRead<labelVector>(1));
|
||||||
const fileName exportName = args.args()[2];
|
const fileName exportName = args[2];
|
||||||
|
|
||||||
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
|
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
|
||||||
<< " writing re-sampled " << n << " to " << exportName
|
<< " writing re-sampled " << n << " to " << exportName
|
||||||
|
|||||||
@ -93,10 +93,9 @@ int main(int argc, char *argv[])
|
|||||||
// ~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
CV2D mesh(runTime, controlDict);
|
CV2D mesh(runTime, controlDict);
|
||||||
|
|
||||||
if (args.options().found("pointsFile"))
|
if (args.optionFound("pointsFile"))
|
||||||
{
|
{
|
||||||
fileName pointFileName(IStringStream(args.options()["pointsFile"])());
|
mesh.insertPoints(args["pointsFile"]);
|
||||||
mesh.insertPoints(pointFileName);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -297,13 +297,13 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// set up the tolerances for the sliding mesh
|
// set up the tolerances for the sliding mesh
|
||||||
dictionary slidingTolerances;
|
dictionary slidingTolerances;
|
||||||
if (args.options().found("toleranceDict"))
|
if (args.optionFound("toleranceDict"))
|
||||||
{
|
{
|
||||||
IOdictionary toleranceFile
|
IOdictionary toleranceFile
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
args.options()["toleranceDict"],
|
args["toleranceDict"],
|
||||||
runTime.constant(),
|
runTime.constant(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
|||||||
@ -1558,12 +1558,14 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
word action(args.args()[1]);
|
const word action(args[1]);
|
||||||
|
|
||||||
HashTable<booleanSurface::booleanOpType> validActions;
|
const HashTable<booleanSurface::booleanOpType> validActions
|
||||||
validActions.insert("intersection", booleanSurface::INTERSECTION);
|
{
|
||||||
validActions.insert("union", booleanSurface::UNION);
|
{"intersection", booleanSurface::INTERSECTION},
|
||||||
validActions.insert("difference", booleanSurface::DIFFERENCE);
|
{"union", booleanSurface::UNION},
|
||||||
|
{"difference", booleanSurface::DIFFERENCE}
|
||||||
|
};
|
||||||
|
|
||||||
if (!validActions.found(action))
|
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;
|
Info<< "Reading surface " << surf1Name << endl;
|
||||||
triSurfaceMesh surf1
|
triSurfaceMesh surf1
|
||||||
(
|
(
|
||||||
|
|||||||
@ -605,7 +605,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const word inputName(args.args()[1]);
|
const word inputName(args[1]);
|
||||||
const scalar distance(args.argRead<scalar>(2));
|
const scalar distance(args.argRead<scalar>(2));
|
||||||
const scalar extendFactor(args.argRead<scalar>(3));
|
const scalar extendFactor(args.argRead<scalar>(3));
|
||||||
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
|
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
|
||||||
|
|||||||
Reference in New Issue
Block a user