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

@ -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
@ -109,10 +109,8 @@ int main(int argc, char *argv[])
argList::validArgs.append("ODESolver");
argList args(argc, argv);
word ODESolverName(args.additionalArgs()[0]);
testODE ode;
autoPtr<ODESolver> odeSolver = ODESolver::New(ODESolverName, ode);
autoPtr<ODESolver> odeSolver = ODESolver::New(args[1], ode);
scalar xStart = 1.0;
scalarField yStart(ode.nEqns());

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
@ -130,15 +130,15 @@ int main(int argc, char *argv[])
return 0;
}
else if (args.additionalArgs().empty())
else if (args.size() <= 1)
{
args.printUsage();
}
forAll(args.additionalArgs(), argI)
for (label argI=1; argI < args.size(); ++argI)
{
const string& srcFile = args.additionalArgs()[argI];
const string& srcFile = args[argI];
Info<< nl << "reading " << srcFile << nl;
IFstream ifs(srcFile);

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,7 +51,7 @@ int main(int argc, char *argv[])
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
<< endl;
if (args.additionalArgs().empty())
if (args.size() <= 1)
{
{
dictionary dict1(IFstream("testDict")());
@ -114,9 +114,9 @@ int main(int argc, char *argv[])
else
{
IOobject::writeDivider(Info);
forAll(args.additionalArgs(), argI)
for (label argI=1; argI < args.size(); ++argI)
{
const string& dictFile = args.additionalArgs()[argI];
const string& dictFile = args[argI];
IFstream is(dictFile);
dictionary dict(is);

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) 2009-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
argList args(argc, argv, false, true);
if (args.additionalArgs().empty() && args.options().empty())
if (args.size() <= 1 && args.options().empty())
{
args.printUsage();
}
@ -90,9 +90,9 @@ int main(int argc, char *argv[])
printCleaning(pathName);
}
forAll(args.additionalArgs(), argI)
for (label argI=1; argI < args.size(); ++argI)
{
pathName = args.additionalArgs()[argI];
pathName = args[argI];
printCleaning(pathName);
}

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
@ -45,7 +45,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createMesh.H"
point sample(IStringStream(args.additionalArgs()[0])());
const point sample = args.argRead<point>(1);
treeBoundBox meshBb(mesh.points());
@ -82,8 +82,8 @@ int main(int argc, char *argv[])
);
Info<< "Point:" << sample << " is in shape "
<< oc.find(sample) << endl;
Info<< "Point:" << sample << " is in cell "
<< oc.find(sample) << nl
<< "Point:" << sample << " is in cell "
<< mesh.findCell(sample) << 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) 2009-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,16 +45,16 @@ int main(int argc, char *argv[])
argList args(argc, argv, false, true);
if (args.additionalArgs().empty())
if (args.size() <= 1)
{
args.printUsage();
}
label ok = 0;
forAll(args.additionalArgs(), argI)
for (label argI=1; argI < args.size(); ++argI)
{
const string& srcFile = args.additionalArgs()[argI];
const string& srcFile = args[argI];
if (args.optionFound("ext"))
{
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
}
}
Info<< "mvBak called for " << args.additionalArgs().size()
Info<< "mvBak called for " << args.size()-1
<< " files (moved " << ok << ")\n" << endl;
return 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,7 +43,7 @@ int main(int argc, char *argv[])
#include "createMesh.H"
runTime.functionObjects().off();
const word cloudName(args.additionalArgs()[0]);
const word cloudName = args[1];
{
// Start with empty cloud

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
@ -221,7 +221,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createPolyMesh.H"
word patchName(args.additionalArgs()[0]);
const word patchName = args[1];
label patchI = mesh.boundaryMesh().findPatchID(patchName);

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
@ -42,20 +42,15 @@ int main(int argc, char *argv[])
argList args(argc, argv);
fileName thermoFileName = fileName::null;
if (args.options().found("thermo"))
{
thermoFileName = args.options()["thermo"];
}
args.optionReadIfPresent("thermo", thermoFileName);
fileName CHEMKINFileName(args.additionalArgs()[0]);
chemkinReader ck(args[1], thermoFileName);
chemkinReader ck(CHEMKINFileName, thermoFileName);
//Info<< ck.isotopeAtomicWts() << endl;
//Info<< ck.specieNames() << endl;
//Info<< ck.speciePhase() << endl;
//Info<< ck.specieThermo() << endl;
//Info<< ck.reactions() << endl;
//Info<< ck.isotopeAtomicWts() << nl
// << ck.specieNames() << nl
// << ck.speciePhase() << nl
// << ck.specieThermo() << nl
// << ck.reactions() << endl;
const SLPtrList<gasReaction>& reactions = ck.reactions();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
argList args(argc, argv, false, true);
if (args.additionalArgs().empty())
if (args.size() <= 1)
{
args.printUsage();
}
@ -73,9 +73,9 @@ int main(int argc, char *argv[])
useCatmullRom = true;
}
forAll(args.additionalArgs(), argI)
for (label argI=1; argI < args.size(); ++argI)
{
const string& srcFile = args.additionalArgs()[argI];
const string& srcFile = args[argI];
Info<< nl << "reading " << srcFile << nl;
IFstream ifs(srcFile);

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,7 +51,7 @@ int main(int argc, char *argv[])
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Get name of patch
word patchName(args.additionalArgs()[0]);
const word patchName = args[1];
// Find the label in patches by name.
label patchI = patches.findPatchID(patchName);

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
@ -54,9 +54,9 @@ int main(int argc, char *argv[])
cpuTime timer;
for (label count = 0; count < repeat; ++count)
{
forAll(args.additionalArgs(), argI)
for (label argI=1; argI < args.size(); ++argI)
{
const string& rawArg = args.additionalArgs()[argI];
const string& rawArg = args[argI];
if (count == 0)
{
Info<< "input string: " << rawArg << nl;

View File

@ -464,8 +464,8 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
const scalar minLen = args.argRead<scalar>(1);
const scalar angle = args.argRead<scalar>(2);
const bool overwrite = args.optionFound("overwrite");
scalar maxCos = Foam::cos(degToRad(angle));

View File

@ -446,14 +446,12 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar minCos = Foam::cos(degToRad(featureAngle));
const scalar featureAngle = args.argRead<scalar>(1);
const scalar minCos = Foam::cos(degToRad(featureAngle));
// Sin of angle between two consecutive edges on a face.
// If sin(angle) larger than this the face will be considered concave.
scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0);
scalar concaveSin = Foam::sin(degToRad(concaveAngle));
const bool snapMeshDict = args.optionFound("snapMesh");

View File

@ -60,12 +60,10 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
word patchName(args.additionalArgs()[0]);
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
const word patchName = args[1];
const scalar weight = args.argRead<scalar>(2);
const bool overwrite = args.optionFound("overwrite");
label patchID = mesh.boundaryMesh().findPatchID(patchName);
if (patchID == -1)

View File

@ -57,10 +57,9 @@ int main(int argc, char *argv[])
# include "createMesh.H"
const word oldInstance = mesh.pointsInstance();
const word setName = args[1];
const bool overwrite = args.optionFound("overwrite");
word setName(args.additionalArgs()[0]);
// Read faces
faceSet candidateSet(mesh, setName);

View File

@ -537,10 +537,9 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar minCos = Foam::cos(degToRad(featureAngle));
scalar minSin = Foam::sin(degToRad(featureAngle));
const scalar featureAngle = args.argRead<scalar>(1);
const scalar minCos = Foam::cos(degToRad(featureAngle));
const scalar minSin = Foam::sin(degToRad(featureAngle));
const bool readSet = args.optionFound("set");
const bool geometry = args.optionFound("geometry");

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
@ -615,7 +615,7 @@ int main(int argc, char *argv[])
wordList foamPatchNames;
{
fileName ccmFile(args.additionalArgs()[0]);
const fileName ccmFile = args[1];
if (!isFile(ccmFile))
{

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
@ -26,7 +26,8 @@ Application
ansysToFoam
Description
Converts an ANSYS input mesh file, exported from I-DEAS, to FOAM format.
Converts an ANSYS input mesh file, exported from I-DEAS,
to OpenFOAM format.
\*---------------------------------------------------------------------------*/
@ -252,7 +253,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
fileName ansysFile(args.additionalArgs()[0]);
const fileName ansysFile = args[1];
ifstream ansysStream(ansysFile.c_str());
if (!ansysStream)

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
@ -26,7 +26,7 @@ Application
cfx4ToFoam
Description
Converts a CFX 4 mesh to FOAM format
Converts a CFX 4 mesh to OpenFOAM format
\*---------------------------------------------------------------------------*/
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
IFstream cfxFile(args.additionalArgs()[0]);
IFstream cfxFile(args[1]);
// Read the cfx information using a fixed format reader.
// Comments in the file are in C++ style, so the stream parser will remove
@ -603,7 +603,7 @@ int main(int argc, char *argv[])
Info<< "CFX patch " << patchI
<< ", of type " << cfxPatchTypes[patchI]
<< ", name " << cfxPatchNames[patchI]
<< " already exists as FOAM patch " << existingPatch
<< " already exists as OpenFOAM patch " << existingPatch
<< ". Adding faces." << endl;
faceList& renumberedPatch = boundary[existingPatch];
@ -655,7 +655,7 @@ int main(int argc, char *argv[])
Info<< "CFX patch " << patchI
<< ", of type " << cfxPatchTypes[patchI]
<< ", name " << cfxPatchNames[patchI]
<< " converted into FOAM patch " << nCreatedPatches
<< " converted into OpenFOAM patch " << nCreatedPatches
<< " type ";
if (cfxPatchTypes[patchI] == "WALL")

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
@ -795,7 +795,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
fileName fluentFile(args.additionalArgs()[0]);
const fileName fluentFile = args[1];
IFstream fluentStream(fluentFile);
if (!fluentStream)

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
@ -26,7 +26,7 @@ Application
fluentMeshToFoam
Description
Converts a Fluent mesh to FOAM format
Converts a Fluent mesh to OpenFOAM format
including multiple region and region boundary handling.
\*---------------------------------------------------------------------------*/
@ -881,12 +881,12 @@ int main(int argc, char *argv[])
scalar scaleFactor = 1.0;
args.optionReadIfPresent("scale", scaleFactor);
bool writeSets = args.optionFound("writeSets");
bool writeZones = args.optionFound("writeZones");
const bool writeSets = args.optionFound("writeSets");
const bool writeZones = args.optionFound("writeZones");
# include "createTime.H"
fileName fluentFile(args.additionalArgs()[0]);
const fileName fluentFile = args[1];
std::ifstream fluentStream(fluentFile.c_str());
if (!fluentStream)

View File

@ -199,7 +199,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
fluentMeshFile << l.size() << " ";
// Note: In Fluent, all boundary faces point inwards, which is
// opposite from the FOAM convention. Turn them round on printout
// opposite from the OpenFOAM convention.
// Turn them around on printout
forAllReverse (l, lI)
{
fluentMeshFile << l[lI] + 1 << " ";

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Writes out the FOAM mesh in Fluent mesh format.
Writes out the OpenFOAM mesh in Fluent mesh format.
\*---------------------------------------------------------------------------*/

View File

@ -73,14 +73,12 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
const stringList& params = args.additionalArgs();
fileName exportName = args[1];
scalar scaleFactor = 0;
args.optionReadIfPresent<scalar>("scale", scaleFactor);
const bool doTriangulate = args.optionFound("tri");
fileName exportName(params[0]);
fileName exportBase = exportName.lessExt();
word exportExt = exportName.ext();

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
@ -26,7 +26,7 @@ Application
gambitToFoam
Description
Converts a GAMBIT mesh to FOAM format.
Converts a GAMBIT mesh to OpenFOAM format.
\*---------------------------------------------------------------------------*/
@ -653,7 +653,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
fileName gambitFile(args.additionalArgs()[0]);
const fileName gambitFile = args[1];
ifstream gambitStream(gambitFile.c_str());
if (!gambitStream)

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
@ -722,9 +722,8 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
fileName mshName(args.additionalArgs()[0]);
bool keepOrientation = args.optionFound("keepOrientation");
const bool keepOrientation = args.optionFound("keepOrientation");
IFstream inFile(args[1]);
// Storage for points
pointField points;
@ -749,9 +748,6 @@ int main(int argc, char *argv[])
// Version 1 or 2 format
bool version2Format = false;
IFstream inFile(mshName);
while (inFile.good())
{
string line;

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
@ -595,9 +595,8 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
fileName ideasName(args.additionalArgs()[0]);
IFstream inFile(ideasName.c_str());
const fileName ideasName = args[1];
IFstream inFile(ideasName);
if (!inFile.good())
{

View File

@ -26,7 +26,7 @@ Application
kivaToFoam
Description
Converts a KIVA3v grid to FOAM format
Converts a KIVA3v grid to OpenFOAM format
\*---------------------------------------------------------------------------*/

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
@ -62,10 +62,8 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
bool readHex = args.optionFound("hex");
fileName mshFile(args.additionalArgs()[0]);
IFstream mshStream(mshFile);
const bool readHex = args.optionFound("hex");
IFstream mshStream(args[1]);
label nCells;
mshStream >> nCells;

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
@ -93,11 +93,7 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
fileName neuFile(args.additionalArgs()[0]);
IFstream str(neuFile);
IFstream str(args[1]);
//
// Read nodes.
@ -106,7 +102,6 @@ int main(int argc, char *argv[])
Info<< "nNodes:" << nNodes << endl;
pointField points(nNodes);
forAll(points, pointI)

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
@ -85,7 +85,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
IFstream plot3dFile(args.additionalArgs()[0]);
IFstream plot3dFile(args[1]);
// Read the plot3d information using a fixed format reader.
// Comments in the file are in C++ style, so the stream parser will remove

View File

@ -385,9 +385,8 @@ int main(int argc, char *argv[])
}
}
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar minCos = Foam::cos(degToRad(featureAngle));
const scalar featureAngle = args.argRead<scalar>(1);
const scalar minCos = Foam::cos(degToRad(featureAngle));
Info<< "Feature:" << featureAngle << endl
<< "minCos :" << minCos << endl

View File

@ -47,7 +47,7 @@ const cellModel* sammMesh::sammTrim4Ptr_ = cellModeller::lookup("sammTrim4");
const cellModel* sammMesh::sammTrim5Ptr_ = cellModeller::lookup("sammTrim5");
const cellModel* sammMesh::sammTrim8Ptr_ = cellModeller::lookup("hexagonalPrism");
// lookup table giving FOAM face number when looked up with shape index
// lookup table giving OpenFOAM face number when looked up with shape index
// (first index) and STAR face number
// - first column is always -1
// - last column is -1 for all but hexagonal prism

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
@ -26,7 +26,7 @@ Application
sammToFoam
Description
Converts a STAR-CD SAMM mesh to FOAM format
Converts a Star-CD (v3) SAMM mesh to OpenFOAM format.
\*---------------------------------------------------------------------------*/
@ -54,8 +54,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
fileName sammFile(args.additionalArgs()[0]);
sammMesh makeMesh(sammFile, runTime, scaleFactor);
sammMesh makeMesh(args[1], runTime, scaleFactor);
// Set the precision of the points data to 10
IOstream::defaultPrecision(10);

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
@ -81,7 +81,6 @@ int main(int argc, char *argv[])
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
const stringList& params = args.additionalArgs();
// default rescale from [mm] to [m]
scalar scaleFactor = args.optionLookupOrDefault("scale", 0.001);
@ -103,7 +102,7 @@ int main(int argc, char *argv[])
IOstream::defaultPrecision(10);
// remove extensions and/or trailing '.'
fileName prefix = fileName(params[0]).lessExt();
const fileName prefix = fileName(args[1]).lessExt();
meshReaders::STARCD reader(prefix, runTime, scaleFactor);

View File

@ -83,7 +83,7 @@ const label starMesh::sammAddressingTable[9][12] =
};
// lookup table giving FOAM face number when looked up with shape index
// lookup table giving OpenFOAM face number when looked up with shape index
// (first index) and STAR face number
// - first column is always -1
// - last column is -1 for all but hexagonal prism

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
@ -26,7 +26,7 @@ Application
starToFoam
Description
Converts a STAR-CD PROSTAR mesh into FOAM format.
Converts a Star-CD (v3) pro-STAR mesh into OpenFOAM format.
\*---------------------------------------------------------------------------*/
@ -54,8 +54,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
fileName starMeshFile(args.additionalArgs()[0]);
starMesh makeMesh(starMeshFile, runTime, scaleFactor);
starMesh makeMesh(args[1], runTime, scaleFactor);
// Set the precision of the points data to 10
IOstream::defaultPrecision(10);

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
@ -103,14 +103,12 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
const fileName prefix = args[1];
const bool readFaceFile = !args.optionFound("noFaceFile");
bool readFaceFile = !args.optionFound("noFaceFile");
fileName prefix(args.additionalArgs()[0]);
fileName nodeFile(prefix + ".node");
fileName eleFile(prefix + ".ele");
fileName faceFile(prefix + ".face");
const fileName nodeFile(prefix + ".node");
const fileName eleFile(prefix + ".ele");
const fileName faceFile(prefix + ".face");
if (!readFaceFile)
{

View File

@ -65,8 +65,8 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])()));
const bool overwrite = args.optionFound("overwrite");
const scalar thickness = args.argRead<scalar>(1);
const bool overwrite = args.optionFound("overwrite");
// Check that mesh is 2D

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");

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
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("inputDict");
argList args(argc, argv);
const string& dictName = args.additionalArgs()[0];
const string dictName = args[1];
Info<<"//\n// expansion of dictionary " << dictName << "\n//\n";

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Translates FOAM data to Fluent format.
Translates OpenFOAM data to Fluent format.
\*---------------------------------------------------------------------------*/

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Translates FOAM data to EnSight format.
Translates OpenFOAM data to EnSight format.
An Ensight part is created for the internalMesh and for each patch.

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
@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Translates a STAR-CD SMAP data file into FOAM field format.
Translates a STAR-CD SMAP data file into OpenFOAM field format.
\*---------------------------------------------------------------------------*/
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
# include "createMesh.H"
IFstream smapFile(args.additionalArgs()[0]);
IFstream smapFile(args[1]);
if (!smapFile.good())
{

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
@ -45,8 +45,8 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
word fieldName(args.additionalArgs()[0]);
word patchName(args.additionalArgs()[1]);
const word fieldName = args[1];
const word patchName = args[2];
forAll(timeDirs, timeI)
{

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,8 +47,8 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createNamedMesh.H"
word fieldName(args.additionalArgs()[0]);
word patchName(args.additionalArgs()[1]);
const word fieldName = args[1];
const word patchName = args[2];
forAll(timeDirs, timeI)
{

View File

@ -17,14 +17,14 @@
fileName rootDirTarget(args.rootPath());
fileName caseDirTarget(args.globalCaseName());
fileName casePath(args.additionalArgs()[0]);
fileName rootDirSource = casePath.path();
fileName caseDirSource = casePath.name();
const fileName casePath = args[1];
const fileName rootDirSource = casePath.path();
const fileName caseDirSource = casePath.name();
Info<< "Source: " << rootDirSource << " " << caseDirSource << nl
<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
bool parallelSource = args.optionFound("parallelSource");
bool parallelTarget = args.optionFound("parallelTarget");
bool consistent = args.optionFound("consistent");
const bool parallelSource = args.optionFound("parallelSource");
const bool parallelTarget = args.optionFound("parallelTarget");
const bool consistent = args.optionFound("consistent");

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
@ -57,12 +57,12 @@ int main(int argc, char *argv[])
argList args(argc, argv);
fileName inFileName1(args.additionalArgs()[0]);
fileName inFileName2(args.additionalArgs()[1]);
fileName outFileName(args.additionalArgs()[2]);
const fileName inFileName1 = args[1];
const fileName inFileName2 = args[2];
const fileName outFileName = args[3];
bool addPoint = args.optionFound("points");
bool mergeRegions = args.optionFound("mergeRegions");
const bool addPoint = args.optionFound("points");
const bool mergeRegions = args.optionFound("mergeRegions");
if (addPoint)
{

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
@ -53,11 +53,11 @@ int main(int argc, char *argv[])
argList::validArgs.append("included angle [0..180]");
argList args(argc, argv);
fileName inFileName(args.additionalArgs()[0]);
fileName outFileName(args.additionalArgs()[1]);
scalar includedAngle(readScalar(IStringStream(args.additionalArgs()[2])()));
const fileName inFileName = args[1];
const fileName outFileName = args[2];
const scalar includedAngle = args.argRead<scalar>(3);
Pout<< "Surface : " << inFileName << nl
Info<< "Surface : " << inFileName << nl
<< endl;
@ -81,7 +81,7 @@ int main(int argc, char *argv[])
surfaceFeatures set(surf, includedAngle);
Pout<< nl
Info<< nl
<< "Feature set:" << nl
<< " feature points : " << set.featurePoints().size() << nl
<< " feature edges : " << set.featureEdges().size() << nl

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
@ -188,10 +188,10 @@ int main(int argc, char *argv[])
argList args(argc, argv);
bool checkSelfIntersection = args.optionFound("checkSelfIntersection");
bool verbose = args.optionFound("verbose");
const fileName surfFileName = args[1];
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
const bool verbose = args.optionFound("verbose");
fileName surfFileName(args.additionalArgs()[0]);
Info<< "Reading surface from " << surfFileName << " ..." << nl << endl;
@ -657,7 +657,7 @@ int main(int argc, char *argv[])
// Check self-intersection
// ~~~~~~~~~~~~~~~~~~~~~~~
if (checkSelfIntersection)
if (checkSelfIntersect)
{
Info<< "Checking self-intersection." << 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
@ -54,21 +54,21 @@ int main(int argc, char *argv[])
argList::validArgs.append("output surface file");
argList::argList args(argc, argv);
fileName inFileName(args.additionalArgs()[0]);
scalar minLen(readScalar(IStringStream(args.additionalArgs()[1])()));
fileName outFileName(args.additionalArgs()[2]);
const fileName inFileName = args[1];
const scalar minLen = args.argRead<scalar>(2);
const fileName outFileName = args[3];
Pout<< "Reading surface " << inFileName << nl
Info<< "Reading surface " << inFileName << nl
<< "Collapsing all triangles with edges or heights < " << minLen << nl
<< "Writing result to " << outFileName << nl << endl;
Pout<< "Reading surface from " << inFileName << " ..." << nl << endl;
Info<< "Reading surface from " << inFileName << " ..." << nl << endl;
triSurface surf(inFileName);
surf.writeStats(Pout);
surf.writeStats(Info);
Pout<< "Collapsing triangles to edges ..." << nl << endl;
Info<< "Collapsing triangles to edges ..." << nl << endl;
while (true)
{
@ -89,15 +89,15 @@ int main(int argc, char *argv[])
}
}
Pout<< nl << "Resulting surface:" << endl;
surf.writeStats(Pout);
Pout<< nl;
Info<< nl
<< "Resulting surface:" << endl;
surf.writeStats(Info);
Pout<< "Writing refined surface to " << outFileName << " ..." << endl;
Info<< nl
<< "Writing refined surface to " << outFileName << " ..." << endl;
surf.write(outFileName);
Pout<< nl;
Pout<< "End\n" << endl;
Info<< "\nEnd\n" << endl;
return 0;
}

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
@ -30,7 +30,6 @@ Description
mailto:melax@cs.ualberta.ca
http://www.cs.ualberta.ca/~melax
\*---------------------------------------------------------------------------*/
#include "argList.H"
@ -72,9 +71,9 @@ int main(int argc, char *argv[])
argList::validArgs.append("Foam output file");
argList args(argc, argv);
fileName inFileName(args.additionalArgs()[0]);
scalar reduction(readScalar(IStringStream(args.additionalArgs()[1])()));
const fileName inFileName = args[1];
const scalar reduction = args.argRead<scalar>(2);
const fileName outFileName = args[3];
if (reduction <= 0 || reduction > 1)
{
@ -85,8 +84,6 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
fileName outFileName(args.additionalArgs()[2]);
Info<< "Input surface :" << inFileName << endl
<< "Reduction factor:" << reduction << endl
<< "Output surface :" << outFileName << endl << 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
@ -69,10 +69,9 @@ int main(int argc, char *argv[])
argList::addOption("scale", "scale");
argList args(argc, argv);
const stringList& params = args.additionalArgs();
fileName importName(params[0]);
fileName exportName(params[1]);
const fileName importName = args[1];
const fileName exportName = args[2];
if (importName == exportName)
{

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
@ -59,10 +59,9 @@ int main(int argc, char *argv[])
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
const stringList& params = args.additionalArgs();
const fileName importName(params[0]);
const fileName exportName(params[1]);
const fileName importName = args[1];
const fileName exportName = args[2];
// disable inplace editing
if (importName == exportName)

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
@ -46,7 +46,7 @@ void dumpBox(const treeBoundBox& bb, const fileName& fName)
{
OFstream str(fName);
Pout<< "Dumping bounding box " << bb << " as lines to obj file "
Info<< "Dumping bounding box " << bb << " as lines to obj file "
<< str.name() << endl;
@ -106,14 +106,14 @@ int main(int argc, char *argv[])
argList::addOption("deleteBox", "((x0 y0 z0)(x1 y1 z1))");
argList args(argc, argv);
Pout<< "Feature line extraction is only valid on closed manifold surfaces."
Info<< "Feature line extraction is only valid on closed manifold surfaces."
<< endl;
fileName surfFileName(args.additionalArgs()[0]);
fileName outFileName(args.additionalArgs()[1]);
const fileName surfFileName = args[1];
const fileName outFileName = args[2];
Pout<< "Surface : " << surfFileName << nl
Info<< "Surface : " << surfFileName << nl
<< "Output feature set : " << outFileName << nl
<< endl;
@ -123,9 +123,9 @@ int main(int argc, char *argv[])
triSurface surf(surfFileName);
Pout<< "Statistics:" << endl;
surf.writeStats(Pout);
Pout<< endl;
Info<< "Statistics:" << endl;
surf.writeStats(Info);
Info<< endl;
@ -138,7 +138,7 @@ int main(int argc, char *argv[])
{
fileName setName(args.option("set"));
Pout<< "Reading existing feature set from file " << setName << endl;
Info<< "Reading existing feature set from file " << setName << endl;
set = surfaceFeatures(surf, setName);
}
@ -146,12 +146,12 @@ int main(int argc, char *argv[])
{
scalar includedAngle = args.optionRead<scalar>("includedAngle");
Pout<< "Constructing feature set from included angle " << includedAngle
Info<< "Constructing feature set from included angle " << includedAngle
<< endl;
set = surfaceFeatures(surf, includedAngle);
Pout<< endl << "Writing initial features" << endl;
Info<< endl << "Writing initial features" << endl;
set.write("initial.fSet");
set.writeObj("initial");
}
@ -165,7 +165,7 @@ int main(int argc, char *argv[])
}
Pout<< nl
Info<< nl
<< "Initial feature set:" << nl
<< " feature points : " << set.featurePoints().size() << nl
<< " feature edges : " << set.featureEdges().size() << nl
@ -184,20 +184,20 @@ int main(int argc, char *argv[])
scalar minLen = -GREAT;
if (args.optionReadIfPresent("minLen", minLen))
{
Pout<< "Removing features of length < " << minLen << endl;
Info<< "Removing features of length < " << minLen << endl;
}
label minElem = 0;
if (args.optionReadIfPresent("minElem", minElem))
{
Pout<< "Removing features with number of edges < " << minElem << endl;
Info<< "Removing features with number of edges < " << minElem << endl;
}
// Trim away small groups of features
if (minElem > 0 || minLen > 0)
{
set.trimFeatures(minLen, minElem);
Pout<< endl << "Removed small features" << endl;
Info<< endl << "Removed small features" << endl;
}
@ -212,7 +212,7 @@ int main(int argc, char *argv[])
{
treeBoundBox bb(args.optionLookup("subsetBox")());
Pout<< "Removing all edges outside bb " << bb << endl;
Info<< "Removing all edges outside bb " << bb << endl;
dumpBox(bb, "subsetBox.obj");
deleteBox
@ -227,7 +227,7 @@ int main(int argc, char *argv[])
{
treeBoundBox bb(args.optionLookup("deleteBox")());
Pout<< "Removing all edges inside bb " << bb << endl;
Info<< "Removing all edges inside bb " << bb << endl;
dumpBox(bb, "deleteBox.obj");
deleteBox
@ -242,14 +242,14 @@ int main(int argc, char *argv[])
surfaceFeatures newSet(surf);
newSet.setFromStatus(edgeStat);
Pout<< endl << "Writing trimmed features to " << outFileName << endl;
Info<< endl << "Writing trimmed features to " << outFileName << endl;
newSet.write(outFileName);
Pout<< endl << "Writing edge objs." << endl;
Info<< endl << "Writing edge objs." << endl;
newSet.writeObj("final");
Pout<< nl
Info<< nl
<< "Final feature set:" << nl
<< " feature points : " << newSet.featurePoints().size() << nl
<< " feature edges : " << newSet.featureEdges().size() << nl
@ -259,7 +259,7 @@ int main(int argc, char *argv[])
<< " internal edges : " << newSet.nInternalEdges() << nl
<< endl;
Pout<< "End\n" << endl;
Info<< "End\n" << endl;
return 0;
}

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
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
Info<< "Reading surf ..." << endl;
meshedSurface surf1(args.additionalArgs()[0]);
meshedSurface surf1(args[1]);
//
// Nearest vertex

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -285,14 +285,12 @@ int main(int argc, char *argv[])
argList::addNote
(
"Calculates the inertia tensor and principal axes and moments "
"of a command line specified triSurface. Inertia can either "
"be of the solid body or of a thin shell."
"of the specified surface.\n"
"Inertia can either be of the solid body or of a thin shell."
);
argList::noParallel();
argList::validArgs.append("surface file");
argList::addBoolOption("shellProperties");
argList::addOption
@ -312,16 +310,14 @@ int main(int argc, char *argv[])
argList args(argc, argv);
fileName surfFileName(args.additionalArgs()[0]);
triSurface surf(surfFileName);
scalar density = args.optionLookupOrDefault("density", 1.0);
const fileName surfFileName = args[1];
const scalar density = args.optionLookupOrDefault("density", 1.0);
vector refPt = vector::zero;
bool calcAroundRefPt = args.optionReadIfPresent("referencePoint", refPt);
triSurface surf(surfFileName);
triFaceList faces(surf.size());
forAll(surf, i)

View File

@ -120,10 +120,9 @@ int main(int argc, char *argv[])
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
const stringList& params = args.additionalArgs();
fileName importName(params[0]);
fileName exportName(params[1]);
const fileName importName = args[1];
const fileName exportName = args[2];
// disable inplace editing
if (importName == exportName)

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
@ -86,13 +86,11 @@ int main(int argc, char *argv[])
argList::addOption("scale", "scale");
# include "setRootCase.H"
const stringList& params = args.additionalArgs();
scalar scaleFactor = 0;
args.optionReadIfPresent("scale", scaleFactor);
const scalar scaleFactor = args.optionLookupOrDefault("scale", 0.0);
fileName importName(params[0]);
fileName exportName(params[1]);
const fileName importName = args[1];
const fileName exportName = args[2];
if (importName == exportName)
{

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
@ -87,10 +87,9 @@ int main(int argc, char *argv[])
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
const stringList& params = args.additionalArgs();
fileName exportName(params[0]);
word importName = args.optionLookupOrDefault<word>("name", "default");
const fileName exportName = args[1];
const word importName = args.optionLookupOrDefault<word>("name", "default");
// check that writing is supported
if (!MeshedSurface<face>::canWriteType(exportName.ext(), true))

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
@ -88,8 +88,6 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
const stringList& params = args.additionalArgs();
// try for the latestTime, but create "constant" as needed
instantList Times = runTime.times();
if (Times.size())
@ -103,9 +101,8 @@ int main(int argc, char *argv[])
}
fileName importName(params[0]);
word exportName("default");
args.optionReadIfPresent("name", exportName);
const fileName importName = args[1];
const word exportName = args.optionLookupOrDefault<word>("name", "default");
// check that reading is supported
if (!MeshedSurface<face>::canRead(importName, true))

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
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
fileName outFileName(runTime.path()/args.additionalArgs()[0]);
const fileName outFileName(runTime.path()/args[1]);
Info<< "Extracting triSurface from boundaryMesh ..."
<< endl << endl;
@ -313,7 +313,7 @@ int main(int argc, char *argv[])
(
runTime.rootPath()
/ globalCasePath
/ args.additionalArgs()[0]
/ args[1]
);
allSurf.write(globalPath);

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
@ -48,14 +48,15 @@ int main(int argc, char *argv[])
argList::addBoolOption("inside");
argList args(argc, argv);
fileName surfFileName(args.additionalArgs()[0]);
const fileName surfFileName = args[1];
const point visiblePoint = args.argRead<point>(2);
const fileName outFileName = args[3];
const bool orientInside = args.optionFound("inside");
Info<< "Reading surface from " << surfFileName << endl;
point visiblePoint(IStringStream(args.additionalArgs()[1])());
Info<< "Visible point " << visiblePoint << endl;
bool orientInside = args.optionFound("inside");
if (orientInside)
{
Info<< "Orienting surface such that visiblePoint " << visiblePoint
@ -67,7 +68,6 @@ int main(int argc, char *argv[])
<< " is outside" << endl;
}
fileName outFileName(args.additionalArgs()[2]);
Info<< "Writing surface to " << outFileName << 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
@ -49,9 +49,9 @@ int main(int argc, char *argv[])
argList::validArgs.append("output file");
argList args(argc, argv);
fileName surfFileName(args.additionalArgs()[0]);
scalar mergeTol(readScalar(IStringStream(args.additionalArgs()[1])()));
fileName outFileName(args.additionalArgs()[2]);
const fileName surfFileName = args[1];
const scalar mergeTol = args.argRead<scalar>(2);
const fileName outFileName = args[3];
Info<< "Reading surface from " << surfFileName << " ..." << endl;
Info<< "Merging points within " << mergeTol << " meter." << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -108,16 +108,16 @@ int main(int argc, char *argv[])
# include "createTime.H"
runTime.functionObjects().off();
fileName surfFileName(args.additionalArgs()[0]);
Info<< "Reading surface from " << surfFileName << nl << endl;
const fileName surfFileName = args[1];
const word distType = args[2];
const word distType(args.additionalArgs()[1]);
Info<< "Using distribution method "
Info<< "Reading surface from " << surfFileName << nl
<< nl
<< "Using distribution method "
<< distributedTriSurfaceMesh::distributionTypeNames_[distType]
<< " " << distType << nl << endl;
bool keepNonMapped = args.options().found("keepNonMapped");
const bool keepNonMapped = args.options().found("keepNonMapped");
if (keepNonMapped)
{

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
@ -53,8 +53,8 @@ int main(int argc, char *argv[])
argList::validArgs.append("output surface file");
argList::argList args(argc, argv);
fileName surfFileName(args.additionalArgs()[0]);
fileName outFileName(args.additionalArgs()[1]);
const fileName surfFileName = args[1];
const fileName outFileName = args[2];
Info<< "Reading surface from " << surfFileName << " ..." << 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
@ -50,17 +50,18 @@ int main(int argc, char *argv[])
argList::validArgs.append("output file");
argList args(argc, argv);
fileName surfFileName(args.additionalArgs()[0]);
scalar relax(readScalar(IStringStream(args.additionalArgs()[1])()));
if ((relax <= 0) || (relax > 1))
const fileName surfFileName = args[1];
const scalar relax = args.argRead<scalar>(2);
const label iters = args.argRead<label>(3);
const fileName outFileName = args[4];
if (relax <= 0 || relax > 1)
{
FatalErrorIn(args.executable()) << "Illegal relaxation factor "
<< relax << endl
<< "0: no change 1: move vertices to average of neighbours"
<< exit(FatalError);
}
label iters(readLabel(IStringStream(args.additionalArgs()[2])()));
fileName outFileName(args.additionalArgs()[3]);
Info<< "Relax:" << relax << nl
<< "Iters:" << iters << nl

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
@ -42,7 +42,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("input file");
argList::argList args(argc, argv);
fileName surfName(args.additionalArgs()[0]);
const fileName surfName = args[1];
Info<< "Reading surf from " << surfName << " ..." << nl << 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
@ -692,9 +692,9 @@ int main(int argc, char *argv[])
argList args(argc, argv);
fileName inSurfName(args.additionalArgs()[0]);
fileName outSurfName(args.additionalArgs()[1]);
bool debug = args.optionFound("debug");
const fileName inSurfName = args[1];
const fileName outSurfName = args[2];
const bool debug = args.optionFound("debug");
Info<< "Reading surface from " << inSurfName << 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
@ -54,12 +54,15 @@ int main(int argc, char *argv[])
argList::validArgs.append("output file");
argList args(argc, argv);
Info<< "Reading dictionary " << args.additionalArgs()[0] << " ..." << endl;
IFstream dictFile(args.additionalArgs()[0]);
Info<< "Reading dictionary " << args[1] << " ..." << endl;
IFstream dictFile(args[1]);
dictionary meshSubsetDict(dictFile);
Info<< "Reading surface " << args.additionalArgs()[1] << " ..." << endl;
triSurface surf1(args.additionalArgs()[1]);
Info<< "Reading surface " << args[2] << " ..." << endl;
triSurface surf1(args[2]);
const fileName outFileName(args[3]);
Info<< "Original:" << endl;
surf1.writeStats(Info);
@ -361,8 +364,6 @@ int main(int argc, char *argv[])
surf2.writeStats(Info);
Info<< endl;
fileName outFileName(args.additionalArgs()[2]);
Info<< "Writing surface to " << outFileName << endl;
surf2.write(outFileName);

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
@ -173,12 +173,12 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createPolyMesh.H"
fileName surfName(args.additionalArgs()[0]);
const fileName surfName = args[1];
Info<< "Reading surface from " << surfName << " ..." << endl;
word setName;
bool readSet = args.optionReadIfPresent("faceSet", setName);
const bool readSet = args.optionReadIfPresent("faceSet", setName);
if (readSet)
{

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
@ -98,14 +98,11 @@ int main(int argc, char *argv[])
);
argList args(argc, argv);
fileName surfFileName(args.additionalArgs()[0]);
Info<< "Reading surf from " << surfFileName << " ..." << endl;
fileName outFileName(args.additionalArgs()[1]);
Info<< "Writing surf to " << outFileName << " ..." << endl;
const fileName surfFileName = args[1];
const fileName outFileName = args[2];
Info<< "Reading surf from " << surfFileName << " ..." << nl
<< "Writing surf to " << outFileName << " ..." << endl;
if (args.options().empty())
{

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
@ -54,7 +54,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("controlFile");
argList args(argc, argv);
fileName controlFileName(args.additionalArgs()[0]);
const fileName controlFileName = args[1];
// Construct control dictionary
IFstream controlFile(controlFileName);

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
@ -23,7 +23,8 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Converts CHEMKINIII thermodynamics and reaction data files into FOAM format
Converts CHEMKINIII thermodynamics and reaction data files into
OpenFOAM format.
\*---------------------------------------------------------------------------*/
@ -45,19 +46,14 @@ int main(int argc, char *argv[])
argList::validArgs.append("FOAMThermodynamicsFile");
argList args(argc, argv);
fileName CHEMKINFileName(args.additionalArgs()[0]);
fileName thermoFileName(args.additionalArgs()[1]);
fileName FOAMChemistryFileName(args.additionalArgs()[2]);
fileName FOAMThermodynamicsFileName(args.additionalArgs()[3]);
chemkinReader cr(args[1], args[2]);
chemkinReader cr(CHEMKINFileName, thermoFileName);
OFstream reactionsFile(FOAMChemistryFileName);
OFstream reactionsFile(args[3]);
reactionsFile
<< "species" << cr.species() << token::END_STATEMENT << nl << nl
<< "reactions" << cr.reactions() << token::END_STATEMENT << endl;
OFstream thermoFile(FOAMThermodynamicsFileName);
OFstream thermoFile(args[4]);
thermoFile<< cr.speciesThermo() << endl;
Info<< "End\n" << 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
@ -55,7 +55,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("controlFile");
argList args(argc, argv);
fileName controlFileName(args.additionalArgs()[0]);
const fileName controlFileName = args[1];
// Construct control dictionary
IFstream controlFile(controlFileName);

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
@ -54,7 +54,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("controlFile");
argList args(argc, argv);
fileName controlFileName(args.additionalArgs()[0]);
const fileName controlFileName(args[1]);
// Construct control dictionary
IFstream controlFile(controlFileName);

View File

@ -751,12 +751,6 @@ Foam::argList::~argList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::stringList::subList Foam::argList::additionalArgs() const
{
return stringList::subList(args_, args_.size() - 1, 1);
}
void Foam::argList::printUsage() const
{
Info<< "\nUsage: " << executable_ << " [OPTIONS]";

View File

@ -225,6 +225,14 @@ public:
template<class T>
inline T argRead(const label index) const;
//- Return arguments that are additional to the executable
// @deprecated use operator[] directly (Feb 2010)
stringList::subList additionalArgs() const
{
return stringList::subList(args_, args_.size()-1, 1);
}
//- Return options
inline const Foam::HashTable<string>& options() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -213,8 +213,8 @@ void Foam::calcTypes::addSubtract::preCalc
const fvMesh& mesh
)
{
baseFieldName_ = args.additionalArgs()[1];
word calcModeName = args.additionalArgs()[2];
baseFieldName_ = args[2];
const word calcModeName = args[3];
if (calcModeName == "add")
{

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
@ -78,7 +78,7 @@ void Foam::calcTypes::components::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

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
@ -78,7 +78,7 @@ void Foam::calcTypes::div::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,7 +78,7 @@ void Foam::calcTypes::interpolate::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

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
@ -78,7 +78,7 @@ void Foam::calcTypes::mag::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

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
@ -78,7 +78,7 @@ void Foam::calcTypes::magGrad::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

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
@ -78,7 +78,7 @@ void Foam::calcTypes::magSqr::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -79,9 +79,8 @@ void Foam::calcTypes::randomise::calc
const fvMesh& mesh
)
{
const stringList& params = args.additionalArgs();
const scalar pertMag = readScalar(IStringStream(params[1])());
const word& fieldName = params[2];
const scalar pertMag = args.argRead<scalar>(2);
const word fieldName = args[3];
Random rand(1234567);