diff --git a/applications/Allwmake b/applications/Allwmake index 48e66941d3..9b8bf7d803 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -10,7 +10,7 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || { set -x -wmake all solvers wmake all utilities +wmake all solvers # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H index 27ddd24544..10855d9cc6 100644 --- a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H +++ b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H @@ -11,7 +11,7 @@ forAll(patches, patchi) { const fvPatch& currPatch = patches[patchi]; - if (isType(currPatch)) + if (isA(currPatch)) { const vectorField nf = currPatch.nf(); diff --git a/applications/test/List/ListTest.C b/applications/test/List/ListTest.C index b9f69fd043..cf5b2d38ec 100644 --- a/applications/test/List/ListTest.C +++ b/applications/test/List/ListTest.C @@ -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("float", xxx)) diff --git a/applications/test/ODETest/ODETest.C b/applications/test/ODETest/ODETest.C index acb444a0a5..1da2f700c5 100644 --- a/applications/test/ODETest/ODETest.C +++ b/applications/test/ODETest/ODETest.C @@ -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::New(ODESolverName, ode); + autoPtr odeSolver = ODESolver::New(args[1], ode); scalar xStart = 1.0; scalarField yStart(ode.nEqns()); diff --git a/applications/test/PackedList/PackedListTest.C b/applications/test/PackedList/PackedListTest.C index e5670b3cbe..d203fad893 100644 --- a/applications/test/PackedList/PackedListTest.C +++ b/applications/test/PackedList/PackedListTest.C @@ -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); diff --git a/applications/test/dictionary/dictionaryTest.C b/applications/test/dictionary/dictionaryTest.C index ff2add8169..fac8dd6631 100644 --- a/applications/test/dictionary/dictionaryTest.C +++ b/applications/test/dictionary/dictionaryTest.C @@ -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); diff --git a/applications/test/fileName/fileNameTest.C b/applications/test/fileName/fileNameTest.C index 81ebd5c255..3a2a134c80 100644 --- a/applications/test/fileName/fileNameTest.C +++ b/applications/test/fileName/fileNameTest.C @@ -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,7 +69,7 @@ int main() word name; fileName path(SubList(wrdList, wrdList.size()-start, start)); - fileName path2 = "." / path; + fileName path2 = "."/path; IOobject::fileNameComponents ( diff --git a/applications/test/fileNameClean/fileNameCleanTest.C b/applications/test/fileNameClean/fileNameCleanTest.C index ce52da1e00..62c78fbd0f 100644 --- a/applications/test/fileNameClean/fileNameCleanTest.C +++ b/applications/test/fileNameClean/fileNameCleanTest.C @@ -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); } diff --git a/applications/test/findCell-octree/findCell-octree.C b/applications/test/findCell-octree/findCell-octree.C index 1a845d7029..a2436852fa 100644 --- a/applications/test/findCell-octree/findCell-octree.C +++ b/applications/test/findCell-octree/findCell-octree.C @@ -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(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; diff --git a/applications/test/mvBak/mvBakTest.C b/applications/test/mvBak/mvBakTest.C index 5cc25161dd..a88d1cfd75 100644 --- a/applications/test/mvBak/mvBakTest.C +++ b/applications/test/mvBak/mvBakTest.C @@ -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; diff --git a/applications/test/passiveParticle/passiveParticleTest.C b/applications/test/passiveParticle/passiveParticleTest.C index 15ba56f4fa..e03cb70e07 100644 --- a/applications/test/passiveParticle/passiveParticleTest.C +++ b/applications/test/passiveParticle/passiveParticleTest.C @@ -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 diff --git a/applications/test/primitivePatch/testPrimitivePatch.C b/applications/test/primitivePatch/testPrimitivePatch.C index cf24ab3435..b6ac551d76 100644 --- a/applications/test/primitivePatch/testPrimitivePatch.C +++ b/applications/test/primitivePatch/testPrimitivePatch.C @@ -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); diff --git a/applications/test/readCHEMKINIII/readCHEMKINIII.C b/applications/test/readCHEMKINIII/readCHEMKINIII.C index 01653ae705..d7f06bb061 100644 --- a/applications/test/readCHEMKINIII/readCHEMKINIII.C +++ b/applications/test/readCHEMKINIII/readCHEMKINIII.C @@ -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& reactions = ck.reactions(); diff --git a/applications/test/spline/splineTest.C b/applications/test/spline/splineTest.C index 3d92a7dd24..600bf0d4f5 100644 --- a/applications/test/spline/splineTest.C +++ b/applications/test/spline/splineTest.C @@ -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); diff --git a/applications/test/testPointEdgeWave/testPointEdgeWave.C b/applications/test/testPointEdgeWave/testPointEdgeWave.C index 10856cbead..9011d8735d 100644 --- a/applications/test/testPointEdgeWave/testPointEdgeWave.C +++ b/applications/test/testPointEdgeWave/testPointEdgeWave.C @@ -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); diff --git a/applications/test/tokenizeTest/tokenizeTest.C b/applications/test/tokenizeTest/tokenizeTest.C index c8be29cbf3..e70c4e3361 100644 --- a/applications/test/tokenizeTest/tokenizeTest.C +++ b/applications/test/tokenizeTest/tokenizeTest.C @@ -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()) diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMeshDict b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMeshDict index d2d9941d63..9c57e17dbf 100644 --- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMeshDict +++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMeshDict @@ -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)); diff --git a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C index 3f1f29b298..a0e2b15f34 100644 --- a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C +++ b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C @@ -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(1); + const scalar angle = args.argRead(2); + const bool overwrite = args.optionFound("overwrite"); scalar maxCos = Foam::cos(degToRad(angle)); diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index fa055e2758..e16fe07cff 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -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(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 diff --git a/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C b/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C index b46a421eb3..c57820803e 100644 --- a/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C +++ b/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C @@ -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; diff --git a/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C b/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C index 6175bd4e16..cb87a9f568 100644 --- a/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C +++ b/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C @@ -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; diff --git a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C index 731eac7855..c6ad157d23 100644 --- a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C +++ b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C @@ -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(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. diff --git a/applications/utilities/mesh/advanced/removeFaces/removeFaces.C b/applications/utilities/mesh/advanced/removeFaces/removeFaces.C index a7d13ba2c3..decd3935cc 100644 --- a/applications/utilities/mesh/advanced/removeFaces/removeFaces.C +++ b/applications/utilities/mesh/advanced/removeFaces/removeFaces.C @@ -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; int main(int argc, char *argv[]) { - argList::addBoolOption("overwrite"); +# include "addOverwriteOption.H" argList::validArgs.append("faceSet"); # include "setRootCase.H" @@ -57,9 +57,8 @@ int main(int argc, char *argv[]) # include "createMesh.H" const word oldInstance = mesh.pointsInstance(); - bool overwrite = args.optionFound("overwrite"); - - word setName(args.additionalArgs()[0]); + const word setName = args[1]; + const bool overwrite = args.optionFound("overwrite"); // Read faces faceSet candidateSet(mesh, setName); diff --git a/applications/utilities/mesh/advanced/selectCells/selectCellsDict b/applications/utilities/mesh/advanced/selectCells/selectCellsDict index eb10e23d78..87f91eafb4 100644 --- a/applications/utilities/mesh/advanced/selectCells/selectCellsDict +++ b/applications/utilities/mesh/advanced/selectCells/selectCellsDict @@ -21,7 +21,7 @@ FoamFile useSurface false; // Surface to keep to -surface "plexi.ftr"; +surface "plexi.obj"; // What is outside outsidePoints ((-1 -1 -1)); diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index 1e1548f517..af7023cbb0 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -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 @@ -524,11 +524,11 @@ void collectCuts int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::noParallel(); argList::addOption("set", "cellSet name"); argList::addBoolOption("geometry"); argList::addOption("tol", "edge snap tolerance"); - argList::addBoolOption("overwrite"); argList::validArgs.append("edge angle [0..360]"); # include "setRootCase.H" @@ -537,14 +537,13 @@ int main(int argc, char *argv[]) # include "createPolyMesh.H" const word oldInstance = mesh.pointsInstance(); - scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); + const scalar featureAngle = args.argRead(1); + const scalar minCos = Foam::cos(degToRad(featureAngle)); + const scalar minSin = Foam::sin(degToRad(featureAngle)); - scalar minCos = Foam::cos(degToRad(featureAngle)); - scalar minSin = Foam::sin(degToRad(featureAngle)); - - bool readSet = args.optionFound("set"); - bool geometry = args.optionFound("geometry"); - bool overwrite = args.optionFound("overwrite"); + const bool readSet = args.optionFound("set"); + const bool geometry = args.optionFound("geometry"); + const bool overwrite = args.optionFound("overwrite"); scalar edgeTol = args.optionLookupOrDefault("tol", 0.2); @@ -553,7 +552,7 @@ int main(int argc, char *argv[]) << "edge snapping tol : " << edgeTol << nl; if (readSet) { - Info<< "candidate cells : cellSet " << args.option("set") << nl; + Info<< "candidate cells : cellSet " << args["set"] << nl; } else { @@ -581,7 +580,7 @@ int main(int argc, char *argv[]) if (readSet) { // Read cells to cut from cellSet - cellSet cells(mesh, args.option("set")); + cellSet cells(mesh, args["set"]); cellsToCut = cells; } diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C index 671c9e7a7e..76fb67afa1 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C @@ -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)) { diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index d07eeb7b69..6cbe8aac27 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -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. \*---------------------------------------------------------------------------*/ @@ -90,23 +91,20 @@ cspace ","{space} alpha [_A-Za-z] digit [0-9] -dec_digit [0-9] -octal_digit [0-7] -hex_digit [0-9a-fA-F] identifier {alpha}({alpha}|{digit})* -integer {dec_digit}+ -label [1-9]{dec_digit}* +integer {digit}+ +label [1-9]{digit}* exponent_part [eE][-+]?{digit}+ fractional_constant [-+]?(({digit}*"."{digit}+)|({digit}+"."?)) -double (({fractional_constant}{exponent_part}?)|({digit}+{exponent_part})) +floatNum (({fractional_constant}{exponent_part}?)|({digit}+{exponent_part})) -x {double} -y {double} -z {double} -value {double} +x {floatNum} +y {floatNum} +z {floatNum} +value {floatNum} node ^{space}"N"{cspace} element ^{space}"EN"{cspace} @@ -252,7 +250,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) diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C index 7ddfeb5fa2..be693be737 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C @@ -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") diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index 333188c072..b810511a76 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -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) diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L index 79a6d75633..2b75740021 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L @@ -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) diff --git a/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C b/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C index 00b6874b5b..79f2c4753e 100644 --- a/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C +++ b/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C @@ -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 << " "; diff --git a/applications/utilities/mesh/conversion/foamMeshToFluent/foamMeshToFluent.C b/applications/utilities/mesh/conversion/foamMeshToFluent/foamMeshToFluent.C index a4d8b25f3b..b9ce333256 100644 --- a/applications/utilities/mesh/conversion/foamMeshToFluent/foamMeshToFluent.C +++ b/applications/utilities/mesh/conversion/foamMeshToFluent/foamMeshToFluent.C @@ -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. \*---------------------------------------------------------------------------*/ diff --git a/applications/utilities/mesh/conversion/foamToStarMesh/Make/options b/applications/utilities/mesh/conversion/foamToStarMesh/Make/options index 1567290170..e3af2fe661 100644 --- a/applications/utilities/mesh/conversion/foamToStarMesh/Make/options +++ b/applications/utilities/mesh/conversion/foamToStarMesh/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/conversion/lnInclude + -I$(LIB_SRC)/conversion/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude EXE_LIBS = \ -lconversion diff --git a/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C b/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C index b1c55e3769..835f3cd14f 100644 --- a/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C +++ b/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C @@ -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("scale", scaleFactor); const bool doTriangulate = args.optionFound("tri"); - fileName exportName(params[0]); - fileName exportBase = exportName.lessExt(); word exportExt = exportName.ext(); diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L index b17e1f6c99..6a4447e677 100644 --- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L +++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L @@ -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. \*---------------------------------------------------------------------------*/ @@ -95,24 +95,14 @@ int yyFlexLexer::yywrap() one_space [ \t\f\r] space {one_space}* some_space {one_space}+ -cspace ","{space} spaceNl ({space}|\n)* alpha [_[:alpha:]] digit [[:digit:]] -dec_digit [[:digit:]] -octal_digit [0-7] -hex_digit [[:xdigit:]] -lbrac "(" -rbrac ")" -quote \" -dash "-" -dotColonDash [.:-] +dotColonDash [.:-] -identifier {alpha}({alpha}|{digit})* -integer {dec_digit}+ -label [0-9]{dec_digit}* +label [0-9]{digit}* zeroLabel {digit}* word ({alpha}|{digit}|{dotColonDash})* @@ -120,14 +110,14 @@ word ({alpha}|{digit}|{dotColonDash})* exponent_part [eE][-+]?{digit}+ fractional_constant [-+]?(({digit}*"."{digit}+)|({digit}+"."?)) -double ((({fractional_constant}{exponent_part}?)|({digit}+{exponent_part}))|0) +floatNum ((({fractional_constant}{exponent_part}?)|({digit}+{exponent_part}))|0) + +x {floatNum} +y {floatNum} +z {floatNum} -x {double} -y {double} -z {double} -scalar {double} labelListElement {space}{zeroLabel} -scalarListElement {space}{double} +scalarListElement {space}{floatNum} labelList ({labelListElement}+{space}) scalarList ({scalarListElement}+{space}) @@ -653,7 +643,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) diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index 45d144e8ab..8218a0cb52 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -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; diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 259ccd2069..2a369cc68a 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -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()) { diff --git a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C index dbd32851bf..153c15e8ae 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C +++ b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C @@ -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 kivaToFoam Description - Converts a KIVA3v grid to FOAM format + Converts a KIVA3v grid to OpenFOAM format \*---------------------------------------------------------------------------*/ @@ -68,15 +68,12 @@ int main(int argc, char *argv[]) # include "createTime.H" fileName kivaFileName("otape17"); - if (args.optionFound("file")) - { - kivaFileName = args.option("file"); - } + args.optionReadIfPresent("file", kivaFileName); kivaVersions kivaVersion = kiva3v; if (args.optionFound("version")) { - word kivaVersionName = args.option("version"); + const word kivaVersionName = args["version"]; if (kivaVersionName == "kiva3") { diff --git a/applications/utilities/mesh/conversion/mshToFoam/mshToFoam.C b/applications/utilities/mesh/conversion/mshToFoam/mshToFoam.C index 1beea38d02..0332308702 100644 --- a/applications/utilities/mesh/conversion/mshToFoam/mshToFoam.C +++ b/applications/utilities/mesh/conversion/mshToFoam/mshToFoam.C @@ -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; diff --git a/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C b/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C index 41080fde78..aaade87a07 100644 --- a/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C +++ b/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C @@ -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) diff --git a/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C b/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C index 0f2c18732b..52a64d6dde 100644 --- a/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C +++ b/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C @@ -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 diff --git a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C index df229e4bf0..03832883cc 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -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 @@ -353,14 +353,27 @@ void dumpFeatures int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::noParallel(); timeSelector::addOptions(true, false); argList::validArgs.append("feature angle[0-180]"); - argList::addBoolOption("splitAllFaces"); - argList::addBoolOption("concaveMultiCells"); - argList::addBoolOption("doNotPreserveFaceZones"); - argList::addBoolOption("overwrite"); + argList::addBoolOption + ( + "splitAllFaces", + "have multiple faces inbetween cells" + ); + argList::addBoolOption + ( + "concaveMultiCells", + "split cells on concave boundary edges into multiple cells" + ); + argList::addBoolOption + ( + "doNotPreserveFaceZones", + "disable the default behaviour of preserving faceZones by having" + " multiple faces inbetween cells" + ); # include "setRootCase.H" # include "createTime.H" @@ -385,9 +398,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(1); + const scalar minCos = Foam::cos(degToRad(featureAngle)); Info<< "Feature:" << featureAngle << endl << "minCos :" << minCos << endl diff --git a/applications/utilities/mesh/conversion/sammToFoam/readPoints.C b/applications/utilities/mesh/conversion/sammToFoam/readPoints.C index 1b83a20d30..76e182dc12 100644 --- a/applications/utilities/mesh/conversion/sammToFoam/readPoints.C +++ b/applications/utilities/mesh/conversion/sammToFoam/readPoints.C @@ -30,6 +30,6 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define starMesh sammMesh -#include "../starToFoam/readPoints.C" +#include "../star3ToFoam/readPoints.C" // ************************************************************************* // diff --git a/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C b/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C index 3a57153c07..5b0ef44ab4 100644 --- a/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C +++ b/applications/utilities/mesh/conversion/sammToFoam/sammMesh.C @@ -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 diff --git a/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C b/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C index d4bfaa47e2..c1bb529cd6 100644 --- a/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C +++ b/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C @@ -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); diff --git a/applications/utilities/mesh/conversion/starToFoam/Make/files b/applications/utilities/mesh/conversion/star3ToFoam/Make/files similarity index 85% rename from applications/utilities/mesh/conversion/starToFoam/Make/files rename to applications/utilities/mesh/conversion/star3ToFoam/Make/files index cb233cf069..c50cf188d6 100644 --- a/applications/utilities/mesh/conversion/starToFoam/Make/files +++ b/applications/utilities/mesh/conversion/star3ToFoam/Make/files @@ -14,6 +14,6 @@ createBoundaryFaces.C createPolyBoundary.C purgeCellShapes.C writeMesh.C -starToFoam.C +star3ToFoam.C -EXE = $(FOAM_APPBIN)/starToFoam +EXE = $(FOAM_APPBIN)/star3ToFoam diff --git a/applications/utilities/mesh/conversion/starToFoam/Make/options b/applications/utilities/mesh/conversion/star3ToFoam/Make/options similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/Make/options rename to applications/utilities/mesh/conversion/star3ToFoam/Make/options diff --git a/applications/utilities/mesh/conversion/starToFoam/calcPointCells.C b/applications/utilities/mesh/conversion/star3ToFoam/calcPointCells.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/calcPointCells.C rename to applications/utilities/mesh/conversion/star3ToFoam/calcPointCells.C diff --git a/applications/utilities/mesh/conversion/starToFoam/coupledFacePair.C b/applications/utilities/mesh/conversion/star3ToFoam/coupledFacePair.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/coupledFacePair.C rename to applications/utilities/mesh/conversion/star3ToFoam/coupledFacePair.C diff --git a/applications/utilities/mesh/conversion/starToFoam/coupledFacePair.H b/applications/utilities/mesh/conversion/star3ToFoam/coupledFacePair.H similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/coupledFacePair.H rename to applications/utilities/mesh/conversion/star3ToFoam/coupledFacePair.H diff --git a/applications/utilities/mesh/conversion/starToFoam/createBoundaryFaces.C b/applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/createBoundaryFaces.C rename to applications/utilities/mesh/conversion/star3ToFoam/createBoundaryFaces.C diff --git a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C b/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C rename to applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C diff --git a/applications/utilities/mesh/conversion/starToFoam/createPolyBoundary.C b/applications/utilities/mesh/conversion/star3ToFoam/createPolyBoundary.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/createPolyBoundary.C rename to applications/utilities/mesh/conversion/star3ToFoam/createPolyBoundary.C diff --git a/applications/utilities/mesh/conversion/starToFoam/createPolyCells.C b/applications/utilities/mesh/conversion/star3ToFoam/createPolyCells.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/createPolyCells.C rename to applications/utilities/mesh/conversion/star3ToFoam/createPolyCells.C diff --git a/applications/utilities/mesh/conversion/starToFoam/fixCollapsedEdges.C b/applications/utilities/mesh/conversion/star3ToFoam/fixCollapsedEdges.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/fixCollapsedEdges.C rename to applications/utilities/mesh/conversion/star3ToFoam/fixCollapsedEdges.C diff --git a/applications/utilities/mesh/conversion/starToFoam/mergeCoupleFacePoints.C b/applications/utilities/mesh/conversion/star3ToFoam/mergeCoupleFacePoints.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/mergeCoupleFacePoints.C rename to applications/utilities/mesh/conversion/star3ToFoam/mergeCoupleFacePoints.C diff --git a/applications/utilities/mesh/conversion/starToFoam/purgeCellShapes.C b/applications/utilities/mesh/conversion/star3ToFoam/purgeCellShapes.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/purgeCellShapes.C rename to applications/utilities/mesh/conversion/star3ToFoam/purgeCellShapes.C diff --git a/applications/utilities/mesh/conversion/starToFoam/readBoundary.C b/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/readBoundary.C rename to applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C diff --git a/applications/utilities/mesh/conversion/starToFoam/readCells.C b/applications/utilities/mesh/conversion/star3ToFoam/readCells.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/readCells.C rename to applications/utilities/mesh/conversion/star3ToFoam/readCells.C diff --git a/applications/utilities/mesh/conversion/starToFoam/readCouples.C b/applications/utilities/mesh/conversion/star3ToFoam/readCouples.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/readCouples.C rename to applications/utilities/mesh/conversion/star3ToFoam/readCouples.C diff --git a/applications/utilities/mesh/conversion/starToFoam/readPoints.C b/applications/utilities/mesh/conversion/star3ToFoam/readPoints.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/readPoints.C rename to applications/utilities/mesh/conversion/star3ToFoam/readPoints.C diff --git a/applications/utilities/mesh/conversion/starToFoam/readSeparatedPoints.C b/applications/utilities/mesh/conversion/star3ToFoam/readSeparatedPoints.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/readSeparatedPoints.C rename to applications/utilities/mesh/conversion/star3ToFoam/readSeparatedPoints.C diff --git a/applications/utilities/mesh/conversion/starToFoam/starToFoam.C b/applications/utilities/mesh/conversion/star3ToFoam/star3ToFoam.C similarity index 88% rename from applications/utilities/mesh/conversion/starToFoam/starToFoam.C rename to applications/utilities/mesh/conversion/star3ToFoam/star3ToFoam.C index 90547da3af..29d864e2aa 100644 --- a/applications/utilities/mesh/conversion/starToFoam/starToFoam.C +++ b/applications/utilities/mesh/conversion/star3ToFoam/star3ToFoam.C @@ -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,10 +23,10 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - starToFoam + star3ToFoam 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); diff --git a/applications/utilities/mesh/conversion/starToFoam/starMesh.C b/applications/utilities/mesh/conversion/star3ToFoam/starMesh.C similarity index 99% rename from applications/utilities/mesh/conversion/starToFoam/starMesh.C rename to applications/utilities/mesh/conversion/star3ToFoam/starMesh.C index 9f9ddfe94b..2f20a69e39 100644 --- a/applications/utilities/mesh/conversion/starToFoam/starMesh.C +++ b/applications/utilities/mesh/conversion/star3ToFoam/starMesh.C @@ -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 diff --git a/applications/utilities/mesh/conversion/starToFoam/starMesh.H b/applications/utilities/mesh/conversion/star3ToFoam/starMesh.H similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/starMesh.H rename to applications/utilities/mesh/conversion/star3ToFoam/starMesh.H diff --git a/applications/utilities/mesh/conversion/starToFoam/writeMesh.C b/applications/utilities/mesh/conversion/star3ToFoam/writeMesh.C similarity index 100% rename from applications/utilities/mesh/conversion/starToFoam/writeMesh.C rename to applications/utilities/mesh/conversion/star3ToFoam/writeMesh.C diff --git a/applications/utilities/mesh/conversion/star4ToFoam/Make/options b/applications/utilities/mesh/conversion/star4ToFoam/Make/options index 1567290170..e3af2fe661 100644 --- a/applications/utilities/mesh/conversion/star4ToFoam/Make/options +++ b/applications/utilities/mesh/conversion/star4ToFoam/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/conversion/lnInclude + -I$(LIB_SRC)/conversion/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude EXE_LIBS = \ -lconversion diff --git a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C index e48625230c..88d51a53c2 100644 --- a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C +++ b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C @@ -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); diff --git a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C index f830cfc185..7908900a3b 100644 --- a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C +++ b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C @@ -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) { diff --git a/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C b/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C index 47fc9c922f..ae35892b08 100644 --- a/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C +++ b/applications/utilities/mesh/conversion/writeMeshObj/writeMeshObj.C @@ -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 @@ -463,7 +463,7 @@ int main(int argc, char *argv[]) } if (doCellSet) { - word setName(args.option("cellSet")); + const word setName = args["cellSet"]; cellSet cells(mesh, setName); @@ -475,7 +475,7 @@ int main(int argc, char *argv[]) } if (doFaceSet) { - word setName(args.option("faceSet")); + const word setName = args["faceSet"]; faceSet faces(mesh, setName); diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index 9140c090ec..4efd69cac8 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C @@ -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 @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) if (args.optionFound("dict")) { - fileName dictPath(args.option("dict")); + const fileName dictPath = args["dict"]; meshDictIoPtr.set ( diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Make/files b/applications/utilities/mesh/generation/extrude2DMesh/Make/files index 9153e6dc34..8cc4bd86cd 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/Make/files +++ b/applications/utilities/mesh/generation/extrude2DMesh/Make/files @@ -1,4 +1,4 @@ extrude2DMesh.C -doExtrude2DMesh.C +extrude2DMeshApp.C EXE = $(FOAM_APPBIN)/extrude2DMesh diff --git a/applications/utilities/mesh/generation/extrude2DMesh/doExtrude2DMesh.C b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C similarity index 95% rename from applications/utilities/mesh/generation/extrude2DMesh/doExtrude2DMesh.C rename to applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C index 0299cade00..d27176baeb 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/doExtrude2DMesh.C +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C @@ -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 @@ -38,7 +38,6 @@ Usage Note Not sure about the walking of the faces to create the front and back faces. - Tested on one .ccm file. \*---------------------------------------------------------------------------*/ @@ -57,16 +56,17 @@ using namespace Foam; int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::validArgs.append("thickness"); - argList::addBoolOption("overwrite"); + # include "setRootCase.H" # include "createTime.H" runTime.functionObjects().off(); # include "createPolyMesh.H" const word oldInstance = mesh.pointsInstance(); - scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])())); - bool overwrite = args.optionFound("overwrite"); + const scalar thickness = args.argRead(1); + const bool overwrite = args.optionFound("overwrite"); // Check that mesh is 2D diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 528551eb51..4ab7a771be 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -120,11 +120,8 @@ void writeMesh int main(int argc, char *argv[]) { - argList::addBoolOption - ( - "overwrite", - "overwrite existing mesh files" - ); +# include "addOverwriteOption.H" + # include "setRootCase.H" # include "createTime.H" runTime.functionObjects().off(); diff --git a/applications/utilities/mesh/manipulation/attachMesh/attachMesh.C b/applications/utilities/mesh/manipulation/attachMesh/attachMesh.C index 35247413e1..066a800ab9 100644 --- a/applications/utilities/mesh/manipulation/attachMesh/attachMesh.C +++ b/applications/utilities/mesh/manipulation/attachMesh/attachMesh.C @@ -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 @@ -41,8 +41,8 @@ using namespace Foam; int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::noParallel(); - argList::addBoolOption("overwrite"); # include "setRootCase.H" # include "createTime.H" @@ -50,7 +50,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"); if (!overwrite) { diff --git a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C index abad711392..c5fcb20d05 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C +++ b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C @@ -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,9 +69,9 @@ void collectFeatureEdges(const boundaryMesh& bMesh, labelList& markedEdges) int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::noParallel(); argList::validArgs.append("feature angle[0-180]"); - argList::addBoolOption("overwrite"); # include "setRootCase.H" # include "createTime.H" @@ -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(1); + const bool overwrite = args.optionFound("overwrite"); - boundaryMesh bMesh; - - scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - 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) diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index dc94786222..06f635ef86 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -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 @@ -125,12 +125,13 @@ label findPatchID(const polyMesh& mesh, const word& name) int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" # include "addRegionOption.H" + argList::validArgs.append("faceZone"); argList::validArgs.append("patch"); argList::addOption("additionalPatches", "(patch2 .. patchN)"); argList::addBoolOption("internalFacesOnly"); - argList::addBoolOption("overwrite"); # include "setRootCase.H" # include "createTime.H" @@ -142,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; @@ -167,7 +168,7 @@ int main(int argc, char *argv[]) // Patches to put baffles into DynamicList