From ee293cde8e21d937248262ef4c816f432acdca0b Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 16 Feb 2010 11:44:27 +0100 Subject: [PATCH 1/9] ENH: add usage information for '-overwrite' option. - make centrally available via #include "addOverwriteOption.H" --- .../advanced/collapseEdges/collapseEdges.C | 6 ++-- .../combinePatchFaces/combinePatchFaces.C | 17 ++++++--- .../mesh/advanced/modifyMesh/modifyMesh.C | 6 ++-- .../advanced/refineHexMesh/refineHexMesh.C | 7 ++-- .../refineWallLayer/refineWallLayer.C | 6 ++-- .../mesh/advanced/removeFaces/removeFaces.C | 6 ++-- .../mesh/advanced/splitCells/splitCells.C | 10 +++--- .../conversion/polyDualMesh/polyDualMeshApp.C | 4 +-- .../mesh/generation/extrude2DMesh/Make/files | 2 +- .../{doExtrude2DMesh.C => extrude2DMeshApp.C} | 8 ++--- .../generation/snappyHexMesh/snappyHexMesh.C | 7 ++-- .../mesh/manipulation/attachMesh/attachMesh.C | 6 ++-- .../mesh/manipulation/autoPatch/autoPatch.C | 6 ++-- .../createBaffles/createBaffles.C | 10 +++--- .../manipulation/createPatch/createPatch.C | 4 +-- .../mergeOrSplitBaffles/mergeOrSplitBaffles.C | 11 +++--- .../mesh/manipulation/refineMesh/refineMesh.C | 8 ++--- .../manipulation/renumberMesh/renumberMesh.C | 6 ++-- .../singleCellMesh/singleCellMesh.C | 6 ++-- .../mesh/manipulation/splitMesh/splitMesh.C | 7 ++-- .../splitMeshRegions/splitMeshRegions.C | 20 +++++------ .../mesh/manipulation/stitchMesh/stitchMesh.C | 10 +++--- .../mesh/manipulation/subsetMesh/subsetMesh.C | 6 ++-- .../decomposePar/decomposePar.C | 16 +++++++-- .../reconstructPar/reconstructPar.C | 24 +++++++++---- .../reconstructParMesh/reconstructParMesh.C | 35 +++++++++++++------ src/OpenFOAM/include/addOverwriteOption.H | 10 ++++++ 27 files changed, 158 insertions(+), 106 deletions(-) rename applications/utilities/mesh/generation/extrude2DMesh/{doExtrude2DMesh.C => extrude2DMeshApp.C} (96%) create mode 100644 src/OpenFOAM/include/addOverwriteOption.H diff --git a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C index 3f1f29b298..8dd31f8b81 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)"); @@ -466,7 +466,7 @@ int main(int argc, char *argv[]) scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])())); scalar angle(readScalar(IStringStream(args.additionalArgs()[1])())); - bool overwrite = args.optionFound("overwrite"); + 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..8b68edd097 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" @@ -449,8 +456,8 @@ int main(int argc, char *argv[]) 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..91f049ff21 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" @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) word patchName(args.additionalArgs()[0]); scalar weight(readScalar(IStringStream(args.additionalArgs()[1])())); - bool overwrite = args.optionFound("overwrite"); + const bool overwrite = args.optionFound("overwrite"); label patchID = mesh.boundaryMesh().findPatchID(patchName); diff --git a/applications/utilities/mesh/advanced/removeFaces/removeFaces.C b/applications/utilities/mesh/advanced/removeFaces/removeFaces.C index a7d13ba2c3..0f876ce656 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,7 +57,7 @@ int main(int argc, char *argv[]) # include "createMesh.H" const word oldInstance = mesh.pointsInstance(); - bool overwrite = args.optionFound("overwrite"); + const bool overwrite = args.optionFound("overwrite"); word setName(args.additionalArgs()[0]); diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index 1e1548f517..5255d6efeb 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" @@ -542,9 +542,9 @@ int main(int argc, char *argv[]) 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); diff --git a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C index df229e4bf0..083b826010 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,6 +353,7 @@ void dumpFeatures int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::noParallel(); timeSelector::addOptions(true, false); @@ -360,7 +361,6 @@ int main(int argc, char *argv[]) argList::addBoolOption("splitAllFaces"); argList::addBoolOption("concaveMultiCells"); argList::addBoolOption("doNotPreserveFaceZones"); - argList::addBoolOption("overwrite"); # include "setRootCase.H" # include "createTime.H" 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 96% rename from applications/utilities/mesh/generation/extrude2DMesh/doExtrude2DMesh.C rename to applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C index 0299cade00..a94d70c0a2 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,8 +56,9 @@ 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(); @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) const word oldInstance = mesh.pointsInstance(); scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])())); - bool overwrite = args.optionFound("overwrite"); + 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..3067f90eef 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" @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) boundaryMesh bMesh; scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - bool overwrite = args.optionFound("overwrite"); + const bool overwrite = args.optionFound("overwrite"); scalar minCos = Foam::cos(degToRad(featureAngle)); diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index dc94786222..dca4303582 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" @@ -191,9 +192,8 @@ int main(int argc, char *argv[]) } - bool overwrite = args.optionFound("overwrite"); - - bool internalFacesOnly = args.optionFound("internalFacesOnly"); + const bool overwrite = args.optionFound("overwrite"); + const bool internalFacesOnly = args.optionFound("internalFacesOnly"); if (internalFacesOnly) { diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index d59f7317b9..90f6377b6d 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.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 @@ -516,8 +516,8 @@ void syncPoints int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" # include "addRegionOption.H" - argList::addBoolOption("overwrite"); # include "setRootCase.H" # include "createTime.H" diff --git a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C index 5053c95071..c950eb8a92 100644 --- a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C +++ b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.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 @@ -222,19 +222,20 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces) int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" # include "addRegionOption.H" argList::addBoolOption("split"); - argList::addBoolOption("overwrite"); argList::addBoolOption("detectOnly"); + # include "setRootCase.H" # include "createTime.H" runTime.functionObjects().off(); # include "createNamedMesh.H" const word oldInstance = mesh.pointsInstance(); - bool split = args.optionFound("split"); - bool overwrite = args.optionFound("overwrite"); - bool detectOnly = args.optionFound("detectOnly"); + const bool split = args.optionFound("split"); + const bool overwrite = args.optionFound("overwrite"); + const bool detectOnly = args.optionFound("detectOnly"); // Collect all boundary faces labelList boundaryFaces(mesh.nFaces() - mesh.nInternalFaces()); diff --git a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C index a33afdf711..85da9ce113 100644 --- a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C +++ b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.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 @@ -291,8 +291,8 @@ label twoDNess(const polyMesh& mesh) int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::addBoolOption("dict"); - argList::addBoolOption("overwrite"); # include "setRootCase.H" # include "createTime.H" @@ -307,8 +307,8 @@ int main(int argc, char *argv[]) // Read/construct control dictionary // - bool readDict = args.optionFound("dict"); - bool overwrite = args.optionFound("overwrite"); + const bool readDict = args.optionFound("dict"); + const bool overwrite = args.optionFound("overwrite"); // List of cells to refine labelList refCells; diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 099cdcdead..ab310515cc 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.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 anispulation | ------------------------------------------------------------------------------- License @@ -367,8 +367,8 @@ int main(int argc, char *argv[]) argList::addBoolOption("blockOrder"); argList::addBoolOption("orderPoints"); argList::addBoolOption("writeMaps"); - argList::addBoolOption("overwrite"); +# include "addOverwriteOption.H" # include "addTimeOptions.H" # include "setRootCase.H" @@ -409,7 +409,7 @@ int main(int argc, char *argv[]) << endl; } - bool overwrite = args.optionFound("overwrite"); + const bool overwrite = args.optionFound("overwrite"); label band = getBand(mesh.faceOwner(), mesh.faceNeighbour()); diff --git a/applications/utilities/mesh/manipulation/singleCellMesh/singleCellMesh.C b/applications/utilities/mesh/manipulation/singleCellMesh/singleCellMesh.C index 927d8ca854..44238b51b6 100644 --- a/applications/utilities/mesh/manipulation/singleCellMesh/singleCellMesh.C +++ b/applications/utilities/mesh/manipulation/singleCellMesh/singleCellMesh.C @@ -66,9 +66,9 @@ void interpolateFields int main(int argc, char *argv[]) { - argList::addBoolOption("overwrite"); - +# include "addOverwriteOption.H" # include "addTimeOptions.H" + # include "setRootCase.H" # include "createTime.H" // Get times list @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) # include "createMesh.H" const word oldInstance = mesh.pointsInstance(); - bool overwrite = args.optionFound("overwrite"); + const bool overwrite = args.optionFound("overwrite"); // Read objects in time directory diff --git a/applications/utilities/mesh/manipulation/splitMesh/splitMesh.C b/applications/utilities/mesh/manipulation/splitMesh/splitMesh.C index 0d8fe6490d..bb171818da 100644 --- a/applications/utilities/mesh/manipulation/splitMesh/splitMesh.C +++ b/applications/utilities/mesh/manipulation/splitMesh/splitMesh.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 @@ -111,11 +111,11 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name) int main(int argc, char *argv[]) { argList::noParallel(); +# include "addOverwriteOption.H" argList::validArgs.append("faceSet"); argList::validArgs.append("masterPatch"); argList::validArgs.append("slavePatch"); - argList::addBoolOption("overwrite"); # include "setRootCase.H" # include "createTime.H" @@ -126,7 +126,8 @@ int main(int argc, char *argv[]) word setName(args.additionalArgs()[0]); word masterPatch(args.additionalArgs()[1]); word slavePatch(args.additionalArgs()[2]); - bool overwrite = args.optionFound("overwrite"); + + const bool overwrite = args.optionFound("overwrite"); // List of faces to split faceSet facesSet(mesh, setName); diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index a584789167..c03db84d75 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.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 @@ -1309,13 +1309,13 @@ label findCorrespondingRegion int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::addBoolOption("cellZones"); argList::addBoolOption("cellZonesOnly"); argList::addOption("blockedFaces", "faceSet"); argList::addBoolOption("makeCellZones"); argList::addBoolOption("largestOnly"); argList::addOption("insidePoint", "point"); - argList::addBoolOption("overwrite"); argList::addBoolOption("detectOnly"); argList::addBoolOption("sloppyCellZones"); @@ -1333,14 +1333,14 @@ int main(int argc, char *argv[]) << blockedFacesName << nl << endl; } - bool makeCellZones = args.optionFound("makeCellZones"); - bool largestOnly = args.optionFound("largestOnly"); - bool insidePoint = args.optionFound("insidePoint"); - bool useCellZones = args.optionFound("cellZones"); - bool useCellZonesOnly = args.optionFound("cellZonesOnly"); - bool overwrite = args.optionFound("overwrite"); - bool detectOnly = args.optionFound("detectOnly"); - bool sloppyCellZones = args.optionFound("sloppyCellZones"); + const bool makeCellZones = args.optionFound("makeCellZones"); + const bool largestOnly = args.optionFound("largestOnly"); + const bool insidePoint = args.optionFound("insidePoint"); + const bool useCellZones = args.optionFound("cellZones"); + const bool useCellZonesOnly = args.optionFound("cellZonesOnly"); + const bool overwrite = args.optionFound("overwrite"); + const bool detectOnly = args.optionFound("detectOnly"); + const bool sloppyCellZones = args.optionFound("sloppyCellZones"); if (insidePoint && largestOnly) { diff --git a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C index 553ea07138..cff1111297 100644 --- a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C +++ b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.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 @@ -96,6 +96,7 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name) int main(int argc, char *argv[]) { argList::noParallel(); +# include "addOverwriteOption.H" # include "addRegionOption.H" argList::validArgs.append("masterPatch"); @@ -103,7 +104,6 @@ int main(int argc, char *argv[]) argList::addBoolOption("partial"); argList::addBoolOption("perfect"); - argList::addBoolOption("overwrite"); argList::addOption("toleranceDict", "file with tolerances"); @@ -117,9 +117,9 @@ int main(int argc, char *argv[]) word masterPatchName(args.additionalArgs()[0]); word slavePatchName(args.additionalArgs()[1]); - bool partialCover = args.optionFound("partial"); - bool perfectCover = args.optionFound("perfect"); - bool overwrite = args.optionFound("overwrite"); + const bool partialCover = args.optionFound("partial"); + const bool perfectCover = args.optionFound("perfect"); + const bool overwrite = args.optionFound("overwrite"); if (partialCover && perfectCover) { diff --git a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C index fac26e6815..1e9d5c92dc 100644 --- a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C +++ b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.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 @@ -151,9 +151,9 @@ void subsetPointFields int main(int argc, char *argv[]) { +# include "addOverwriteOption.H" argList::validArgs.append("set"); argList::addOption("patch", "patch name"); - argList::addBoolOption("overwrite"); # include "setRootCase.H" # include "createTime.H" @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) const word oldInstance = mesh.pointsInstance(); word setName(args.additionalArgs()[0]); - bool overwrite = args.optionFound("overwrite"); + const bool overwrite = args.optionFound("overwrite"); Info<< "Reading cell set from " << setName << endl << endl; diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index ea8ffe9469..51631f1305 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -34,8 +34,8 @@ Usage - decomposePar [OPTION] @param -cellDist \n - Write the cell distribution as a labelList for use with 'manual' - decomposition method and as a volScalarField for post-processing. + Write the cell distribution as a labelList, for use with 'manual' + decomposition method or as a volScalarField for post-processing. @param -region regionName \n Decompose named region. Does not check for existence of processor*. @@ -84,7 +84,12 @@ int main(int argc, char *argv[]) { argList::noParallel(); # include "addRegionOption.H" - argList::addBoolOption("cellDist"); + argList::addBoolOption + ( + "cellDist", + "write cell distribution as a labelList - for use with 'manual' " + "decomposition method or as a volScalarField for post-processing." + ); argList::addBoolOption ( "copyUniform", @@ -106,6 +111,11 @@ int main(int argc, char *argv[]) "only decompose geometry if the number of domains has changed" ); + argList::addNote + ( + "decompose a mesh and fields of a case for parallel execution" + ); + # include "setRootCase.H" word regionName = fvMesh::defaultRegion; diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index c412010cbd..d105a8492a 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.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 @@ -50,8 +50,18 @@ int main(int argc, char *argv[]) timeSelector::addOptions(true, true); argList::noParallel(); # include "addRegionOption.H" - argList::addOption("fields", "\"(list of fields)\""); - argList::addBoolOption("noLagrangian"); + argList::addOption + ( + "fields", + "list", + "specify a list of fields to be reconstructed. Eg, '(U T p)' - " + "regular expressions not currently supported" + ); + argList::addBoolOption + ( + "noLagrangian", + "skip reconstructing lagrangian positions and fields" + ); # include "setRootCase.H" # include "createTime.H" @@ -62,7 +72,7 @@ int main(int argc, char *argv[]) args.optionLookup("fields")() >> selectedFields; } - bool noLagrangian = args.optionFound("noLagrangian"); + const bool noLagrangian = args.optionFound("noLagrangian"); // determine the processor count directly label nProcs = 0; @@ -111,10 +121,10 @@ int main(int argc, char *argv[]) } # include "createNamedMesh.H" - fileName regionPrefix = ""; + word regionDir = word::null; if (regionName != fvMesh::defaultRegion) { - regionPrefix = regionName; + regionDir = regionName; } // Set all times on processor meshes equal to reconstructed mesh @@ -289,7 +299,7 @@ int main(int argc, char *argv[]) ( readDir ( - databases[procI].timePath()/regionPrefix/cloud::prefix, + databases[procI].timePath() / regionDir / cloud::prefix, fileName::DIRECTORY ) ); diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C index a143356450..2bc95be4e7 100644 --- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C +++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.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 @@ -281,8 +281,23 @@ autoPtr mergeSharedPoints int main(int argc, char *argv[]) { argList::noParallel(); - argList::addOption("mergeTol", "relative merge distance"); - argList::addBoolOption("fullMatch"); + argList::addOption + ( + "mergeTol", + "scalar", + "specify the merge distance relative to the bounding box size " + "(default 1E-7)" + ); + argList::addBoolOption + ( + "fullMatch", + "do (slower) geometric matching on all boundary faces" + ); + + argList::addNote + ( + "reconstruct a mesh using geometric information only" + ); # include "addTimeOptions.H" # include "addRegionOption.H" @@ -306,11 +321,11 @@ int main(int argc, char *argv[]) word regionName = polyMesh::defaultRegion; - fileName regionPrefix = ""; - if (args.optionFound("region")) + word regionDir = word::null; + + if (args.optionReadIfPresent("region", regionName)) { - regionName = args.option("region"); - regionPrefix = regionName; + regionDir = regionName; Info<< "Operating on region " << regionName << nl << endl; } @@ -425,7 +440,7 @@ int main(int argc, char *argv[]) ( databases[procI].findInstance ( - regionPrefix/polyMesh::meshSubDir, + regionDir / polyMesh::meshSubDir, "points" ) ); @@ -454,10 +469,10 @@ int main(int argc, char *argv[]) "points", databases[procI].findInstance ( - regionPrefix/polyMesh::meshSubDir, + regionDir / polyMesh::meshSubDir, "points" ), - regionPrefix/polyMesh::meshSubDir, + regionDir / polyMesh::meshSubDir, databases[procI], IOobject::MUST_READ, IOobject::NO_WRITE, diff --git a/src/OpenFOAM/include/addOverwriteOption.H b/src/OpenFOAM/include/addOverwriteOption.H new file mode 100644 index 0000000000..c61548f06b --- /dev/null +++ b/src/OpenFOAM/include/addOverwriteOption.H @@ -0,0 +1,10 @@ +// +// addOverwriteOption.H +// ~~~~~~~~~~~~~~~~~~~~ + + Foam::argList::addOption + ( + "overwrite", + "overwrite existing mesh/results files" + ); + From 51039eab007dd8f5ae7d5b7d682f8df52328ca35 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 16 Feb 2010 13:11:46 +0100 Subject: [PATCH 2/9] ENH: provide argRead() method and operator[] for accessing argList arguments. - also provide size() method, which returns the number of arguments --- src/OpenFOAM/global/argList/argList.C | 2 +- src/OpenFOAM/global/argList/argList.H | 19 +++++++--- src/OpenFOAM/global/argList/argListI.H | 50 +++++++++++++++++++++++++- src/OpenFOAM/global/argList/parRun.H | 2 +- 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index f574fde3e6..1f2a60e558 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.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 diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index da75c4d066..ca00bd2844 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -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 @@ -211,9 +211,19 @@ public: //- Return arguments inline const stringList& args() const; - //- Return additional arguments, - // i.e. those additional to the executable itself - stringList::subList additionalArgs() const; + //- Return the number of arguments + inline label size() const; + + //- Return the argument corresponding to index. + // Index 0 corresponds to the name of the executable. + // Index 1 corresponds to the first argument. + inline const string& operator[](const label index) const; + + //- Read a value from the argument at index. + // Index 0 corresponds to the name of the executable. + // Index 1 corresponds to the first argument. + template + inline T argRead(const label index) const; //- Return options inline const Foam::HashTable& options() const; @@ -264,7 +274,6 @@ public: } - // Edit //- Add to a bool option to validOptions with usage information diff --git a/src/OpenFOAM/global/argList/argListI.H b/src/OpenFOAM/global/argList/argListI.H index 6b9b462de0..9da2149de6 100644 --- a/src/OpenFOAM/global/argList/argListI.H +++ b/src/OpenFOAM/global/argList/argListI.H @@ -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 @@ -64,6 +64,12 @@ inline const Foam::stringList& Foam::argList::args() const } +inline Foam::label Foam::argList::size() const +{ + return args_.size(); +} + + inline const Foam::HashTable& Foam::argList::options() const { return options_; @@ -92,6 +98,30 @@ inline Foam::IStringStream Foam::argList::optionLookup(const word& opt) const namespace Foam { + // Template specialization for string + template<> + inline Foam::string + Foam::argList::argRead(const label index) const + { + return args_[index]; + } + + // Template specialization for word + template<> + inline Foam::word + Foam::argList::argRead(const label index) const + { + return args_[index]; + } + + // Template specialization for fileName + template<> + inline Foam::fileName + Foam::argList::argRead(const label index) const + { + return args_[index]; + } + // Template specialization for string template<> inline Foam::string @@ -120,6 +150,16 @@ namespace Foam // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +inline T Foam::argList::argRead(const label index) const +{ + T val; + + IStringStream(args_[index])() >> val; + return val; +} + + template inline T Foam::argList::optionRead(const word& opt) const { @@ -187,4 +227,12 @@ inline T Foam::argList::optionLookupOrDefault } +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +inline const Foam::string& Foam::argList::operator[](const label index) const +{ + return args_[index]; +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/global/argList/parRun.H b/src/OpenFOAM/global/argList/parRun.H index c1e5b544bc..d2b926d8a4 100644 --- a/src/OpenFOAM/global/argList/parRun.H +++ b/src/OpenFOAM/global/argList/parRun.H @@ -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 From d857d671ac9b8d3f34890fe020c6bd14105c45fe Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 16 Feb 2010 17:57:49 +0100 Subject: [PATCH 3/9] STYLE: use new argList argRead() method and operator[] for cleaner code. - deprecate argList::additionalArgs() method and remove uses of it --- applications/test/ODETest/ODETest.C | 6 +-- applications/test/PackedList/PackedListTest.C | 8 ++-- applications/test/dictionary/dictionaryTest.C | 8 ++-- .../test/fileNameClean/fileNameCleanTest.C | 8 ++-- .../test/findCell-octree/findCell-octree.C | 8 ++-- applications/test/mvBak/mvBakTest.C | 10 ++--- .../passiveParticle/passiveParticleTest.C | 4 +- .../test/primitivePatch/testPrimitivePatch.C | 4 +- .../test/readCHEMKINIII/readCHEMKINIII.C | 21 ++++----- applications/test/spline/splineTest.C | 8 ++-- .../testPointEdgeWave/testPointEdgeWave.C | 4 +- applications/test/tokenizeTest/tokenizeTest.C | 6 +-- .../advanced/collapseEdges/collapseEdges.C | 4 +- .../combinePatchFaces/combinePatchFaces.C | 6 +-- .../refineWallLayer/refineWallLayer.C | 6 +-- .../mesh/advanced/removeFaces/removeFaces.C | 3 +- .../mesh/advanced/splitCells/splitCells.C | 7 ++- .../Optional/ccm26ToFoam/ccm26ToFoam.C | 4 +- .../mesh/conversion/ansysToFoam/ansysToFoam.L | 7 +-- .../mesh/conversion/cfx4ToFoam/cfx4ToFoam.C | 10 ++--- .../fluent3DMeshToFoam/fluent3DMeshToFoam.L | 4 +- .../fluentMeshToFoam/fluentMeshToFoam.L | 10 ++--- .../foamMeshToFluent/fluentFvMesh.C | 3 +- .../foamMeshToFluent/foamMeshToFluent.C | 2 +- .../conversion/foamToSurface/foamToSurface.C | 4 +- .../conversion/gambitToFoam/gambitToFoam.L | 6 +-- .../mesh/conversion/gmshToFoam/gmshToFoam.C | 10 ++--- .../ideasUnvToFoam/ideasUnvToFoam.C | 7 ++- .../mesh/conversion/kivaToFoam/kivaToFoam.C | 2 +- .../mesh/conversion/mshToFoam/mshToFoam.C | 8 ++-- .../netgenNeutralToFoam/netgenNeutralToFoam.C | 9 +--- .../conversion/plot3dToFoam/plot3dToFoam.C | 4 +- .../conversion/polyDualMesh/polyDualMeshApp.C | 5 +-- .../mesh/conversion/sammToFoam/sammMesh.C | 2 +- .../mesh/conversion/sammToFoam/sammToFoam.C | 7 ++- .../mesh/conversion/star4ToFoam/star4ToFoam.C | 5 +-- .../mesh/conversion/starToFoam/starMesh.C | 2 +- .../mesh/conversion/starToFoam/starToFoam.C | 7 ++- .../conversion/tetgenToFoam/tetgenToFoam.C | 14 +++--- .../extrude2DMesh/extrude2DMeshApp.C | 4 +- .../mesh/manipulation/autoPatch/autoPatch.C | 17 ++++--- .../createBaffles/createBaffles.C | 4 +- .../manipulation/deformedGeom/deformedGeom.C | 4 +- .../manipulation/insideCells/insideCells.C | 7 ++- .../manipulation/mergeMeshes/mergeMeshes.C | 2 +- .../mesh/manipulation/mergeMeshes/setRoots.H | 9 ++-- .../mesh/manipulation/objToVTK/objToVTK.C | 6 +-- .../mesh/manipulation/rotateMesh/rotateMesh.C | 8 ++-- .../mesh/manipulation/splitMesh/splitMesh.C | 7 ++- .../mesh/manipulation/stitchMesh/stitchMesh.C | 5 +-- .../mesh/manipulation/subsetMesh/subsetMesh.C | 2 +- .../expandDictionary/expandDictionary.C | 4 +- .../foamDataToFluent/foamDataToFluent.C | 2 +- .../foamToEnsight/foamToEnsight.C | 2 +- .../dataConversion/smapToFoam/smapToFoam.C | 6 +-- .../patch/patchAverage/patchAverage.C | 6 +-- .../patch/patchIntegrate/patchIntegrate.C | 6 +-- .../preProcessing/mapFields/setRoots.H | 12 ++--- .../utilities/surface/surfaceAdd/surfaceAdd.C | 12 ++--- .../surfaceAutoPatch/surfaceAutoPatch.C | 12 ++--- .../surface/surfaceCheck/surfaceCheck.C | 10 ++--- .../surface/surfaceClean/surfaceClean.C | 28 ++++++------ .../surface/surfaceCoarsen/surfaceCoarsen.C | 11 ++--- .../surface/surfaceConvert/surfaceConvert.C | 7 ++- .../surfaceFeatureConvert.C | 7 ++- .../surfaceFeatureExtract.C | 44 +++++++++---------- .../surface/surfaceFind/surfaceFind.C | 4 +- .../surface/surfaceInertia/surfaceInertia.C | 18 +++----- .../surfaceMeshConvert/surfaceMeshConvert.C | 5 +-- .../surfaceMeshConvertTesting.C | 10 ++--- .../surfaceMeshExport/surfaceMeshExport.C | 7 ++- .../surfaceMeshImport/surfaceMeshImport.C | 9 ++-- .../surfaceMeshTriangulate.C | 6 +-- .../surface/surfaceOrient/surfaceOrient.C | 14 +++--- .../surfacePointMerge/surfacePointMerge.C | 8 ++-- .../surfaceRedistributePar.C | 14 +++--- .../surfaceRefineRedGreen.C | 6 +-- .../surface/surfaceSmooth/surfaceSmooth.C | 13 +++--- .../surfaceSplitByPatch/surfaceSplitByPatch.C | 4 +- .../surfaceSplitNonManifolds.C | 8 ++-- .../surface/surfaceSubset/surfaceSubset.C | 15 ++++--- .../surface/surfaceToPatch/surfaceToPatch.C | 6 +-- .../surfaceTransformPoints.C | 13 +++--- .../adiabaticFlameT/adiabaticFlameT.C | 4 +- .../chemkinToFoam/chemkinToFoam.C | 16 +++---- .../equilibriumFlameT/equilibriumFlameT.C | 4 +- .../mixtureAdiabaticFlameT.C | 4 +- src/OpenFOAM/global/argList/argList.C | 6 --- src/OpenFOAM/global/argList/argList.H | 8 ++++ .../basic/addSubtract/addSubtract.C | 6 +-- .../field/components/components.C | 4 +- .../foamCalcFunctions/field/div/div.C | 4 +- .../field/interpolate/interpolate.C | 4 +- .../foamCalcFunctions/field/mag/mag.C | 4 +- .../foamCalcFunctions/field/magGrad/magGrad.C | 4 +- .../foamCalcFunctions/field/magSqr/magSqr.C | 4 +- .../field/randomise/randomise.C | 7 ++- 97 files changed, 341 insertions(+), 395 deletions(-) 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/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..7b325cbeeb 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,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; 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..0e6f9dec37 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; diff --git a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C index 8dd31f8b81..a0e2b15f34 100644 --- a/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C +++ b/applications/utilities/mesh/advanced/collapseEdges/collapseEdges.C @@ -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(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 8b68edd097..e16fe07cff 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -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(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"); diff --git a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C index 91f049ff21..3c7ee9b8d1 100644 --- a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C +++ b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C @@ -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(2); const bool overwrite = args.optionFound("overwrite"); - label patchID = mesh.boundaryMesh().findPatchID(patchName); if (patchID == -1) diff --git a/applications/utilities/mesh/advanced/removeFaces/removeFaces.C b/applications/utilities/mesh/advanced/removeFaces/removeFaces.C index 0f876ce656..decd3935cc 100644 --- a/applications/utilities/mesh/advanced/removeFaces/removeFaces.C +++ b/applications/utilities/mesh/advanced/removeFaces/removeFaces.C @@ -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); diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index 5255d6efeb..ecfb97d050 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -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(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"); 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..f452a9f083 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. \*---------------------------------------------------------------------------*/ @@ -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) 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/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..36be409753 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. \*---------------------------------------------------------------------------*/ @@ -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) 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..4c13d23591 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C +++ b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C @@ -26,7 +26,7 @@ Application kivaToFoam Description - Converts a KIVA3v grid to FOAM format + Converts a KIVA3v grid to OpenFOAM format \*---------------------------------------------------------------------------*/ 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 083b826010..0ccb7a6862 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -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(1); + const scalar minCos = Foam::cos(degToRad(featureAngle)); Info<< "Feature:" << featureAngle << endl << "minCos :" << minCos << endl 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/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/starToFoam/starMesh.C b/applications/utilities/mesh/conversion/starToFoam/starMesh.C index 9f9ddfe94b..2f20a69e39 100644 --- a/applications/utilities/mesh/conversion/starToFoam/starMesh.C +++ b/applications/utilities/mesh/conversion/starToFoam/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/starToFoam.C b/applications/utilities/mesh/conversion/starToFoam/starToFoam.C index 90547da3af..f9d35109af 100644 --- a/applications/utilities/mesh/conversion/starToFoam/starToFoam.C +++ b/applications/utilities/mesh/conversion/starToFoam/starToFoam.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 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); 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/generation/extrude2DMesh/extrude2DMeshApp.C b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C index a94d70c0a2..d27176baeb 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshApp.C @@ -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(1); + const bool overwrite = args.optionFound("overwrite"); // Check that mesh is 2D diff --git a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C index 3067f90eef..c5fcb20d05 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C +++ b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C @@ -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])())); - 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) diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index dca4303582..06f635ef86 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -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