Merge branch 'olesenm'

This commit is contained in:
andy
2010-02-17 16:48:44 +00:00
158 changed files with 804 additions and 712 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
@ -90,7 +90,7 @@ int main(int argc, char *argv[])
if (args.optionFound("flag")) if (args.optionFound("flag"))
{ {
Info<<"-flag:" << args.option("flag") << endl; Info<<"-flag:" << args["flag"] << endl;
} }
if (args.optionReadIfPresent<scalar>("float", xxx)) if (args.optionReadIfPresent<scalar>("float", xxx))

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

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

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

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

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

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

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) 2009-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
argList args(argc, argv, false, true); argList args(argc, argv, false, true);
if (args.additionalArgs().empty()) if (args.size() <= 1)
{ {
args.printUsage(); args.printUsage();
} }
@ -73,9 +73,9 @@ int main(int argc, char *argv[])
useCatmullRom = true; 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; Info<< nl << "reading " << srcFile << nl;
IFstream ifs(srcFile); IFstream ifs(srcFile);

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
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Get name of patch // Get name of patch
word patchName(args.additionalArgs()[0]); const word patchName = args[1];
// Find the label in patches by name. // Find the label in patches by name.
label patchI = patches.findPatchID(patchName); label patchI = patches.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
@ -54,9 +54,9 @@ int main(int argc, char *argv[])
cpuTime timer; cpuTime timer;
for (label count = 0; count < repeat; ++count) 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) if (count == 0)
{ {
Info<< "input string: " << rawArg << nl; Info<< "input string: " << rawArg << nl;
@ -94,11 +94,11 @@ int main(int argc, char *argv[])
{ {
for (label count = 0; count < repeat; ++count) for (label count = 0; count < repeat; ++count)
{ {
IFstream is(args.option("file")); IFstream is(args["file"]);
if (count == 0) if (count == 0)
{ {
Info<< "tokenizing file: " << args.option("file") << nl; Info<< "tokenizing file: " << args["file"] << nl;
} }
while (is.good()) while (is.good())

View File

@ -17,7 +17,7 @@ FoamFile
// Surface to keep to // Surface to keep to
surface "plexi.ftr"; surface "plexi.obj";
// What is outside. These points have to be inside a cell (so not on a face!) // What is outside. These points have to be inside a cell (so not on a face!)
outsidePoints ((-0.99001 -0.99001 -0.99001)); outsidePoints ((-0.99001 -0.99001 -0.99001));

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)");
@ -464,9 +464,9 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])())); const scalar minLen = args.argRead<scalar>(1);
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])())); const scalar angle = args.argRead<scalar>(2);
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"
@ -439,18 +446,16 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); const scalar featureAngle = args.argRead<scalar>(1);
const scalar minCos = Foam::cos(degToRad(featureAngle));
scalar minCos = Foam::cos(degToRad(featureAngle));
// Sin of angle between two consecutive edges on a face. // Sin of angle between two consecutive edges on a face.
// If sin(angle) larger than this the face will be considered concave. // If sin(angle) larger than this the face will be considered concave.
scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0); scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0);
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"
@ -60,11 +60,9 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
word patchName(args.additionalArgs()[0]); const word patchName = args[1];
const scalar weight = args.argRead<scalar>(2);
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])())); const bool overwrite = args.optionFound("overwrite");
bool overwrite = args.optionFound("overwrite");
label patchID = mesh.boundaryMesh().findPatchID(patchName); label patchID = mesh.boundaryMesh().findPatchID(patchName);
@ -103,20 +101,17 @@ int main(int argc, char *argv[])
// List of cells to refine // List of cells to refine
// //
bool useSet = args.optionFound("useSet"); word setName;
if (args.optionReadIfPresent("useSet", setName))
if (useSet)
{ {
word setName(args.option("useSet")); Info<< "Subsetting cells to cut based on cellSet"
<< setName << nl << endl;
Info<< "Subsetting cells to cut based on cellSet" << setName << endl
<< endl;
cellSet cells(mesh, setName); cellSet cells(mesh, setName);
Info<< "Read " << cells.size() << " cells from cellSet " Info<< "Read " << cells.size() << " cells from cellSet "
<< cells.instance()/cells.local()/cells.name() << cells.instance()/cells.local()/cells.name()
<< endl << endl; << nl << endl;
for for
( (
@ -127,8 +122,8 @@ int main(int argc, char *argv[])
{ {
cutCells.erase(iter.key()); cutCells.erase(iter.key());
} }
Info<< "Removed from cells to cut all the ones not in set " << setName Info<< "Removed from cells to cut all the ones not in set "
<< endl << endl; << setName << nl << endl;
} }
// Mark all meshpoints on patch // Mark all meshpoints on patch
@ -182,9 +177,9 @@ int main(int argc, char *argv[])
allCutEdges.shrink(); allCutEdges.shrink();
allCutEdgeWeights.shrink(); allCutEdgeWeights.shrink();
Info<< "Cutting:" << endl Info<< "Cutting:" << nl
<< " cells:" << cutCells.size() << endl << " cells:" << cutCells.size() << nl
<< " edges:" << allCutEdges.size() << endl << " edges:" << allCutEdges.size() << nl
<< endl; << endl;
// Transfer DynamicLists to straight ones. // Transfer DynamicLists to straight ones.

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,9 +57,8 @@ 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 word setName = args[1];
const bool overwrite = args.optionFound("overwrite");
word setName(args.additionalArgs()[0]);
// Read faces // Read faces
faceSet candidateSet(mesh, setName); faceSet candidateSet(mesh, setName);

View File

@ -21,7 +21,7 @@ FoamFile
useSurface false; useSurface false;
// Surface to keep to // Surface to keep to
surface "plexi.ftr"; surface "plexi.obj";
// What is outside // What is outside
outsidePoints ((-1 -1 -1)); outsidePoints ((-1 -1 -1));

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"
@ -537,14 +537,13 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); const scalar featureAngle = args.argRead<scalar>(1);
const scalar minCos = Foam::cos(degToRad(featureAngle));
const scalar minSin = Foam::sin(degToRad(featureAngle));
scalar minCos = Foam::cos(degToRad(featureAngle)); const bool readSet = args.optionFound("set");
scalar minSin = Foam::sin(degToRad(featureAngle)); const bool geometry = args.optionFound("geometry");
const bool overwrite = args.optionFound("overwrite");
bool readSet = args.optionFound("set");
bool geometry = args.optionFound("geometry");
bool overwrite = args.optionFound("overwrite");
scalar edgeTol = args.optionLookupOrDefault("tol", 0.2); scalar edgeTol = args.optionLookupOrDefault("tol", 0.2);
@ -553,7 +552,7 @@ int main(int argc, char *argv[])
<< "edge snapping tol : " << edgeTol << nl; << "edge snapping tol : " << edgeTol << nl;
if (readSet) if (readSet)
{ {
Info<< "candidate cells : cellSet " << args.option("set") << nl; Info<< "candidate cells : cellSet " << args["set"] << nl;
} }
else else
{ {
@ -581,7 +580,7 @@ int main(int argc, char *argv[])
if (readSet) if (readSet)
{ {
// Read cells to cut from cellSet // Read cells to cut from cellSet
cellSet cells(mesh, args.option("set")); cellSet cells(mesh, args["set"]);
cellsToCut = cells; cellsToCut = cells;
} }

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

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
@ -26,7 +26,8 @@ Application
ansysToFoam ansysToFoam
Description 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" # include "createTime.H"
fileName ansysFile(args.additionalArgs()[0]); const fileName ansysFile = args[1];
ifstream ansysStream(ansysFile.c_str()); ifstream ansysStream(ansysFile.c_str());
if (!ansysStream) if (!ansysStream)

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

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

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

View File

@ -199,7 +199,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
fluentMeshFile << l.size() << " "; fluentMeshFile << l.size() << " ";
// Note: In Fluent, all boundary faces point inwards, which is // 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) forAllReverse (l, lI)
{ {
fluentMeshFile << l[lI] + 1 << " "; fluentMeshFile << l[lI] + 1 << " ";

View File

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

View File

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

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
@ -26,7 +26,7 @@ Application
gambitToFoam gambitToFoam
Description 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" # include "createTime.H"
fileName gambitFile(args.additionalArgs()[0]); const fileName gambitFile = args[1];
ifstream gambitStream(gambitFile.c_str()); ifstream gambitStream(gambitFile.c_str());
if (!gambitStream) if (!gambitStream)

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

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

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
@ -26,7 +26,7 @@ Application
kivaToFoam kivaToFoam
Description Description
Converts a KIVA3v grid to FOAM format Converts a KIVA3v grid to OpenFOAM format
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -68,15 +68,12 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
fileName kivaFileName("otape17"); fileName kivaFileName("otape17");
if (args.optionFound("file")) args.optionReadIfPresent("file", kivaFileName);
{
kivaFileName = args.option("file");
}
kivaVersions kivaVersion = kiva3v; kivaVersions kivaVersion = kiva3v;
if (args.optionFound("version")) if (args.optionFound("version"))
{ {
word kivaVersionName = args.option("version"); const word kivaVersionName = args["version"];
if (kivaVersionName == "kiva3") if (kivaVersionName == "kiva3")
{ {

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

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

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

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

View File

@ -30,6 +30,6 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define starMesh sammMesh #define starMesh sammMesh
#include "../starToFoam/readPoints.C" #include "../star3ToFoam/readPoints.C"
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,7 +47,7 @@ const cellModel* sammMesh::sammTrim4Ptr_ = cellModeller::lookup("sammTrim4");
const cellModel* sammMesh::sammTrim5Ptr_ = cellModeller::lookup("sammTrim5"); const cellModel* sammMesh::sammTrim5Ptr_ = cellModeller::lookup("sammTrim5");
const cellModel* sammMesh::sammTrim8Ptr_ = cellModeller::lookup("hexagonalPrism"); 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 index) and STAR face number
// - first column is always -1 // - first column is always -1
// - last column is -1 for all but hexagonal prism // - last column is -1 for all but hexagonal prism

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
@ -26,7 +26,7 @@ Application
sammToFoam sammToFoam
Description 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" # include "createTime.H"
fileName sammFile(args.additionalArgs()[0]); sammMesh makeMesh(args[1], runTime, scaleFactor);
sammMesh makeMesh(sammFile, runTime, scaleFactor);
// Set the precision of the points data to 10 // Set the precision of the points data to 10
IOstream::defaultPrecision(10); IOstream::defaultPrecision(10);

View File

@ -14,6 +14,6 @@ createBoundaryFaces.C
createPolyBoundary.C createPolyBoundary.C
purgeCellShapes.C purgeCellShapes.C
writeMesh.C writeMesh.C
starToFoam.C star3ToFoam.C
EXE = $(FOAM_APPBIN)/starToFoam EXE = $(FOAM_APPBIN)/star3ToFoam

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
@ -23,10 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application Application
starToFoam star3ToFoam
Description 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" # include "createTime.H"
fileName starMeshFile(args.additionalArgs()[0]); starMesh makeMesh(args[1], runTime, scaleFactor);
starMesh makeMesh(starMeshFile, runTime, scaleFactor);
// Set the precision of the points data to 10 // Set the precision of the points data to 10
IOstream::defaultPrecision(10); IOstream::defaultPrecision(10);

View File

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

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

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

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
@ -463,7 +463,7 @@ int main(int argc, char *argv[])
} }
if (doCellSet) if (doCellSet)
{ {
word setName(args.option("cellSet")); const word setName = args["cellSet"];
cellSet cells(mesh, setName); cellSet cells(mesh, setName);
@ -475,7 +475,7 @@ int main(int argc, char *argv[])
} }
if (doFaceSet) if (doFaceSet)
{ {
word setName(args.option("faceSet")); const word setName = args["faceSet"];
faceSet faces(mesh, setName); faceSet faces(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
@ -110,7 +110,7 @@ int main(int argc, char *argv[])
if (args.optionFound("dict")) if (args.optionFound("dict"))
{ {
fileName dictPath(args.option("dict")); const fileName dictPath = args["dict"];
meshDictIoPtr.set meshDictIoPtr.set
( (

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,16 +56,17 @@ 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();
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])())); const scalar thickness = args.argRead<scalar>(1);
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"
@ -84,21 +84,20 @@ int main(int argc, char *argv[])
<< " s\n" << endl << endl; << " s\n" << endl << endl;
// const scalar featureAngle = args.argRead<scalar>(1);
// Use boundaryMesh to reuse all the featureEdge stuff in there. const bool overwrite = args.optionFound("overwrite");
//
boundaryMesh bMesh; const scalar minCos = Foam::cos(degToRad(featureAngle));
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
bool overwrite = args.optionFound("overwrite");
scalar minCos = Foam::cos(degToRad(featureAngle));
Info<< "Feature:" << featureAngle << endl Info<< "Feature:" << featureAngle << endl
<< "minCos :" << minCos << endl << "minCos :" << minCos << endl
<< endl; << endl;
//
// Use boundaryMesh to reuse all the featureEdge stuff in there.
//
boundaryMesh bMesh;
bMesh.read(mesh); bMesh.read(mesh);
// Set feature angle (calculate feature edges) // Set feature angle (calculate feature edges)

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"
@ -142,7 +143,7 @@ int main(int argc, char *argv[])
const faceZoneMesh& faceZones = mesh.faceZones(); const faceZoneMesh& faceZones = mesh.faceZones();
// Faces to baffle // Faces to baffle
faceZoneID zoneID(args.additionalArgs()[0], faceZones); faceZoneID zoneID(args[1], faceZones);
Info<< "Converting faces on zone " << zoneID.name() Info<< "Converting faces on zone " << zoneID.name()
<< " into baffles." << nl << endl; << " into baffles." << nl << endl;
@ -167,7 +168,7 @@ int main(int argc, char *argv[])
// Patches to put baffles into // Patches to put baffles into
DynamicList<label> newPatches(1); DynamicList<label> newPatches(1);
word patchName(args.additionalArgs()[1]); const word patchName = args[2];
newPatches.append(findPatchID(mesh, patchName)); newPatches.append(findPatchID(mesh, patchName));
Info<< "Using patch " << patchName Info<< "Using patch " << patchName
<< " at index " << newPatches[0] << endl; << " at index " << newPatches[0] << endl;
@ -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
@ -47,7 +47,7 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])())); const scalar scaleFactor = args.argRead<scalar>(1);
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.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
@ -51,9 +51,8 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createPolyMesh.H" # include "createPolyMesh.H"
fileName surfName(args.additionalArgs()[0]); const fileName surfName = args[1];
fileName setName(args.additionalArgs()[1]); const fileName setName = args[2];
// Read surface // Read surface
Info<< "Reading surface from " << surfName << endl; Info<< "Reading surface from " << surfName << 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

View File

@ -15,13 +15,13 @@
FatalError.exit(); FatalError.exit();
} }
fileName rootDirMaster(args.additionalArgs()[0]); fileName rootDirMaster = args[1];
fileName caseDirMaster(args.additionalArgs()[1]); fileName caseDirMaster = args[2];
word masterRegion = polyMesh::defaultRegion; word masterRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("masterRegion", masterRegion); args.optionReadIfPresent("masterRegion", masterRegion);
fileName rootDirToAdd(args.additionalArgs()[2]); fileName rootDirToAdd = args[3];
fileName caseDirToAdd(args.additionalArgs()[3]); fileName caseDirToAdd = args[4];
word addRegion = polyMesh::defaultRegion; word addRegion = polyMesh::defaultRegion;
args.optionReadIfPresent("addRegion", addRegion); args.optionReadIfPresent("addRegion", addRegion);
@ -29,3 +29,4 @@
<< " region " << masterRegion << nl << " region " << masterRegion << nl
<< "mesh to add: " << rootDirToAdd << " " << caseDirToAdd << "mesh to add: " << rootDirToAdd << " " << caseDirToAdd
<< " region " << addRegion << endl; << " region " << addRegion << 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
@ -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
@ -116,8 +116,8 @@ int main(int argc, char *argv[])
argList::validArgs.append("output VTK file"); argList::validArgs.append("output VTK file");
argList::argList args(argc, argv); argList::argList args(argc, argv);
fileName objName(args.additionalArgs()[0]); const fileName objName = args[1];
fileName outName(args.additionalArgs()[1]); const fileName outName = args[2];
std::ifstream OBJfile(objName.c_str()); std::ifstream OBJfile(objName.c_str());

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

@ -2,8 +2,8 @@
========= | ========= |
\\ / 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 anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -75,10 +75,10 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
vector n1(IStringStream(args.additionalArgs()[0])()); vector n1 = args.argRead<vector>(1);
n1 /= mag(n1); n1 /= mag(n1);
vector n2(IStringStream(args.additionalArgs()[1])()); vector n2 = args.argRead<vector>(2);
n2 /= mag(n2); n2 /= mag(n2);
tensor T = rotationTensor(n1, n2); tensor T = rotationTensor(n1, n2);

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
@ -835,15 +835,14 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args); instantList timeDirs = timeSelector::select0(runTime, args);
bool writeVTK = !args.optionFound("noVTK"); const bool writeVTK = !args.optionFound("noVTK");
bool loop = args.optionFound("loop"); const bool loop = args.optionFound("loop");
bool batch = args.optionFound("batch"); const bool batch = args.optionFound("batch");
if (loop && !batch) if (loop && !batch)
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Can only loop when in batch mode." << "Can only loop in batch mode."
<< exit(FatalError); << exit(FatalError);
} }
@ -885,7 +884,7 @@ int main(int argc, char *argv[])
if (batch) if (batch)
{ {
fileName batchFile(args.option("batch")); const fileName batchFile = args["batch"];
Info<< "Reading commands from file " << batchFile << endl; Info<< "Reading commands from file " << batchFile << endl;

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"
@ -123,10 +123,10 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H" # include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
word setName(args.additionalArgs()[0]); const word setName = args[1];
word masterPatch(args.additionalArgs()[1]); const word masterPatch = args[2];
word slavePatch(args.additionalArgs()[2]); const word slavePatch = args[3];
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");
@ -1326,21 +1326,20 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
word blockedFacesName; word blockedFacesName;
if (args.optionFound("blockedFaces")) if (args.optionReadIfPresent("blockedFaces", blockedFacesName))
{ {
blockedFacesName = args.option("blockedFaces");
Info<< "Reading blocked internal faces from faceSet " Info<< "Reading blocked internal faces from faceSet "
<< 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)
{ {
@ -1882,7 +1881,7 @@ int main(int argc, char *argv[])
if (insidePoint) if (insidePoint)
{ {
point insidePoint(args.optionLookup("insidePoint")()); const point insidePoint = args.optionRead<point>("insidePoint");
label regionI = -1; label regionI = -1;

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");
@ -113,13 +113,12 @@ int main(int argc, char *argv[])
# include "createNamedMesh.H" # include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
const word masterPatchName = args[1];
const word slavePatchName = args[2];
word masterPatchName(args.additionalArgs()[0]); const bool partialCover = args.optionFound("partial");
word slavePatchName(args.additionalArgs()[1]); const bool perfectCover = args.optionFound("perfect");
const bool overwrite = args.optionFound("overwrite");
bool partialCover = args.optionFound("partial");
bool perfectCover = args.optionFound("perfect");
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"
@ -161,8 +161,8 @@ int main(int argc, char *argv[])
# include "createMesh.H" # include "createMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
word setName(args.additionalArgs()[0]); const word setName = args[1];
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;
@ -174,7 +174,7 @@ int main(int argc, char *argv[])
if (args.optionFound("patch")) if (args.optionFound("patch"))
{ {
word patchName(args.option("patch")); const word patchName = args["patch"];
patchI = mesh.boundaryMesh().findPatchID(patchName); patchI = 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
@ -210,7 +210,9 @@ int main(int argc, char *argv[])
) )
); );
const bool doRotateFields = args.optionFound("rotateFields");
// this is not actually stringent enough:
if (args.options().empty()) if (args.options().empty())
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
@ -219,18 +221,20 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
if (args.optionFound("translate")) vector v;
if (args.optionReadIfPresent("translate", v))
{ {
vector transVector(args.optionLookup("translate")()); Info<< "Translating points by " << v << endl;
Info<< "Translating points by " << transVector << endl; points += v;
points += transVector;
} }
if (args.optionFound("rotate")) if (args.optionFound("rotate"))
{ {
Pair<vector> n1n2(args.optionLookup("rotate")()); Pair<vector> n1n2
(
args.optionLookup("rotate")()
);
n1n2[0] /= mag(n1n2[0]); n1n2[0] /= mag(n1n2[0]);
n1n2[1] /= mag(n1n2[1]); n1n2[1] /= mag(n1n2[1]);
tensor T = rotationTensor(n1n2[0], n1n2[1]); tensor T = rotationTensor(n1n2[0], n1n2[1]);
@ -239,20 +243,17 @@ int main(int argc, char *argv[])
points = transform(T, points); points = transform(T, points);
if (args.optionFound("rotateFields")) if (doRotateFields)
{ {
rotateFields(args, runTime, T); rotateFields(args, runTime, T);
} }
} }
else if (args.optionFound("rollPitchYaw")) else if (args.optionReadIfPresent("rollPitchYaw", v))
{ {
vector v(args.optionLookup("rollPitchYaw")());
Info<< "Rotating points by" << nl Info<< "Rotating points by" << nl
<< " roll " << v.x() << nl << " roll " << v.x() << nl
<< " pitch " << v.y() << nl << " pitch " << v.y() << nl
<< " yaw " << v.z() << endl; << " yaw " << v.z() << nl;
// Convert to radians // Convert to radians
v *= pi/180.0; v *= pi/180.0;
@ -262,20 +263,17 @@ int main(int argc, char *argv[])
Info<< "Rotating points by quaternion " << R << endl; Info<< "Rotating points by quaternion " << R << endl;
points = transform(R, points); points = transform(R, points);
if (args.optionFound("rotateFields")) if (doRotateFields)
{ {
rotateFields(args, runTime, R.R()); rotateFields(args, runTime, R.R());
} }
} }
else if (args.optionFound("yawPitchRoll")) else if (args.optionReadIfPresent("yawPitchRoll", v))
{ {
vector v(args.optionLookup("yawPitchRoll")());
Info<< "Rotating points by" << nl Info<< "Rotating points by" << nl
<< " yaw " << v.x() << nl << " yaw " << v.x() << nl
<< " pitch " << v.y() << nl << " pitch " << v.y() << nl
<< " roll " << v.z() << endl; << " roll " << v.z() << nl;
// Convert to radians // Convert to radians
v *= pi/180.0; v *= pi/180.0;
@ -291,21 +289,19 @@ int main(int argc, char *argv[])
Info<< "Rotating points by quaternion " << R << endl; Info<< "Rotating points by quaternion " << R << endl;
points = transform(R, points); points = transform(R, points);
if (args.optionFound("rotateFields")) if (doRotateFields)
{ {
rotateFields(args, runTime, R.R()); rotateFields(args, runTime, R.R());
} }
} }
if (args.optionFound("scale")) if (args.optionReadIfPresent("scale", v))
{ {
vector scaleVector(args.optionLookup("scale")()); Info<< "Scaling points by " << v << endl;
Info<< "Scaling points by " << scaleVector << endl; points.replace(vector::X, v.x()*points.component(vector::X));
points.replace(vector::Y, v.y()*points.component(vector::Y));
points.replace(vector::X, scaleVector.x()*points.component(vector::X)); points.replace(vector::Z, v.z()*points.component(vector::Z));
points.replace(vector::Y, scaleVector.y()*points.component(vector::Y));
points.replace(vector::Z, scaleVector.z()*points.component(vector::Z));
} }
// Set the precision of the points data to 10 // Set the precision of the points data to 10

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

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
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
{ {
fileName dictFileName fileName dictFileName
( (
args.rootPath()/args.caseName()/args.option("dictionary") args.rootPath()/args.caseName()/args["dictionary"]
); );
IFstream dictFile(dictFileName); IFstream dictFile(dictFileName);
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
true // wildcards true // wildcards
); );
for (int i=1; i<entryNames.size(); i++) for (int i=1; i<entryNames.size(); ++i)
{ {
if (entPtr->dict().found(entryNames[i])) if (entPtr->dict().found(entryNames[i]))
{ {
@ -118,7 +118,7 @@ int main(int argc, char *argv[])
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Cannot find sub-entry " << entryNames[i] << "Cannot find sub-entry " << entryNames[i]
<< " in entry " << args.option("entry") << " in entry " << args["entry"]
<< " in dictionary " << dictFileName; << " in dictionary " << dictFileName;
FatalError.exit(3); FatalError.exit(3);
} }
@ -131,7 +131,7 @@ int main(int argc, char *argv[])
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Cannot find entry " << "Cannot find entry "
<< args.option("entry") << args["entry"]
<< " in dictionary " << dictFileName << " in dictionary " << dictFileName
<< " is not a sub-dictionary"; << " is not a sub-dictionary";
FatalError.exit(4); FatalError.exit(4);

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
@ -309,7 +319,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

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

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
@ -80,7 +80,10 @@ Foam::ensightMesh::ensightMesh
if (args.optionFound("patches")) if (args.optionFound("patches"))
{ {
wordList patchNameList(args.optionLookup("patches")()); wordList patchNameList
(
args.optionLookup("patches")()
);
if (patchNameList.empty()) if (patchNameList.empty())
{ {

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / 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
@ -215,9 +215,8 @@ int main(int argc, char *argv[])
word cellSetName; word cellSetName;
string vtkName; string vtkName;
if (args.optionFound("cellSet")) if (args.optionReadIfPresent("cellSet", cellSetName))
{ {
cellSetName = args.option("cellSet");
vtkName = cellSetName; vtkName = cellSetName;
} }
else if (Pstream::parRun()) else if (Pstream::parRun())
@ -738,7 +737,7 @@ int main(int argc, char *argv[])
if (args.optionFound("faceSet")) if (args.optionFound("faceSet"))
{ {
// Load the faceSet // Load the faceSet
word setName(args.option("faceSet")); const word setName = args["faceSet"];
labelList faceLabels(faceSet(mesh, setName).toc()); labelList faceLabels(faceSet(mesh, setName).toc());
// Filename as if patch with same name. // Filename as if patch with same name.

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
@ -329,9 +329,8 @@ int main(int argc, char *argv[])
word cellSetName; word cellSetName;
string vtkName = runTime.caseName(); string vtkName = runTime.caseName();
if (args.optionFound("cellSet")) if (args.optionReadIfPresent("cellSet", cellSetName))
{ {
cellSetName = args.option("cellSet");
vtkName = cellSetName; vtkName = cellSetName;
} }
else if (Pstream::parRun()) else if (Pstream::parRun())
@ -423,7 +422,7 @@ int main(int argc, char *argv[])
if (args.optionFound("faceSet")) if (args.optionFound("faceSet"))
{ {
// Load the faceSet // Load the faceSet
faceSet set(mesh, args.option("faceSet")); faceSet set(mesh, args["faceSet"]);
// Filename as if patch with same name. // Filename as if patch with same name.
mkDir(fvPath/set.name()); mkDir(fvPath/set.name());
@ -446,7 +445,7 @@ int main(int argc, char *argv[])
if (args.optionFound("pointSet")) if (args.optionFound("pointSet"))
{ {
// Load the pointSet // Load the pointSet
pointSet set(mesh, args.option("pointSet")); pointSet set(mesh, args["pointSet"]);
// Filename as if patch with same name. // Filename as if patch with same name.
mkDir(fvPath/set.name()); mkDir(fvPath/set.name());

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

Some files were not shown because too many files have changed in this diff Show More