Commit d1295da3 authored by Mark Olesen's avatar Mark Olesen
Browse files

adjust solvers and utilities to use new argList methods

- also drop various unused time options from src/OpenFOAM/include
parent 724b034c
......@@ -47,11 +47,7 @@
);
word kinematicCloudName("kinematicCloud");
if (args.options().found("cloudName"))
{
kinematicCloudName = args.options()["cloudName"];
}
args.optionReadIfPresent("cloudName", kinematicCloudName);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicCloud kinematicCloud
......
......@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
U.write();
phi.write();
if (args.options().found("writep"))
if (args.optionFound("writep"))
{
p.write();
}
......
......@@ -465,7 +465,7 @@ int main(int argc, char *argv[])
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
scalar maxCos = Foam::cos(angle*180/mathematicalConstant::pi);
......
......@@ -448,19 +448,12 @@ int main(int argc, char *argv[])
scalar minCos = Foam::cos(featureAngle*mathematicalConstant::pi/180.0);
scalar concaveAngle = defaultConcaveAngle;
if (args.options().found("concaveAngle"))
{
concaveAngle = readScalar
(
IStringStream(args.options()["concaveAngle"])()
);
}
args.optionReadIfPresent("concaveAngle", concaveAngle);
scalar concaveSin = Foam::sin(concaveAngle*mathematicalConstant::pi/180.0);
bool snapMeshDict = args.options().found("snapMesh");
bool overwrite = args.options().found("overwrite");
bool snapMeshDict = args.optionFound("snapMesh");
bool overwrite = args.optionFound("overwrite");
Info<< "Merging all faces of a cell" << nl
<< " - which are on the same patch" << nl
......
......@@ -336,7 +336,7 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
Info<< "Reading modifyMeshDict\n" << endl;
......
......@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
pointMesh pMesh(mesh);
word cellSetName(args.args()[1]);
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
Info<< "Reading cells to refine from cellSet " << cellSetName
<< nl << endl;
......
......@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
word patchName(args.additionalArgs()[0]);
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
label patchID = mesh.boundaryMesh().findPatchID(patchName);
......@@ -101,11 +101,11 @@ int main(int argc, char *argv[])
// List of cells to refine
//
bool useSet = args.options().found("useSet");
bool useSet = args.optionFound("useSet");
if (useSet)
{
word setName(args.options()["useSet"]);
word setName(args.option("useSet"));
Info<< "Subsetting cells to cut based on cellSet" << setName << endl
<< endl;
......
......@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
<< " to allow for some truncation error."
<< nl << endl;
bool readLevel = args.options().found("readLevel");
bool readLevel = args.optionFound("readLevel");
const scalarField& vols = mesh.cellVolumes();
......
......@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
# include "createMesh.H"
const word oldInstance = mesh.pointsInstance();
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
word setName(args.additionalArgs()[0]);
......
......@@ -542,23 +542,19 @@ int main(int argc, char *argv[])
scalar minCos = Foam::cos(radAngle);
scalar minSin = Foam::sin(radAngle);
bool readSet = args.options().found("set");
bool geometry = args.options().found("geometry");
bool overwrite = args.options().found("overwrite");
bool readSet = args.optionFound("set");
bool geometry = args.optionFound("geometry");
bool overwrite = args.optionFound("overwrite");
scalar edgeTol = 0.2;
if (args.options().found("tol"))
{
edgeTol = readScalar(IStringStream(args.options()["tol"])());
}
args.optionReadIfPresent("tol", edgeTol);
Info<< "Trying to split cells with internal angles > feature angle\n" << nl
<< "featureAngle : " << featureAngle << nl
<< "edge snapping tol : " << edgeTol << nl;
if (readSet)
{
Info<< "candidate cells : cellSet " << args.options()["set"] << nl;
Info<< "candidate cells : cellSet " << args.option("set") << nl;
}
else
{
......@@ -586,7 +582,7 @@ int main(int argc, char *argv[])
if (readSet)
{
// Read cells to cut from cellSet
cellSet cells(mesh, args.options()["set"]);
cellSet cells(mesh, args.option("set"));
cellsToCut = cells;
}
......
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
......@@ -246,10 +246,7 @@ int main(int argc, char *argv[])
}
scalar scaleFactor = 1.0;
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
# include "createTime.H"
......
......@@ -60,10 +60,7 @@ int main(int argc, char *argv[])
}
scalar scaleFactor = 1.0;
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
# include "createTime.H"
......
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
......@@ -760,21 +760,18 @@ int main(int argc, char *argv[])
FatalError.exit();
}
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
HashSet<word> ignoreCellGroups;
if (args.options().found("ignoreCellGroups"))
if (args.optionFound("ignoreCellGroups"))
{
IStringStream(args.options()["ignoreCellGroups"])() >> ignoreCellGroups;
args.optionLookup("ignoreCellGroups")() >> ignoreCellGroups;
}
HashSet<word> ignoreFaceGroups;
if (args.options().found("ignoreFaceGroups"))
if (args.optionFound("ignoreFaceGroups"))
{
IStringStream(args.options()["ignoreFaceGroups"])() >> ignoreFaceGroups;
args.optionLookup("ignoreFaceGroups")() >> ignoreFaceGroups;
}
# include "createTime.H"
......
......@@ -879,13 +879,10 @@ int main(int argc, char *argv[])
}
scalar scaleFactor = 1.0;
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
bool writeSets = args.options().found("writeSets");
bool writeZones = args.options().found("writeZones");
bool writeSets = args.optionFound("writeSets");
bool writeZones = args.optionFound("writeZones");
# include "createTime.H"
......
......@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args);
bool surfaceOnly = false;
if (args.options().found("surface") or args.options().found("tri"))
if (args.optionFound("surface") || args.optionFound("tri"))
{
surfaceOnly = true;
}
......@@ -98,16 +98,15 @@ int main(int argc, char *argv[])
exportName = meshWriter::defaultSurfaceName;
}
if (args.options().found("case"))
if (args.optionFound("case"))
{
exportName += '-' + args.globalCaseName();
}
// default: rescale from [m] to [mm]
scalar scaleFactor = 1000;
if (args.options().found("scale"))
if (args.optionReadIfPresent("scale", scaleFactor))
{
scaleFactor = readScalar(IStringStream(args.options()["scale"])());
if (scaleFactor <= 0)
{
scaleFactor = 1;
......@@ -129,7 +128,7 @@ int main(int argc, char *argv[])
{
meshWriters::STARCD writer(mesh, scaleFactor);
if (args.options().found("noBnd"))
if (args.optionFound("noBnd"))
{
writer.noBoundary();
}
......@@ -142,7 +141,7 @@ int main(int argc, char *argv[])
if (surfaceOnly)
{
if (args.options().found("tri"))
if (args.optionFound("tri"))
{
writer.writeSurface(meshName, true);
}
......
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
......@@ -646,10 +646,7 @@ int main(int argc, char *argv[])
}
scalar scaleFactor = 1.0;
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
# include "createTime.H"
......
......@@ -689,7 +689,7 @@ int main(int argc, char *argv[])
fileName mshName(args.additionalArgs()[0]);
bool keepOrientation = args.options().found("keepOrientation");
bool keepOrientation = args.optionFound("keepOrientation");
// Storage for points
pointField points;
......
......@@ -852,7 +852,7 @@ int main(int argc, char *argv[])
// For debugging: dump boundary faces as triSurface
if (args.options().found("dump"))
if (args.optionFound("dump"))
{
DynamicList<labelledTri> triangles(boundaryFaces.size());
......
......@@ -68,15 +68,15 @@ int main(int argc, char *argv[])
# include "createTime.H"
fileName kivaFileName("otape17");
if (args.options().found("file"))
if (args.optionFound("file"))
{
kivaFileName = args.options()["file"];
kivaFileName = args.option("file");
}
kivaVersions kivaVersion = kiva3v;
if (args.options().found("version"))
if (args.optionFound("version"))
{
word kivaVersionName = args.options()["version"];
word kivaVersionName = args.option("version");
if (kivaVersionName == "kiva3")
{
......@@ -99,10 +99,7 @@ int main(int argc, char *argv[])
}
scalar zHeadMin = -GREAT;
if (args.options().found("zHeadMin"))
{
zHeadMin = atof(args.options()["zHeadMin"].c_str());
}
args.optionReadIfPresent("zHeadMin", zHeadMin);
# include "readKivaGrid.H"
......
......@@ -62,14 +62,12 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
bool readHex(args.options().found("hex"));
bool readHex = args.optionFound("hex");
fileName mshFile(args.additionalArgs()[0]);
IFstream mshStream(mshFile);
label nCells;
mshStream >> nCells;
if (readHex)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment