ENH: add usage information for '-overwrite' option.

- make centrally available via #include "addOverwriteOption.H"
This commit is contained in:
Mark Olesen
2010-02-16 11:44:27 +01:00
parent cb527178ea
commit ee293cde8e
27 changed files with 158 additions and 106 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -453,8 +453,8 @@ label simplifyFaces
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::noParallel(); argList::noParallel();
argList::addBoolOption("overwrite");
argList::validArgs.append("edge length [m]"); argList::validArgs.append("edge length [m]");
argList::validArgs.append("merge angle (degrees)"); argList::validArgs.append("merge angle (degrees)");
@ -466,7 +466,7 @@ int main(int argc, char *argv[])
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])())); scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])())); scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
scalar maxCos = Foam::cos(degToRad(angle)); scalar maxCos = Foam::cos(degToRad(angle));

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -428,10 +428,17 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::validArgs.append("feature angle [0..180]"); 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("snapMesh");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -449,8 +456,8 @@ int main(int argc, char *argv[])
scalar concaveSin = Foam::sin(degToRad(concaveAngle)); scalar concaveSin = Foam::sin(degToRad(concaveAngle));
bool snapMeshDict = args.optionFound("snapMesh"); const bool snapMeshDict = args.optionFound("snapMesh");
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
Info<< "Merging all faces of a cell" << nl Info<< "Merging all faces of a cell" << nl
<< " - which are on the same patch" << nl << " - which are on the same patch" << nl

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -328,7 +328,7 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addBoolOption("overwrite"); # include "addOverwriteOption.H"
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -336,7 +336,7 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
Info<< "Reading modifyMeshDict\n" << endl; Info<< "Reading modifyMeshDict\n" << endl;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,8 +52,9 @@ using namespace Foam;
// Main program: // Main program:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addBoolOption("overwrite"); # include "addOverwriteOption.H"
argList::validArgs.append("cellSet"); argList::validArgs.append("cellSet");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
@ -63,7 +64,7 @@ int main(int argc, char *argv[])
pointMesh pMesh(mesh); pointMesh pMesh(mesh);
word cellSetName(args.args()[1]); word cellSetName(args.args()[1]);
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
Info<< "Reading cells to refine from cellSet " << cellSetName Info<< "Reading cells to refine from cellSet " << cellSetName
<< nl << endl; << nl << endl;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,12 +47,12 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::noParallel(); argList::noParallel();
argList::validArgs.append("patchName"); argList::validArgs.append("patchName");
argList::validArgs.append("edgeWeight"); argList::validArgs.append("edgeWeight");
argList::addOption("useSet", "cellSet"); argList::addOption("useSet", "cellSet");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -63,7 +63,7 @@ int main(int argc, char *argv[])
word patchName(args.additionalArgs()[0]); word patchName(args.additionalArgs()[0]);
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])())); scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
label patchID = mesh.boundaryMesh().findPatchID(patchName); label patchID = mesh.boundaryMesh().findPatchID(patchName);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,7 +48,7 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addBoolOption("overwrite"); # include "addOverwriteOption.H"
argList::validArgs.append("faceSet"); argList::validArgs.append("faceSet");
# include "setRootCase.H" # include "setRootCase.H"
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
# include "createMesh.H" # include "createMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
word setName(args.additionalArgs()[0]); word setName(args.additionalArgs()[0]);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -524,11 +524,11 @@ void collectCuts
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::noParallel(); argList::noParallel();
argList::addOption("set", "cellSet name"); argList::addOption("set", "cellSet name");
argList::addBoolOption("geometry"); argList::addBoolOption("geometry");
argList::addOption("tol", "edge snap tolerance"); argList::addOption("tol", "edge snap tolerance");
argList::addBoolOption("overwrite");
argList::validArgs.append("edge angle [0..360]"); argList::validArgs.append("edge angle [0..360]");
# include "setRootCase.H" # include "setRootCase.H"
@ -542,9 +542,9 @@ int main(int argc, char *argv[])
scalar minCos = Foam::cos(degToRad(featureAngle)); scalar minCos = Foam::cos(degToRad(featureAngle));
scalar minSin = Foam::sin(degToRad(featureAngle)); scalar minSin = Foam::sin(degToRad(featureAngle));
bool readSet = args.optionFound("set"); const bool readSet = args.optionFound("set");
bool geometry = args.optionFound("geometry"); const bool geometry = args.optionFound("geometry");
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
scalar edgeTol = args.optionLookupOrDefault("tol", 0.2); scalar edgeTol = args.optionLookupOrDefault("tol", 0.2);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -353,6 +353,7 @@ void dumpFeatures
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::noParallel(); argList::noParallel();
timeSelector::addOptions(true, false); timeSelector::addOptions(true, false);
@ -360,7 +361,6 @@ int main(int argc, char *argv[])
argList::addBoolOption("splitAllFaces"); argList::addBoolOption("splitAllFaces");
argList::addBoolOption("concaveMultiCells"); argList::addBoolOption("concaveMultiCells");
argList::addBoolOption("doNotPreserveFaceZones"); argList::addBoolOption("doNotPreserveFaceZones");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"

View File

@ -1,4 +1,4 @@
extrude2DMesh.C extrude2DMesh.C
doExtrude2DMesh.C extrude2DMeshApp.C
EXE = $(FOAM_APPBIN)/extrude2DMesh EXE = $(FOAM_APPBIN)/extrude2DMesh

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,7 +38,6 @@ Usage
Note Note
Not sure about the walking of the faces to create the front and back faces. 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[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::validArgs.append("thickness"); argList::validArgs.append("thickness");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])())); scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])()));
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
// Check that mesh is 2D // Check that mesh is 2D

View File

@ -120,11 +120,8 @@ void writeMesh
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addBoolOption # include "addOverwriteOption.H"
(
"overwrite",
"overwrite existing mesh files"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -41,8 +41,8 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::noParallel(); argList::noParallel();
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -50,7 +50,7 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
if (!overwrite) if (!overwrite)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -69,9 +69,9 @@ void collectFeatureEdges(const boundaryMesh& bMesh, labelList& markedEdges)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::noParallel(); argList::noParallel();
argList::validArgs.append("feature angle[0-180]"); argList::validArgs.append("feature angle[0-180]");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -91,7 +91,7 @@ int main(int argc, char *argv[])
boundaryMesh bMesh; boundaryMesh bMesh;
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
scalar minCos = Foam::cos(degToRad(featureAngle)); scalar minCos = Foam::cos(degToRad(featureAngle));

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -125,12 +125,13 @@ label findPatchID(const polyMesh& mesh, const word& name)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
# include "addRegionOption.H" # include "addRegionOption.H"
argList::validArgs.append("faceZone"); argList::validArgs.append("faceZone");
argList::validArgs.append("patch"); argList::validArgs.append("patch");
argList::addOption("additionalPatches", "(patch2 .. patchN)"); argList::addOption("additionalPatches", "(patch2 .. patchN)");
argList::addBoolOption("internalFacesOnly"); argList::addBoolOption("internalFacesOnly");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -191,9 +192,8 @@ int main(int argc, char *argv[])
} }
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
const bool internalFacesOnly = args.optionFound("internalFacesOnly");
bool internalFacesOnly = args.optionFound("internalFacesOnly");
if (internalFacesOnly) if (internalFacesOnly)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -516,8 +516,8 @@ void syncPoints
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
# include "addRegionOption.H" # include "addRegionOption.H"
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -222,19 +222,20 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
# include "addRegionOption.H" # include "addRegionOption.H"
argList::addBoolOption("split"); argList::addBoolOption("split");
argList::addBoolOption("overwrite");
argList::addBoolOption("detectOnly"); argList::addBoolOption("detectOnly");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
# include "createNamedMesh.H" # include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
bool split = args.optionFound("split"); const bool split = args.optionFound("split");
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
bool detectOnly = args.optionFound("detectOnly"); const bool detectOnly = args.optionFound("detectOnly");
// Collect all boundary faces // Collect all boundary faces
labelList boundaryFaces(mesh.nFaces() - mesh.nInternalFaces()); labelList boundaryFaces(mesh.nFaces() - mesh.nInternalFaces());

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -291,8 +291,8 @@ label twoDNess(const polyMesh& mesh)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::addBoolOption("dict"); argList::addBoolOption("dict");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -307,8 +307,8 @@ int main(int argc, char *argv[])
// Read/construct control dictionary // Read/construct control dictionary
// //
bool readDict = args.optionFound("dict"); const bool readDict = args.optionFound("dict");
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
// List of cells to refine // List of cells to refine
labelList refCells; labelList refCells;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anispulation | \\/ M anispulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -367,8 +367,8 @@ int main(int argc, char *argv[])
argList::addBoolOption("blockOrder"); argList::addBoolOption("blockOrder");
argList::addBoolOption("orderPoints"); argList::addBoolOption("orderPoints");
argList::addBoolOption("writeMaps"); argList::addBoolOption("writeMaps");
argList::addBoolOption("overwrite");
# include "addOverwriteOption.H"
# include "addTimeOptions.H" # include "addTimeOptions.H"
# include "setRootCase.H" # include "setRootCase.H"
@ -409,7 +409,7 @@ int main(int argc, char *argv[])
<< endl; << endl;
} }
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
label band = getBand(mesh.faceOwner(), mesh.faceNeighbour()); label band = getBand(mesh.faceOwner(), mesh.faceNeighbour());

View File

@ -66,9 +66,9 @@ void interpolateFields
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addBoolOption("overwrite"); # include "addOverwriteOption.H"
# include "addTimeOptions.H" # include "addTimeOptions.H"
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
// Get times list // Get times list
@ -78,7 +78,7 @@ int main(int argc, char *argv[])
# include "createMesh.H" # include "createMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
// Read objects in time directory // Read objects in time directory

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -111,11 +111,11 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
# include "addOverwriteOption.H"
argList::validArgs.append("faceSet"); argList::validArgs.append("faceSet");
argList::validArgs.append("masterPatch"); argList::validArgs.append("masterPatch");
argList::validArgs.append("slavePatch"); argList::validArgs.append("slavePatch");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -126,7 +126,8 @@ int main(int argc, char *argv[])
word setName(args.additionalArgs()[0]); word setName(args.additionalArgs()[0]);
word masterPatch(args.additionalArgs()[1]); word masterPatch(args.additionalArgs()[1]);
word slavePatch(args.additionalArgs()[2]); word slavePatch(args.additionalArgs()[2]);
bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.optionFound("overwrite");
// List of faces to split // List of faces to split
faceSet facesSet(mesh, setName); faceSet facesSet(mesh, setName);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1309,13 +1309,13 @@ label findCorrespondingRegion
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::addBoolOption("cellZones"); argList::addBoolOption("cellZones");
argList::addBoolOption("cellZonesOnly"); argList::addBoolOption("cellZonesOnly");
argList::addOption("blockedFaces", "faceSet"); argList::addOption("blockedFaces", "faceSet");
argList::addBoolOption("makeCellZones"); argList::addBoolOption("makeCellZones");
argList::addBoolOption("largestOnly"); argList::addBoolOption("largestOnly");
argList::addOption("insidePoint", "point"); argList::addOption("insidePoint", "point");
argList::addBoolOption("overwrite");
argList::addBoolOption("detectOnly"); argList::addBoolOption("detectOnly");
argList::addBoolOption("sloppyCellZones"); argList::addBoolOption("sloppyCellZones");
@ -1333,14 +1333,14 @@ int main(int argc, char *argv[])
<< blockedFacesName << nl << endl; << blockedFacesName << nl << endl;
} }
bool makeCellZones = args.optionFound("makeCellZones"); const bool makeCellZones = args.optionFound("makeCellZones");
bool largestOnly = args.optionFound("largestOnly"); const bool largestOnly = args.optionFound("largestOnly");
bool insidePoint = args.optionFound("insidePoint"); const bool insidePoint = args.optionFound("insidePoint");
bool useCellZones = args.optionFound("cellZones"); const bool useCellZones = args.optionFound("cellZones");
bool useCellZonesOnly = args.optionFound("cellZonesOnly"); const bool useCellZonesOnly = args.optionFound("cellZonesOnly");
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
bool detectOnly = args.optionFound("detectOnly"); const bool detectOnly = args.optionFound("detectOnly");
bool sloppyCellZones = args.optionFound("sloppyCellZones"); const bool sloppyCellZones = args.optionFound("sloppyCellZones");
if (insidePoint && largestOnly) if (insidePoint && largestOnly)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -96,6 +96,7 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
# include "addOverwriteOption.H"
# include "addRegionOption.H" # include "addRegionOption.H"
argList::validArgs.append("masterPatch"); argList::validArgs.append("masterPatch");
@ -103,7 +104,6 @@ int main(int argc, char *argv[])
argList::addBoolOption("partial"); argList::addBoolOption("partial");
argList::addBoolOption("perfect"); argList::addBoolOption("perfect");
argList::addBoolOption("overwrite");
argList::addOption("toleranceDict", "file with tolerances"); argList::addOption("toleranceDict", "file with tolerances");
@ -117,9 +117,9 @@ int main(int argc, char *argv[])
word masterPatchName(args.additionalArgs()[0]); word masterPatchName(args.additionalArgs()[0]);
word slavePatchName(args.additionalArgs()[1]); word slavePatchName(args.additionalArgs()[1]);
bool partialCover = args.optionFound("partial"); const bool partialCover = args.optionFound("partial");
bool perfectCover = args.optionFound("perfect"); const bool perfectCover = args.optionFound("perfect");
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
if (partialCover && perfectCover) if (partialCover && perfectCover)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -151,9 +151,9 @@ void subsetPointFields
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
# include "addOverwriteOption.H"
argList::validArgs.append("set"); argList::validArgs.append("set");
argList::addOption("patch", "patch name"); argList::addOption("patch", "patch name");
argList::addBoolOption("overwrite");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -162,7 +162,7 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
word setName(args.additionalArgs()[0]); word setName(args.additionalArgs()[0]);
bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
Info<< "Reading cell set from " << setName << endl << endl; Info<< "Reading cell set from " << setName << endl << endl;

View File

@ -34,8 +34,8 @@ Usage
- decomposePar [OPTION] - decomposePar [OPTION]
@param -cellDist \n @param -cellDist \n
Write the cell distribution as a labelList for use with 'manual' Write the cell distribution as a labelList, for use with 'manual'
decomposition method and as a volScalarField for post-processing. decomposition method or as a volScalarField for post-processing.
@param -region regionName \n @param -region regionName \n
Decompose named region. Does not check for existence of processor*. Decompose named region. Does not check for existence of processor*.
@ -84,7 +84,12 @@ int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
# include "addRegionOption.H" # 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 argList::addBoolOption
( (
"copyUniform", "copyUniform",
@ -106,6 +111,11 @@ int main(int argc, char *argv[])
"only decompose geometry if the number of domains has changed" "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" # include "setRootCase.H"
word regionName = fvMesh::defaultRegion; word regionName = fvMesh::defaultRegion;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -50,8 +50,18 @@ int main(int argc, char *argv[])
timeSelector::addOptions(true, true); timeSelector::addOptions(true, true);
argList::noParallel(); argList::noParallel();
# include "addRegionOption.H" # include "addRegionOption.H"
argList::addOption("fields", "\"(list of fields)\""); argList::addOption
argList::addBoolOption("noLagrangian"); (
"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 "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -62,7 +72,7 @@ int main(int argc, char *argv[])
args.optionLookup("fields")() >> selectedFields; args.optionLookup("fields")() >> selectedFields;
} }
bool noLagrangian = args.optionFound("noLagrangian"); const bool noLagrangian = args.optionFound("noLagrangian");
// determine the processor count directly // determine the processor count directly
label nProcs = 0; label nProcs = 0;
@ -111,10 +121,10 @@ int main(int argc, char *argv[])
} }
# include "createNamedMesh.H" # include "createNamedMesh.H"
fileName regionPrefix = ""; word regionDir = word::null;
if (regionName != fvMesh::defaultRegion) if (regionName != fvMesh::defaultRegion)
{ {
regionPrefix = regionName; regionDir = regionName;
} }
// Set all times on processor meshes equal to reconstructed mesh // Set all times on processor meshes equal to reconstructed mesh
@ -289,7 +299,7 @@ int main(int argc, char *argv[])
( (
readDir readDir
( (
databases[procI].timePath()/regionPrefix/cloud::prefix, databases[procI].timePath() / regionDir / cloud::prefix,
fileName::DIRECTORY fileName::DIRECTORY
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -281,8 +281,23 @@ autoPtr<mapPolyMesh> mergeSharedPoints
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::noParallel(); argList::noParallel();
argList::addOption("mergeTol", "relative merge distance"); argList::addOption
argList::addBoolOption("fullMatch"); (
"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 "addTimeOptions.H"
# include "addRegionOption.H" # include "addRegionOption.H"
@ -306,11 +321,11 @@ int main(int argc, char *argv[])
word regionName = polyMesh::defaultRegion; word regionName = polyMesh::defaultRegion;
fileName regionPrefix = ""; word regionDir = word::null;
if (args.optionFound("region"))
if (args.optionReadIfPresent("region", regionName))
{ {
regionName = args.option("region"); regionDir = regionName;
regionPrefix = regionName;
Info<< "Operating on region " << regionName << nl << endl; Info<< "Operating on region " << regionName << nl << endl;
} }
@ -425,7 +440,7 @@ int main(int argc, char *argv[])
( (
databases[procI].findInstance databases[procI].findInstance
( (
regionPrefix/polyMesh::meshSubDir, regionDir / polyMesh::meshSubDir,
"points" "points"
) )
); );
@ -454,10 +469,10 @@ int main(int argc, char *argv[])
"points", "points",
databases[procI].findInstance databases[procI].findInstance
( (
regionPrefix/polyMesh::meshSubDir, regionDir / polyMesh::meshSubDir,
"points" "points"
), ),
regionPrefix/polyMesh::meshSubDir, regionDir / polyMesh::meshSubDir,
databases[procI], databases[procI],
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,

View File

@ -0,0 +1,10 @@
//
// addOverwriteOption.H
// ~~~~~~~~~~~~~~~~~~~~
Foam::argList::addOption
(
"overwrite",
"overwrite existing mesh/results files"
);