Commit 7c5ca187 authored by henry's avatar henry
Browse files
parents c1e7fd9e e49e95a5
......@@ -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
......@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
if (args.optionFound("flag"))
{
Info<<"-flag:" << args.option("flag") << endl;
Info<<"-flag:" << args["flag"] << endl;
}
if (args.optionReadIfPresent<scalar>("float", xxx))
......
......@@ -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());
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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,20 +45,20 @@ 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"))
{
if (mvBak(srcFile, args.option("ext")))
if (mvBak(srcFile, args["ext"]))
{
ok++;
}
......@@ -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;
......
......@@ -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
......
......@@ -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);
......
......@@ -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"];
}
fileName CHEMKINFileName(args.additionalArgs()[0]);
args.optionReadIfPresent("thermo", thermoFileName);
chemkinReader ck(CHEMKINFileName, thermoFileName);
chemkinReader ck(args[1], 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();
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......@@ -94,11 +94,11 @@ int main(int argc, char *argv[])
{
for (label count = 0; count < repeat; ++count)
{
IFstream is(args.option("file"));
IFstream is(args["file"]);
if (count == 0)
{
Info<< "tokenizing file: " << args.option("file") << nl;
Info<< "tokenizing file: " << args["file"] << nl;
}
while (is.good())
......
......@@ -17,7 +17,7 @@ FoamFile
// Surface to keep to
surface "plexi.ftr";
surface "plexi.obj";
// What is outside. These points have to be inside a cell (so not on a face!)
outsidePoints ((-0.99001 -0.99001 -0.99001));
......
......@@ -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
......@@ -453,8 +453,8 @@ label simplifyFaces
int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
argList::noParallel();
argList::addBoolOption("overwrite");
argList::validArgs.append("edge length [m]");
argList::validArgs.append("merge angle (degrees)");
......@@ -464,9 +464,9 @@ 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])()));
bool overwrite = args.optionFound("overwrite");
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));
......
......@@ -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
......@@ -428,10 +428,17 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
argList::validArgs.append("feature angle [0..180]");
argList::addOption("concaveAngle", "[0..180]");
argList::addOption
(
"concaveAngle",
"[0..180]",
"specify concave angle [0..180] degrees (default: 30.0 degrees)"
);
argList::addBoolOption("snapMesh");
argList::addBoolOption("overwrite");
# include "setRootCase.H"
# include "createTime.H"
......@@ -439,18 +446,16 @@ 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));
bool snapMeshDict = args.optionFound("snapMesh");
bool overwrite = args.optionFound("overwrite");
const bool snapMeshDict = args.optionFound("snapMesh");
const bool overwrite = args.optionFound("overwrite");
Info<< "Merging all faces of a cell" << nl
<< " - which are on the same patch" << nl
......
......@@ -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
......@@ -328,7 +328,7 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
int main(int argc, char *argv[])
{
argList::addBoolOption("overwrite");
# include "addOverwriteOption.H"
# include "setRootCase.H"
# include "createTime.H"
......@@ -336,7 +336,7 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.optionFound("overwrite");
Info<< "Reading modifyMeshDict\n" << endl;
......
......@@ -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
......@@ -52,8 +52,9 @@ using namespace Foam;
// Main program:
int main(int argc, char *argv[])
{
argList::addBoolOption("overwrite");
# include "addOverwriteOption.H"
argList::validArgs.append("cellSet");
# include "setRootCase.H"
# include "createTime.H"
runTime.functionObjects().off();
......@@ -63,7 +64,7 @@ int main(int argc, char *argv[])
pointMesh pMesh(mesh);
word cellSetName(args.args()[1]);
bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.optionFound("overwrite");
Info<< "Reading cells to refine from cellSet " << cellSetName
<< nl << endl;
......
......@@ -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,12 +47,12 @@ using namespace Foam;
int main(int argc, char *argv[])
{
# include "addOverwriteOption.H"
argList::noParallel();
argList::validArgs.append("patchName");
argList::validArgs.append("edgeWeight");
argList::addOption("useSet", "cellSet");
argList::addBoolOption("overwrite");
# include "setRootCase.H"
# include "createTime.H"
......@@ -60,11 +60,9 @@ 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])()));
bool overwrite = args.optionFound("overwrite");
const word patchName = args[1];
const scalar weight = args.argRead<scalar>(2);
const bool overwrite = args.optionFound("overwrite");
label patchID = mesh.boundaryMesh().findPatchID(patchName);
......@@ -103,20 +101,17 @@ int main(int argc, char *argv[])
// List of cells to refine
//
bool useSet = args.optionFound("useSet");
if (useSet)
word setName;
if (args.optionReadIfPresent("useSet", setName))
{
word setName(args.option("useSet"));
Info<< "Subsetting cells to cut based on cellSet" << setName << endl
<< endl;
Info<< "Subsetting cells to cut based on cellSet"
<< setName << nl << endl;
cellSet cells(mesh, setName);
Info<< "Read " << cells.size() << " cells from cellSet "
<< cells.instance()/cells.local()/cells.name()
<< endl << endl;
<< nl << endl;
for
(
......@@ -127,8 +122,8 @@ int main(int argc, char *argv[])
{
cutCells.erase(iter.key());
}
Info<< "Removed from cells to cut all the ones not in set " << setName
<< endl << endl;
Info<< "Removed from cells to cut all the ones not in set "
<< setName << nl << endl;
}
// Mark all meshpoints on patch
......@@ -182,9 +177,9 @@ int main(int argc, char *argv[])
allCutEdges.shrink();
allCutEdgeWeights.shrink();
Info<< "Cutting:" << endl
<< " cells:" << cutCells.size() << endl
<< " edges:" << allCutEdges.size() << endl
Info<< "Cutting:" << nl
<< " cells:" << cutCells.size() << nl
<< " edges:" << allCutEdges.size() << nl
<< endl;
// Transfer DynamicLists to straight ones.
......
......@@ -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,7 +48,7 @@ using namespace Foam;