ENH: simplify method names for reading argList options and arguments

- use succincter method names that more closely resemble dictionary
  and HashTable method names. This improves method name consistency
  between classes and also requires less typing effort:

    args.found(optName)        vs.  args.optionFound(optName)
    args.readIfPresent(..)     vs.  args.optionReadIfPresent(..)
    ...
    args.opt<scalar>(optName)  vs.  args.optionRead<scalar>(optName)
    args.read<scalar>(index)   vs.  args.argRead<scalar>(index)

- the older method names forms have been retained for code compatibility,
  but are now deprecated
This commit is contained in:
Mark Olesen 2018-01-08 15:35:18 +01:00
parent 2feb11dbeb
commit 345a2a42f1
168 changed files with 1161 additions and 1040 deletions

View File

@ -28,7 +28,7 @@ surfaceScalarField phi
fvc::flux(U)
);
if (args.optionFound("initialiseUBCs"))
if (args.found("initialiseUBCs"))
{
U.correctBoundaryConditions();
phi = fvc::flux(U);
@ -41,7 +41,7 @@ if (args.optionFound("initialiseUBCs"))
word pName("p");
// Update name of the pressure field from the command-line option
args.optionReadIfPresent("pName", pName);
args.readIfPresent("pName", pName);
// Infer the pressure BCs from the velocity
wordList pBCTypes

View File

@ -28,7 +28,7 @@ surfaceScalarField phi
fvc::flux(U)
);
if (args.optionFound("initialiseUBCs"))
if (args.found("initialiseUBCs"))
{
U.correctBoundaryConditions();
phi = fvc::flux(U);
@ -41,7 +41,7 @@ if (args.optionFound("initialiseUBCs"))
word pName("p");
// Update name of the pressure field from the command-line option
args.optionReadIfPresent("pName", pName);
args.readIfPresent("pName", pName);
// Infer the pressure BCs from the velocity
wordList pBCTypes

View File

@ -193,13 +193,13 @@ int main(int argc, char *argv[])
phi.write();
// Optionally write Phi
if (args.optionFound("writePhi"))
if (args.found("writePhi"))
{
Phi.write();
}
// Calculate the pressure field from the Euler equation
if (args.optionFound("writep"))
if (args.found("writep"))
{
Info<< nl << "Calculating approximate pressure field" << endl;

View File

@ -181,13 +181,13 @@ int main(int argc, char *argv[])
phi.write();
// Optionally write Phi
if (args.optionFound("writePhi"))
if (args.found("writePhi"))
{
Phi.write();
}
// Calculate the pressure field from the Euler equation
if (args.optionFound("writep"))
if (args.found("writep"))
{
Info<< nl << "Calculating approximate pressure field" << endl;

View File

@ -86,7 +86,7 @@ int main(int argc, char *argv[])
psi.write();
if (!args.optionFound("noH") || args.optionFound("HdotGradH"))
if (!args.found("noH") || args.found("HdotGradH"))
{
volVectorField H
(
@ -99,7 +99,7 @@ int main(int argc, char *argv[])
fvc::reconstruct(fvc::snGrad(psi)*mesh.magSf())
);
if (!args.optionFound("noH"))
if (!args.found("noH"))
{
Info<< nl
<< "Creating field H for time "
@ -108,7 +108,7 @@ int main(int argc, char *argv[])
H.write();
}
if (args.optionFound("HdotGradH"))
if (args.found("HdotGradH"))
{
Info<< nl
<< "Creating field HdotGradH for time "
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
}
}
if (!args.optionFound("noB"))
if (!args.found("noB"))
{
Info<< nl
<< "Creating field B for time "

View File

@ -123,7 +123,7 @@ volScalarField alphac
);
word kinematicCloudName("kinematicCloud");
args.optionReadIfPresent("cloud", kinematicCloudName);
args.readIfPresent("cloud", kinematicCloudName);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicTypeCloud kinematicCloud

View File

@ -58,7 +58,7 @@ volScalarField mu
);
word kinematicCloudName("kinematicCloud");
args.optionReadIfPresent("cloud", kinematicCloudName);
args.readIfPresent("cloud", kinematicCloudName);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicCollidingCloud kinematicCloud

View File

@ -51,7 +51,7 @@ autoPtr<compressible::turbulenceModel> turbulence
const word kinematicCloudName
(
args.optionLookupOrDefault<word>("cloud", "kinematicCloud")
args.lookupOrDefault<word>("cloud", "kinematicCloud")
);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;

View File

@ -96,7 +96,7 @@ int main(int argc, char *argv[])
Info<< nl << "Specify an option! " << nl << endl;
}
if (args.optionFound("label"))
if (args.found("label"))
{
FixedList<label, 100000> list1(1);
FixedList<label, 100000> list2(0);
@ -104,7 +104,7 @@ int main(int argc, char *argv[])
runSwapTest(1000001, list1, list2);
}
if (args.optionFound("float"))
if (args.found("float"))
{
FixedList<double, 100000> list1(1.0);
FixedList<double, 100000> list2(0.0);
@ -112,7 +112,7 @@ int main(int argc, char *argv[])
runSwapTest(1000001, list1, list2);
}
if (args.optionFound("vector"))
if (args.found("vector"))
{
FixedList<vector, 100000> list1(vector::one);
FixedList<vector, 100000> list2(vector::zero);
@ -120,7 +120,7 @@ int main(int argc, char *argv[])
runSwapTest(100001, list1, list2);
}
if (args.optionFound("labelList"))
if (args.found("labelList"))
{
typedef labelList testType;
testType initVal(500);
@ -134,7 +134,7 @@ int main(int argc, char *argv[])
runSwapTest(100001, list1, list2);
}
if (args.optionFound("vectorList"))
if (args.found("vectorList"))
{
typedef vectorList testType;
testType initVal(500);
@ -148,7 +148,7 @@ int main(int argc, char *argv[])
runSwapTest(100001, list1, list2);
}
if (args.optionFound("fixedLabel"))
if (args.found("fixedLabel"))
{
typedef FixedList<label,1000> testType;
@ -163,7 +163,7 @@ int main(int argc, char *argv[])
runSwapTest(100001, list1, list2);
}
if (args.optionFound("fixedLabelList"))
if (args.found("fixedLabelList"))
{
typedef labelList testType;
typedef FixedList<testType,10> containerType;

View File

@ -53,8 +53,8 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
bool writeObj = args.optionFound("writeObj");
bool normalise = args.optionFound("normalise");
bool writeObj = args.found("writeObj");
bool normalise = args.found("normalise");
#include "createMesh.H"

View File

@ -151,9 +151,9 @@ int main(int argc, char *argv[])
argList args(argc, argv);
const bool optStd = args.optionFound("std");
const bool optSet = args.optionFound("set");
const bool optFnd = args.optionFound("find");
const bool optStd = args.found("std");
const bool optSet = args.found("set");
const bool optFnd = args.found("find");
cpuTime timer;

View File

@ -49,9 +49,9 @@ int main(int argc, char *argv[])
#include "createTime.H"
wordReList matcher;
if (args.optionFound("re"))
if (args.found("re"))
{
matcher = args.optionReadList<wordRe>("re");
matcher = args.readList<wordRe>("re");
Info<<"limit names: " << matcher << nl;
}

View File

@ -117,7 +117,7 @@ int main(int argc, char *argv[])
printInfo(idl3);
fileName binaryOutput;
if (args.optionReadIfPresent("binary", binaryOutput))
if (args.readIfPresent("binary", binaryOutput))
{
Info<<"Writing output to " << binaryOutput << endl;

View File

@ -331,29 +331,29 @@ int main(int argc, char *argv[])
scalar xxx(-1);
if (args.optionFound("flag"))
if (args.found("flag"))
{
Info<<"-flag:" << args["flag"] << endl;
}
if (args.optionReadIfPresent<scalar>("float", xxx))
if (args.readIfPresent<scalar>("float", xxx))
{
Info<<"read float " << xxx << endl;
}
if (args.optionFound("reList"))
if (args.found("reList"))
{
reLst = args.optionReadList<wordRe>("reList");
reLst = args.readList<wordRe>("reList");
}
if (args.optionFound("wordList"))
if (args.found("wordList"))
{
wLst = args.optionReadList<word>("wordList");
wLst = args.readList<word>("wordList");
}
if (args.optionFound("stringList"))
if (args.found("stringList"))
{
sLst = args.optionReadList<string>("stringList");
sLst = args.readList<string>("stringList");
}
Info<< nl

View File

@ -212,28 +212,28 @@ int main(int argc, char *argv[])
std::initializer_list<label> increments
= {10000, 20000, 40000, 80000, 160000};
if (args.optionFound("label"))
if (args.found("label"))
{
List<label> list(10, 1);
runResizeTest(100000, list, increments);
}
if (args.optionFound("float"))
if (args.found("float"))
{
List<double> list(10, 1.0);
runResizeTest(10000, list, increments);
}
if (args.optionFound("vector"))
if (args.found("vector"))
{
List<vector> list(10, vector::one);
runResizeTest(10000, list, increments);
}
if (args.optionFound("labelList"))
if (args.found("labelList"))
{
typedef labelList testType;
testType initVal(500, label(1));
@ -243,7 +243,7 @@ int main(int argc, char *argv[])
runResizeTest(200, list, increments);
}
if (args.optionFound("vectorList"))
if (args.found("vectorList"))
{
typedef vectorList testType;
testType initVal(500, vector::one);
@ -253,7 +253,7 @@ int main(int argc, char *argv[])
runResizeTest(100, list, increments);
}
if (args.optionFound("order"))
if (args.found("order"))
{
List<label> list(100000000, 1);

View File

@ -95,7 +95,7 @@ int main(int argc, char *argv[])
argList args(argc, argv, false, true);
if (args.optionFound("mask"))
if (args.found("mask"))
{
Info<< "bit width: " << unsigned(sizeof(unsigned)*CHAR_BIT) << endl;
reportInfo<1>();
@ -135,7 +135,7 @@ int main(int argc, char *argv[])
Info<< "size: " << packLst.size() << nl;
if (args.optionFound("count"))
if (args.found("count"))
{
unsigned int rawCount = 0;
forAll(rawLst, elemI)
@ -149,7 +149,7 @@ int main(int argc, char *argv[])
<< "packed count: " << packLst.count() << nl;
}
if (args.optionFound("info"))
if (args.found("info"))
{
packLst.printInfo(Info);
}

View File

@ -27,6 +27,7 @@ Description
#include "argList.H"
#include "IOstreams.H"
#include "Switch.H"
#include "StringStream.H"
using namespace Foam;
@ -40,9 +41,9 @@ int main(int argc, char *argv[])
argList::noParallel();
// argList::noFunctionObjects();
argList::removeOption("case");
argList::addOption("label", "value", "Test parsing of label");
argList::addOption("label", "value", "Test parsing of label");
argList::addOption("scalar", "value", "Test parsing of scalar");
argList::addOption("string", "value", "Test string lookup");
// These are actually lies (never had -parseLabel, -parseScalar etc),
// but good for testing...
@ -56,10 +57,15 @@ int main(int argc, char *argv[])
// Fake a future option...
argList::addOptionCompat("label", {"parse-label", 2112});
argList args(argc, argv);
argList::addArgument("label");
argList::addArgument("...");
argList::addArgument("label");
argList::nonMandatoryArgs();
argList args(argc, argv, false, true);
Info<<"have: "
<<args.optionCount({"label", "scalar"}) << " options" << nl;
<<args.count({"label", "scalar"}) << " options" << nl;
label ival;
scalar sval;
@ -67,23 +73,59 @@ int main(int argc, char *argv[])
Info<< nl;
Info<< "-label = " << flush;
if (args.optionReadIfPresent("label", ival))
if (args.readIfPresent("label", ival))
{
Info<< ival << endl;
Info<< ival << nl;
}
else
{
Info<< "not specified" << endl;
Info<< "not specified" << nl;
}
Info<< "-scalar = " << flush;
if (args.optionReadIfPresent("scalar", sval))
if (args.readIfPresent("scalar", sval))
{
Info<< sval << endl;
Info<< sval << nl;
}
else
{
Info<< "not specified" << endl;
Info<< "not specified" << nl;
}
// Using direct reading
Info<< nl;
if (args.found("label"))
{
Info<< "-label = " << args.opt<label>("label")
<< " or " << args.optionRead<label>("label") // old-compat
<< " or " << readLabel(args["label"]) // with function
<< nl;
}
if (args.found("scalar"))
{
Info<< "-scalar = " << args.opt<scalar>("scalar")
<< " or " << args.optionRead<scalar>("scalar") // old-compat
<< " or " << readScalar(args["scalar"]) // with function
<< nl;
}
if (args.found("string"))
{
Info<< "-string = " << args.opt("string")
<< " or " << args.optionRead<scalar>("string") // old-compat
<< nl;
}
// Arg reading
Info<< nl;
for (label argi=1; argi < args.size(); ++argi)
{
Info<< "arg[" << argi << "] = " << args.read<string>(argi)
<< " or " << args.argRead<label>(argi) // old-compat
<< nl;
}
Info<< "\nEnd\n" << endl;

View File

@ -74,9 +74,9 @@ int main(int argc, char *argv[])
const fileName decompFile = args[1];
const bool region = args.optionFound("region");
const bool allRegions = args.optionFound("allRegions");
const bool verbose = args.optionFound("verbose");
const bool region = args.found("region");
const bool allRegions = args.found("allRegions");
const bool verbose = args.found("verbose");
// Set time from database
#include "createTime.H"
@ -85,7 +85,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location
fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", decompDictFile);
args.readIfPresent("decomposeParDict", decompDictFile);
wordList regionNames;
wordList regionDirs;
@ -109,7 +109,7 @@ int main(int argc, char *argv[])
else
{
word regionName;
if (args.optionReadIfPresent("region", regionName))
if (args.readIfPresent("region", regionName))
{
regionNames = wordList(1, regionName);
regionDirs = regionNames;

View File

@ -105,15 +105,15 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
const bool region = args.optionFound("region");
const bool allRegions = args.optionFound("allRegions");
const bool verbose = args.optionFound("verbose");
const bool region = args.found("region");
const bool allRegions = args.found("allRegions");
const bool verbose = args.found("verbose");
const label numSubdomains =
args.optionLookupOrDefault<label>("domains", 0);
args.lookupOrDefault<label>("domains", 0);
const word methodName =
args.optionLookupOrDefault<word>("method", word::null);
args.lookupOrDefault<word>("method", word::null);
// Set time from database
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location
fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", decompDictFile);
args.readIfPresent("decomposeParDict", decompDictFile);
wordList regionNames;
wordList regionDirs;
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
else
{
word regionName;
if (args.optionReadIfPresent("region", regionName))
if (args.readIfPresent("region", regionName))
{
regionNames = wordList(1, regionName);
regionDirs = regionNames;

View File

@ -54,8 +54,8 @@ int main(int argc, char *argv[])
argList::addArgument("dict .. dictN");
argList args(argc, argv, false, true);
const bool optInfo = args.optionFound("info");
const bool optValue = args.optionFound("value");
const bool optInfo = args.found("info");
const bool optValue = args.found("value");
for (label argi=1; argi < args.size(); ++argi)
{

View File

@ -77,7 +77,7 @@ int main(int argc, char *argv[])
// First handle no parameters
if (args.size() == 1)
{
if (args.optionFound("list"))
if (args.found("list"))
{
fileNameList results = findEtcDirs();
printList(results);
@ -91,7 +91,7 @@ int main(int argc, char *argv[])
}
}
const bool listAll = (args.optionFound("all") || args.optionFound("list"));
const bool listAll = (args.found("all") || args.found("list"));
int error = 0;

View File

@ -45,11 +45,11 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
const label maxCount = args.optionLookupOrDefault<label>("max", 1000);
const label maxCount = args.lookupOrDefault<label>("max", 1000);
externalFileCoupler coupler;
if (args.optionFound("slave"))
if (args.found("slave"))
{
const word role = "slave";
Info<< "Running as " << role << " max=" << maxCount << endl;

View File

@ -177,9 +177,9 @@ int main(int argc, char *argv[])
// Run default tests, unless only specific tests are requested
const bool defaultTests =
args.optionFound("default") || args.options().empty();
args.found("default") || args.options().empty();
if (args.optionFound("construct"))
if (args.found("construct"))
{
Info<< "From initializer_list<word> = ";
fileName file1
@ -231,7 +231,7 @@ int main(int argc, char *argv[])
// Test various ext() methods
if (args.optionFound("ext"))
if (args.found("ext"))
{
Info<<nl << nl << "handling of fileName extension" << nl;
@ -356,7 +356,7 @@ int main(int argc, char *argv[])
}
if (args.optionFound("validate"))
if (args.found("validate"))
{
unsigned nFail = 0;
Info<< nl << "Test fileName::validate" << nl;

View File

@ -75,7 +75,7 @@ int main(int argc, char *argv[])
}
fileName pathName;
if (args.optionReadIfPresent("case", pathName))
if (args.readIfPresent("case", pathName))
{
Info<< nl
<< "-case" << nl
@ -95,10 +95,8 @@ int main(int argc, char *argv[])
printCleaning(pathName);
}
if (args.optionFound("istream"))
if (args.readIfPresent("istream", pathName))
{
args.optionLookup("istream")() >> pathName;
Info<< nl
<< "-case" << nl
<< "path = " << args.path() << nl

View File

@ -45,7 +45,7 @@ int main(int argc, char *argv[])
label nReps = 10000;
const point sample = args.argRead<point>(1);
const point sample = args.read<point>(1);
const polyMesh::cellDecomposition decompMode = polyMesh::CELL_TETS;

View File

@ -106,8 +106,8 @@ int main(int argc, char *argv[])
const word dictName("fvSolution");
bool optRewrite = args.optionFound("rewrite");
bool optShow = args.optionFound("show");
bool optRewrite = args.found("rewrite");
bool optShow = args.found("show");
IOdictionary solutionDict
(

View File

@ -49,7 +49,7 @@ int main(int argc, char *argv[])
argList args(argc, argv, false, true);
if (args.optionFound("verbose"))
if (args.found("verbose"))
{
labelRange::debug = 1;
}
@ -101,8 +101,8 @@ int main(int argc, char *argv[])
}
{
label start = args.argRead<label>(argI);
label size = args.argRead<label>(argI+1);
label start = args.read<label>(argI);
label size = args.read<label>(argI+1);
++argI;
range.reset(start, size);

View File

@ -196,7 +196,7 @@ int main(int argc, char *argv[])
}
{
const label celli = args.optionLookupOrDefault("cell", 0);
const label celli = args.lookupOrDefault("cell", 0);
tensorField mI(momentOfInertia::meshInertia(mesh));

View File

@ -55,7 +55,7 @@ int main(int argc, char *argv[])
{
const string& srcFile = args[argI];
if (args.optionFound("ext"))
if (args.found("ext"))
{
if (mvBak(srcFile, args["ext"]))
{

View File

@ -166,8 +166,8 @@ int main(int argc, char *argv[])
recursive = Switch(args[1]);
const bool optMesh = args.optionFound("mesh");
const bool optSkip = args.optionFound("skip");
const bool optMesh = args.found("mesh");
const bool optSkip = args.found("skip");
const objectRegistry& db = (optMesh ? mesh.thisDb() : runTime);
Info<<"## start ##" << nl;

View File

@ -66,7 +66,7 @@ int main(int argc, char *argv[])
vector rotVector;
if (args.optionReadIfPresent("rollPitchYaw", rotVector))
if (args.readIfPresent("rollPitchYaw", rotVector))
{
Info<< "Rotate by" << nl
<< " roll " << rotVector.x() << nl
@ -81,7 +81,7 @@ int main(int argc, char *argv[])
Info<< "quaternion " << quat << endl;
Info<< "rotation = " << quat.R() << endl;
}
if (args.optionReadIfPresent("yawPitchRoll", rotVector))
if (args.readIfPresent("yawPitchRoll", rotVector))
{
Info<< "Rotate by" << nl
<< " yaw " << rotVector.x() << nl
@ -96,11 +96,11 @@ int main(int argc, char *argv[])
Info<< "quaternion " << quat << endl;
Info<< "rotation = " << quat.R() << endl;
}
if (args.optionFound("rotate-angle"))
if (args.found("rotate-angle"))
{
const Tuple2<vector, scalar> axisAngle
(
args.optionLookup("rotate-angle")()
args.lookup("rotate-angle")()
);
Info<< "Rotate" << nl

View File

@ -63,9 +63,9 @@ int main(int argc, char *argv[])
args.printUsage();
}
bool useBSpline = args.optionFound("B");
bool useCatmullRom = args.optionFound("CMR");
label nSeg = args.optionLookupOrDefault<label>("n", 20);
bool useBSpline = args.found("B");
bool useCatmullRom = args.found("CMR");
label nSeg = args.lookupOrDefault<label>("n", 20);
if (!useCatmullRom && !useBSpline)
{

View File

@ -105,18 +105,12 @@ int main(int argc, char *argv[])
args.printUsage();
}
const bool keepEmpty = args.optionFound("empty");
const bool keepEmpty = args.found("empty");
int nopts = 0;
for (auto optName : { "any", "slash", "space", "sub", "fixed", "char" })
{
if (args.optionFound(optName))
{
++nopts;
}
}
const label nopts =
args.count({"any", "slash", "space", "sub", "fixed", "char"});
if (args.optionFound("any"))
if (args.found("any"))
{
const std::string& str = args["any"];
Info<< "split on any chars" << nl
@ -135,7 +129,7 @@ int main(int argc, char *argv[])
}
}
if (args.optionFound("sub"))
if (args.found("sub"))
{
const std::string& str = args["sub"];
Info<< "split on substring" << nl
@ -154,7 +148,7 @@ int main(int argc, char *argv[])
}
}
if (args.optionFound("space"))
if (args.found("space"))
{
Info<< "split on space" << nl
<< "~~~~~~~~~~~~~~" << nl;
@ -171,7 +165,7 @@ int main(int argc, char *argv[])
}
}
if (args.optionFound("char"))
if (args.found("char"))
{
const char delim = args["char"][0];
@ -190,9 +184,9 @@ int main(int argc, char *argv[])
}
}
if (args.optionFound("fixed"))
if (args.found("fixed"))
{
const label width = readLabel(args["fixed"]);
const label width = args.opt<label>("fixed");
Info<< "split on fixed width = " << width << nl
<< "~~~~~~~~~~~~~~" << nl;
@ -210,7 +204,7 @@ int main(int argc, char *argv[])
}
// Default
if (!nopts || args.optionFound("slash"))
if (!nopts || args.found("slash"))
{
const char delim = '/';

View File

@ -128,7 +128,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
const scalar scaleFactor = args.optionLookupOrDefault<scalar>("scale", -1);
const scalar scaleFactor = args.lookupOrDefault<scalar>("scale", -1);
const word outputFile(args.executable() + ".obj");
@ -145,18 +145,18 @@ int main(int argc, char *argv[])
Info<< endl;
if (args.optionFound("debug2"))
if (args.found("debug2"))
{
surfaceIntersection::debug |= 2;
}
if (args.optionFound("debug4"))
if (args.found("debug4"))
{
surfaceIntersection::debug |= 4;
}
const bool optPrint = args.optionFound("print");
const bool optPrint = args.found("print");
dictionary intersectOptions;
if (args.optionFound("dict"))
if (args.found("dict"))
{
intersectOptions = IOdictionary
(
@ -190,12 +190,12 @@ int main(int argc, char *argv[])
}
word mergeOp;
if (args.optionFound("mergePoints"))
if (args.found("mergePoints"))
{
cuts.mergePoints(args.optionRead<scalar>("mergePoints"));
cuts.mergePoints(args.opt<scalar>("mergePoints"));
mergeOp = "mergePoints";
}
else if (args.optionFound("mergeEdges"))
else if (args.found("mergeEdges"))
{
cuts.mergeEdges();
mergeOp = "mergeEdges";

View File

@ -142,8 +142,8 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
const bool optStdout = args.optionFound("stdout");
const scalar scaleFactor = args.optionLookupOrDefault("scale", 0.0);
const bool optStdout = args.found("stdout");
const scalar scaleFactor = args.lookupOrDefault("scale", 0.0);
const fileName importName = args[1];
const fileName exportName = optStdout ? "-stdout" : args[2];
@ -157,7 +157,7 @@ int main(int argc, char *argv[])
if
(
!args.optionFound("triSurface")
!args.found("triSurface")
&&
(
!MeshedSurface<face>::canRead(importName, true)
@ -172,7 +172,7 @@ int main(int argc, char *argv[])
return 1;
}
if (args.optionFound("triSurface"))
if (args.found("triSurface"))
{
triSurface surf(importName);
@ -198,14 +198,14 @@ int main(int argc, char *argv[])
// surf2.read(is); // FAIL: private method
}
if (args.optionFound("orient"))
if (args.found("orient"))
{
Info<< "Checking surface orientation" << endl;
PatchTools::checkOrientation(surf, true);
Info<< endl;
}
if (args.optionFound("clean"))
if (args.found("clean"))
{
Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
@ -234,10 +234,10 @@ int main(int argc, char *argv[])
else
{
// normally write sorted (looks nicer)
surf.write(exportName, !args.optionFound("unsorted"));
surf.write(exportName, !args.found("unsorted"));
}
}
else if (args.optionFound("unsorted"))
else if (args.found("unsorted"))
{
UnsortedMeshedSurface<face> surf(importName);
@ -263,14 +263,14 @@ int main(int argc, char *argv[])
// surf2.read(is); // FAIL: private method
}
if (args.optionFound("orient"))
if (args.found("orient"))
{
Info<< "Checking surface orientation" << endl;
PatchTools::checkOrientation(surf, true);
Info<< endl;
}
if (args.optionFound("clean"))
if (args.found("clean"))
{
Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
@ -301,7 +301,7 @@ int main(int argc, char *argv[])
surf.write(exportName);
}
}
else if (args.optionFound("triFace"))
else if (args.found("triFace"))
{
MeshedSurface<triFace> surf(importName);
@ -327,14 +327,14 @@ int main(int argc, char *argv[])
// surf2.read(is); // FAIL: private method
}
if (args.optionFound("orient"))
if (args.found("orient"))
{
Info<< "Checking surface orientation" << endl;
PatchTools::checkOrientation(surf, true);
Info<< endl;
}
if (args.optionFound("clean"))
if (args.found("clean"))
{
Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
@ -391,14 +391,14 @@ int main(int argc, char *argv[])
// surf2.read(is); // FAIL: private method
}
if (args.optionFound("orient"))
if (args.found("orient"))
{
Info<< "Checking surface orientation" << endl;
PatchTools::checkOrientation(surf, true);
Info<< endl;
}
if (args.optionFound("clean"))
if (args.found("clean"))
{
Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
@ -406,7 +406,7 @@ int main(int argc, char *argv[])
Info<< endl;
}
if (args.optionFound("testModify"))
if (args.found("testModify"))
{
Info<< "Use ModifiableMeshedSurface to shift (1, 0, 0)" << endl;
Info<< "original" << nl;
@ -457,7 +457,7 @@ int main(int argc, char *argv[])
surf.write(exportName);
}
if (args.optionFound("surfMesh"))
if (args.found("surfMesh"))
{
Foam::Time runTime
(

View File

@ -51,9 +51,9 @@ int main(int argc, char *argv[])
argList args(argc, argv, false, true);
const label repeat = args.optionLookupOrDefault<label>("repeat", 1);
const label repeat = args.lookupOrDefault<label>("repeat", 1);
const bool optVerbose = args.optionFound("verbose");
const bool optVerbose = args.found("verbose");
cpuTime timer;
for (label count = 0; count < repeat; ++count)
@ -111,7 +111,7 @@ int main(int argc, char *argv[])
<< timer.cpuTimeIncrement() << " s\n\n";
fileName inputFile;
if (args.optionReadIfPresent("file", inputFile))
if (args.readIfPresent("file", inputFile))
{
IFstream is(inputFile);

View File

@ -320,7 +320,7 @@ int main(int argc, char *argv[])
}
word emptyPatchName;
if (args.optionReadIfPresent("addEmptyPatch", emptyPatchName))
if (args.readIfPresent("addEmptyPatch", emptyPatchName))
{
dictionary emptyPatchDict;
emptyPatchDict.add("type", "empty");

View File

@ -691,7 +691,7 @@ int main(int argc, char *argv[])
Info<< "Reading blocked cells from cellSet " << blockedSetName
<< endl;
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
// Read faceSets, lookup patches

View File

@ -102,10 +102,10 @@ int main(int argc, char *argv[])
IOdictionary collapseDict(dictIO);
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
const bool collapseFaces = args.optionFound("collapseFaces");
const bool collapseFaceSet = args.optionFound("collapseFaceSet");
const bool collapseFaces = args.found("collapseFaces");
const bool collapseFaceSet = args.found("collapseFaceSet");
if (collapseFaces && collapseFaceSet)
{
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
word faceSetName("indirectPatchFaces");
IOobject::readOption readFlag = IOobject::READ_IF_PRESENT;
if (args.optionReadIfPresent("collapseFaceSet", faceSetName))
if (args.readIfPresent("collapseFaceSet", faceSetName))
{
readFlag = IOobject::MUST_READ;
}

View File

@ -368,16 +368,16 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const scalar featureAngle = args.argRead<scalar>(1);
const scalar featureAngle = args.read<scalar>(1);
const scalar minCos = Foam::cos(degToRad(featureAngle));
// Sin of angle between two consecutive edges on a face.
// If sin(angle) larger than this the face will be considered concave.
scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0);
scalar concaveAngle = args.lookupOrDefault("concaveAngle", 30.0);
scalar concaveSin = Foam::sin(degToRad(concaveAngle));
const bool overwrite = args.optionFound("overwrite");
const bool meshQuality = args.optionFound("meshQuality");
const bool overwrite = args.found("overwrite");
const bool meshQuality = args.found("meshQuality");
Info<< "Merging all faces of a cell" << nl
<< " - which are on the same patch" << nl

View File

@ -345,7 +345,7 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
Info<< "Reading modifyMeshDict\n" << endl;

View File

@ -73,9 +73,9 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
word cellSetName(args[1]);
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
const bool minSet = args.optionFound("minSet");
const bool minSet = args.found("minSet");
Info<< "Reading cells to refine from cellSet " << cellSetName
<< nl << endl;

View File

@ -84,8 +84,8 @@ int main(int argc, char *argv[])
const wordReList patches((IStringStream(args[1])()));
const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches));
const scalar weight = args.argRead<scalar>(2);
const bool overwrite = args.optionFound("overwrite");
const scalar weight = args.read<scalar>(2);
const bool overwrite = args.found("overwrite");
if (!patchSet.size())
{
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
// Edit list of cells to refine according to specified set
word setName;
if (args.optionReadIfPresent("useSet", setName))
if (args.readIfPresent("useSet", setName))
{
Info<< "Subsetting cells to cut based on cellSet"
<< setName << nl << endl;

View File

@ -118,7 +118,7 @@ int main(int argc, char *argv[])
<< " to allow for some truncation error."
<< nl << endl;
const bool readLevel = args.optionFound("readLevel");
const bool readLevel = args.found("readLevel");
const scalarField& vols = mesh.cellVolumes();

View File

@ -63,7 +63,7 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
const word setName = args[1];
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
// Read faces
faceSet candidateSet(mesh, setName);

View File

@ -553,15 +553,15 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const scalar featureAngle = args.argRead<scalar>(1);
const scalar featureAngle = args.read<scalar>(1);
const scalar minCos = Foam::cos(degToRad(featureAngle));
const scalar minSin = Foam::sin(degToRad(featureAngle));
const bool readSet = args.optionFound("set");
const bool geometry = args.optionFound("geometry");
const bool overwrite = args.optionFound("overwrite");
const bool readSet = args.found("set");
const bool geometry = args.found("geometry");
const bool overwrite = args.found("overwrite");
const scalar edgeTol = args.optionLookupOrDefault("tol", 0.2);
const scalar edgeTol = args.lookupOrDefault("tol", 0.2);
Info<< "Trying to split cells with internal angles > feature angle\n" << nl
<< "featureAngle : " << featureAngle << nl

View File

@ -311,7 +311,7 @@ int main(int argc, char *argv[])
FatalError.exit();
}
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
#include "createTime.H"

View File

@ -160,11 +160,11 @@ int main(int argc, char *argv[])
Time runTime(args.rootPath(), args.caseName());
runTime.functionObjects().off();
const bool optList = args.optionFound("list");
const bool optList = args.found("list");
// exportName only has a size when export is in effect
fileName exportName;
if (args.optionReadIfPresent("name", exportName))
if (args.readIfPresent("name", exportName))
{
const word ext = exportName.ext();
// strip erroneous extension (.ccm, .ccmg, .ccmp)
@ -173,22 +173,22 @@ int main(int argc, char *argv[])
exportName = exportName.lessExt();
}
}
else if (args.optionFound("export"))
else if (args.found("export"))
{
exportName = ccm::writer::defaultMeshName;
if (args.optionFound("case"))
if (args.found("case"))
{
exportName += '-' + args.globalCaseName();
}
}
// By default, no scaling
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
// Default to binary output, unless otherwise specified
const IOstream::streamFormat format =
(
args.optionFound("ascii")
args.found("ascii")
? IOstream::ASCII
: IOstream::BINARY
);
@ -201,15 +201,15 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~~~~~~~~~~~
ccm::reader::options rOpts;
rOpts.removeBaffles(args.optionFound("noBaffles"));
rOpts.mergeInterfaces(args.optionFound("merge"));
rOpts.removeBaffles(args.found("noBaffles"));
rOpts.mergeInterfaces(args.found("merge"));
if (args.optionFound("numbered"))
if (args.found("numbered"))
{
rOpts.useNumberedNames(true);
}
if (args.optionFound("solids"))
if (args.found("solids"))
{
Info<< "treating solids like fluids" << endl;
rOpts.keepSolid(true);
@ -235,7 +235,7 @@ int main(int argc, char *argv[])
if
(
args.optionFound("remap")
args.found("remap")
? reader.remapMeshInfo(runTime, args["remap"])
: reader.remapMeshInfo(runTime)
)
@ -257,7 +257,7 @@ int main(int argc, char *argv[])
{
autoPtr<polyMesh> mesh =
(
args.optionFound("remap")
args.found("remap")
? reader.mesh(runTime, args["remap"])
: reader.mesh(runTime)
);

View File

@ -123,12 +123,12 @@ int main(int argc, char *argv[])
// get times list
instantList timeDirs = Foam::timeSelector::select0(runTime, args);
const bool optMesh = args.optionFound("mesh");
const bool optResults = args.optionFound("results");
const bool optOverwrite = args.optionFound("overwrite");
const bool optMesh = args.found("mesh");
const bool optResults = args.found("results");
const bool optOverwrite = args.found("overwrite");
fileName exportName = ccm::writer::defaultMeshName;
if (args.optionReadIfPresent("name", exportName))
if (args.readIfPresent("name", exportName))
{
const word ext = exportName.ext();
// strip erroneous extension (.ccm, .ccmg, .ccmp)
@ -137,7 +137,7 @@ int main(int argc, char *argv[])
exportName = exportName.lessExt();
}
}
else if (args.optionFound("case"))
else if (args.found("case"))
{
exportName += '-' + args.globalCaseName();
}
@ -154,9 +154,9 @@ int main(int argc, char *argv[])
// // skip over time=0, unless some other time option has been specified
// if
// (
// !args.optionFound("zeroTime")
// && !args.optionFound("time")
// && !args.optionFound("latestTime")
// !args.found("zeroTime")
// && !args.found("time")
// && !args.found("latestTime")
// && Times.size() > 2
// )
// {
@ -253,7 +253,7 @@ int main(int argc, char *argv[])
);
// writer.setTopologyFile(exportName + ".ccmg");
Info<< "writing solution:";
if (args.optionFound("remap"))
if (args.found("remap"))
{
writer.writeSolution(objects, args["remap"]);
}

View File

@ -64,7 +64,7 @@ int main(int argc, char *argv[])
FatalError.exit();
}
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
#include "createTime.H"

View File

@ -90,7 +90,7 @@ int main(int argc, char *argv[])
// Binary output, unless otherwise specified
const IOstream::streamFormat format =
(
args.optionFound("ascii")
args.found("ascii")
? IOstream::ASCII
: IOstream::BINARY
);
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
(
args[1],
// Default no scaling
args.optionLookupOrDefault("scale", 1.0)
args.lookupOrDefault("scale", 1.0)
);
@ -111,7 +111,7 @@ int main(int argc, char *argv[])
reader.writeMesh(mesh(), format);
if (args.optionFound("check"))
if (args.found("check"))
{
checkFireEdges(mesh());
}

View File

@ -804,15 +804,15 @@ int main(int argc, char *argv[])
FatalError.exit();
}
args.optionReadIfPresent("scale", scaleFactor);
args.readIfPresent("scale", scaleFactor);
wordHashSet ignoreCellGroups;
wordHashSet ignoreFaceGroups;
args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
args.readIfPresent("ignoreCellGroups", ignoreCellGroups);
args.readIfPresent("ignoreFaceGroups", ignoreFaceGroups);
cubitFile = args.optionFound("cubit");
cubitFile = args.found("cubit");
if (cubitFile)
{

View File

@ -898,10 +898,10 @@ int main(int argc, char *argv[])
FatalError.exit();
}
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
const bool writeSets = args.optionFound("writeSets");
const bool writeZones = args.optionFound("writeZones");
const bool writeSets = args.found("writeSets");
const bool writeZones = args.found("writeZones");
#include "createTime.H"
@ -975,7 +975,7 @@ int main(int argc, char *argv[])
scalar twoDThickness = 1.0;
if (!args.optionReadIfPresent("2D", twoDThickness))
if (!args.readIfPresent("2D", twoDThickness))
{
const scalar extrusionFactor = 0.02; //0.01 in each direction
boundBox box(points);

View File

@ -81,7 +81,7 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args);
fileName exportName = meshWriter::defaultMeshName;
if (args.optionFound("case"))
if (args.found("case"))
{
exportName += '-' + args.globalCaseName();
}
@ -89,11 +89,11 @@ int main(int argc, char *argv[])
// write control options
// ~~~~~~~~~~~~~~~~~~~~~
fileFormats::FIREMeshWriter::binary = !args.optionFound("ascii");
fileFormats::FIREMeshWriter::binary = !args.found("ascii");
// Default: no rescaling
scalar scaleFactor = 1;
if (args.optionReadIfPresent("scale", scaleFactor))
if (args.readIfPresent("scale", scaleFactor))
{
if (scaleFactor <= 0)
{

View File

@ -90,14 +90,14 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args);
fileName exportName = meshWriter::defaultMeshName;
if (args.optionFound("case"))
if (args.found("case"))
{
exportName += '-' + args.globalCaseName();
}
// Default rescale from [m] to [mm]
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1000.0);
const bool writeBndFile = !args.optionFound("noBnd");
const scalar scaleFactor = args.lookupOrDefault("scale", 1000.0);
const bool writeBndFile = !args.found("noBnd");
#include "createPolyMesh.H"

View File

@ -77,8 +77,8 @@ int main(int argc, char *argv[])
fileName exportName = args[1];
scalar scaleFactor = 0;
args.optionReadIfPresent<scalar>("scale", scaleFactor);
const bool doTriangulate = args.optionFound("tri");
args.readIfPresent<scalar>("scale", scaleFactor);
const bool doTriangulate = args.found("tri");
fileName exportBase = exportName.lessExt();
word exportExt = exportName.ext();

View File

@ -640,7 +640,7 @@ int main(int argc, char *argv[])
FatalError.exit();
}
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
#include "createTime.H"

View File

@ -783,7 +783,7 @@ int main(int argc, char *argv[])
Foam::word regionName;
if (args.optionReadIfPresent("region", regionName))
if (args.readIfPresent("region", regionName))
{
Foam::Info
<< "Creating polyMesh for region " << regionName << endl;
@ -793,7 +793,7 @@ int main(int argc, char *argv[])
regionName = Foam::polyMesh::defaultRegion;
}
const bool keepOrientation = args.optionFound("keepOrientation");
const bool keepOrientation = args.found("keepOrientation");
IFstream inFile(args[1]);
// Storage for points

View File

@ -1122,7 +1122,7 @@ int main(int argc, char *argv[])
// For debugging: dump boundary faces as OBJ surface mesh
if (args.optionFound("dump"))
if (args.found("dump"))
{
Info<< "Writing boundary faces to OBJ file boundaryFaces.obj"
<< nl << endl;

View File

@ -82,10 +82,10 @@ int main(int argc, char *argv[])
#include "createTime.H"
const fileName kivaFileName =
args.optionLookupOrDefault<fileName>("file", "otape17");
args.lookupOrDefault<fileName>("file", "otape17");
kivaVersions kivaVersion = kiva3v;
if (args.optionFound("version"))
if (args.found("version"))
{
const word versionName = args["version"];
@ -109,7 +109,7 @@ int main(int argc, char *argv[])
}
scalar zHeadMin = -GREAT;
args.optionReadIfPresent("zHeadMin", zHeadMin);
args.readIfPresent("zHeadMin", zHeadMin);
#include "readKivaGrid.H"

View File

@ -70,7 +70,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
const bool readHex = args.optionFound("hex");
const bool readHex = args.found("hex");
IFstream mshStream(args[1]);
label nCells;

View File

@ -90,12 +90,12 @@ int main(int argc, char *argv[])
FatalError.exit();
}
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
const bool readBlank = !args.optionFound("noBlank");
const bool singleBlock = args.optionFound("singleBlock");
const bool readBlank = !args.found("noBlank");
const bool singleBlock = args.found("singleBlock");
scalar twoDThickness = -1;
if (args.optionReadIfPresent("2D", twoDThickness))
if (args.readIfPresent("2D", twoDThickness))
{
Info<< "Reading 2D case by extruding points by " << twoDThickness
<< " in z direction." << nl << endl;

View File

@ -95,7 +95,7 @@ int main(int argc, char *argv[])
// Binary output, unless otherwise specified
const IOstream::streamFormat format =
(
args.optionFound("ascii")
args.found("ascii")
? IOstream::ASCII
: IOstream::BINARY
);
@ -113,8 +113,8 @@ int main(int argc, char *argv[])
prefix,
runTime,
// Default rescale from [mm] to [m]
args.optionLookupOrDefault("scale", 0.001),
args.optionFound("solids")
args.lookupOrDefault("scale", 0.001),
args.found("solids")
);

View File

@ -112,7 +112,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
const fileName prefix = args[1];
const bool readFaceFile = !args.optionFound("noFaceFile");
const bool readFaceFile = !args.found("noFaceFile");
const fileName nodeFile(prefix + ".node");
const fileName eleFile(prefix + ".ele");

View File

@ -429,13 +429,13 @@ int main(int argc, char *argv[])
#include "createTime.H"
runTime.functionObjects().off();
const bool patchFaces = args.optionFound("patchFaces");
const bool patchEdges = args.optionFound("patchEdges");
const bool doCell = args.optionFound("cell");
const bool doPoint = args.optionFound("point");
const bool doFace = args.optionFound("face");
const bool doCellSet = args.optionFound("cellSet");
const bool doFaceSet = args.optionFound("faceSet");
const bool patchFaces = args.found("patchFaces");
const bool patchEdges = args.found("patchEdges");
const bool doCell = args.found("cell");
const bool doPoint = args.found("point");
const bool doFace = args.found("face");
const bool doCellSet = args.found("cellSet");
const bool doFaceSet = args.found("faceSet");
Info<< "Writing mesh objects as .obj files such that the object"
@ -467,19 +467,19 @@ int main(int argc, char *argv[])
}
if (doCell)
{
label celli = args.optionRead<label>("cell");
const label celli = args.opt<label>("cell");
writePoints(mesh, celli, runTime.timeName());
}
if (doPoint)
{
label pointi = args.optionRead<label>("point");
const label pointi = args.opt<label>("point");
writePointCells(mesh, pointi, runTime.timeName());
}
if (doFace)
{
label facei = args.optionRead<label>("face");
const label facei = args.opt<label>("face");
fileName fName
(

View File

@ -129,7 +129,7 @@ int main(int argc, char *argv[])
word regionPath;
// Check if the region is specified otherwise mesh the default region
if (args.optionReadIfPresent("region", regionName, polyMesh::defaultRegion))
if (args.readIfPresent("region", regionName, polyMesh::defaultRegion))
{
Info<< nl << "Generating mesh for region " << regionName << endl;
regionPath = regionName;
@ -140,7 +140,7 @@ int main(int argc, char *argv[])
fileName dictPath;
// Check if the dictionary is specified on the command-line
if (args.optionReadIfPresent("dict", dictPath))
if (args.readIfPresent("dict", dictPath))
{
if (isDir(dictPath))
{
@ -176,7 +176,7 @@ int main(int argc, char *argv[])
dictPath = runTime.system()/regionPath/dictName;
}
if (!args.optionFound("noClean"))
if (!args.found("noClean"))
{
fileName polyMeshPath
(
@ -223,7 +223,7 @@ int main(int argc, char *argv[])
IOdictionary meshDict(meshDictIO);
blockMesh blocks(meshDict, regionName);
if (args.optionFound("blockTopology"))
if (args.found("blockTopology"))
{
// Write mesh as edges.
{
@ -383,7 +383,7 @@ int main(int argc, char *argv[])
Info<< nl << "Writing polyMesh with "
<< mesh.cellZones().size() << " cellZones";
if (args.optionFound("sets") && !mesh.cellZones().empty())
if (args.found("sets") && !mesh.cellZones().empty())
{
Info<< " (written as cellSets too)";
}
@ -397,7 +397,7 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
if (args.optionFound("sets"))
if (args.found("sets"))
{
forAll(mesh.cellZones(), zonei)
{

View File

@ -268,7 +268,7 @@ int main(int argc, char *argv[])
// Get optional regionName
word regionName;
word regionDir;
if (args.optionReadIfPresent("region", regionName))
if (args.readIfPresent("region", regionName))
{
regionDir = regionName;
Info<< "Create mesh " << regionName << " for time = "

View File

@ -1473,8 +1473,6 @@ void extrudeGeometricProperties
}
int main(int argc, char *argv[])
{
argList::addNote("Create region mesh by extruding a faceZone or faceSet");
@ -1501,8 +1499,7 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
const word dictName("extrudeToRegionMeshDict");
@ -1510,11 +1507,9 @@ int main(int argc, char *argv[])
IOdictionary dict(dictIO);
// Point generator
autoPtr<extrudeModel> model(extrudeModel::New(dict));
// Region
const word shellRegionName(dict.lookup("region"));
@ -1522,7 +1517,7 @@ int main(int argc, char *argv[])
wordList zoneNames;
wordList zoneShadowNames;
bool hasZones = dict.found("faceZones");
const bool hasZones = dict.found("faceZones");
if (hasZones)
{
dict.lookup("faceZones") >> zoneNames;

View File

@ -128,7 +128,7 @@ int main(int argc, char *argv[])
runTimeExtruded.functionObjects().off();
const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
Info<< "Extruding from " << ExtrudeModeNames[surfaceFormat]
<< " at time " << runTimeExtruded.timeName() << endl;

View File

@ -62,12 +62,12 @@ int main(int argc, char *argv[])
runTime.functionObjects().off();
const bool checkGeometry = args.optionFound("checkGeometry");
const bool conformationOnly = args.optionFound("conformationOnly");
const bool checkGeometry = args.found("checkGeometry");
const bool conformationOnly = args.found("conformationOnly");
// Allow override of decomposeParDict location
fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", decompDictFile);
args.readIfPresent("decomposeParDict", decompDictFile);
IOdictionary foamyHexMeshDict
(

View File

@ -62,7 +62,7 @@ scalar getMergeDistance
)
{
scalar mergeTol = defaultMergeTol;
args.optionReadIfPresent("mergeTol", mergeTol);
args.readIfPresent("mergeTol", mergeTol);
scalar writeTol =
Foam::pow(scalar(10.0), -scalar(IOstream::defaultPrecision()));
@ -404,7 +404,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
runTime.functionObjects().off();
const bool writeMesh = args.optionFound("writeMesh");
const bool writeMesh = args.found("writeMesh");
if (writeMesh)
{
@ -523,7 +523,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location
fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", decompDictFile);
args.readIfPresent("decomposeParDict", decompDictFile);
labelList decomp = decompositionModel::New
(

View File

@ -60,7 +60,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
runTime.functionObjects().off();
const labelVector n(args.argRead<labelVector>(1));
const labelVector n(args.read<labelVector>(1));
const fileName exportName = args[2];
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"

View File

@ -82,13 +82,13 @@ int main(int argc, char *argv[])
const dictionary& extrusionDict(controlDict.subDict("extrusion"));
Switch extrude(extrusionDict.lookup("extrude"));
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
// Read and triangulation
// ~~~~~~~~~~~~~~~~~~~~~~
CV2D mesh(runTime, controlDict);
if (args.optionFound("pointsFile"))
if (args.found("pointsFile"))
{
mesh.insertPoints(args["pointsFile"]);
}

View File

@ -711,22 +711,21 @@ int main(int argc, char *argv[])
#include "createTime.H"
runTime.functionObjects().off();
const bool overwrite = args.optionFound("overwrite");
const bool checkGeometry = args.optionFound("checkGeometry");
const bool surfaceSimplify = args.optionFound("surfaceSimplify");
const bool overwrite = args.found("overwrite");
const bool checkGeometry = args.found("checkGeometry");
const bool surfaceSimplify = args.found("surfaceSimplify");
autoPtr<fvMesh> meshPtr;
{
word regionName;
if (args.optionReadIfPresent("region", regionName))
word regionName = fvMesh::defaultRegion;
if (args.readIfPresent("region", regionName))
{
Info<< "Create mesh " << regionName << " for time = "
<< runTime.timeName() << nl << endl;
}
else
{
regionName = fvMesh::defaultRegion;
Info<< "Create mesh for time = "
<< runTime.timeName() << nl << endl;
}
@ -792,7 +791,7 @@ int main(int argc, char *argv[])
if (Pstream::parRun())
{
fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", decompDictFile);
args.readIfPresent("decomposeParDict", decompDictFile);
// A demand-driven decompositionMethod can have issues finding
// an alternative decomposeParDict location.
@ -1663,11 +1662,11 @@ int main(int argc, char *argv[])
labelHashSet includePatches(bMesh.size());
if (args.optionFound("patches"))
if (args.found("patches"))
{
includePatches = bMesh.patchSet
(
wordReList(args.optionLookup("patches")())
wordReList(args.lookup("patches")())
);
}
else
@ -1685,7 +1684,7 @@ int main(int argc, char *argv[])
fileName outFileName
(
args.optionLookupOrDefault<fileName>
args.lookupOrDefault<fileName>
(
"outFile",
"constant/triSurface/simplifiedSurface.stl"

View File

@ -52,7 +52,7 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
if (!overwrite)
{

View File

@ -88,8 +88,8 @@ int main(int argc, char *argv[])
<< " s\n" << endl << endl;
const scalar featureAngle = args.argRead<scalar>(1);
const bool overwrite = args.optionFound("overwrite");
const scalar featureAngle = args.read<scalar>(1);
const bool overwrite = args.found("overwrite");
const scalar minCos = Foam::cos(degToRad(featureAngle));

View File

@ -126,20 +126,20 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args);
#include "createNamedMesh.H"
const bool noTopology = args.optionFound("noTopology");
const bool allGeometry = args.optionFound("allGeometry");
const bool allTopology = args.optionFound("allTopology");
const bool meshQuality = args.optionFound("meshQuality");
const bool noTopology = args.found("noTopology");
const bool allGeometry = args.found("allGeometry");
const bool allTopology = args.found("allTopology");
const bool meshQuality = args.found("meshQuality");
word surfaceFormat;
const bool writeSets = args.optionReadIfPresent("writeSets", surfaceFormat);
const bool writeSets = args.readIfPresent("writeSets", surfaceFormat);
HashSet<word> selectedFields;
bool writeFields = args.optionReadIfPresent
bool writeFields = args.readIfPresent
(
"writeFields",
selectedFields
);
if (!writeFields && args.optionFound("writeAllFields"))
if (!writeFields && args.found("writeAllFields"))
{
selectedFields.insert("nonOrthoAngle");
selectedFields.insert("faceWeight");

View File

@ -438,7 +438,7 @@ int main(int argc, char *argv[])
#include "createNamedMesh.H"
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
const word oldInstance = mesh.pointsInstance();

View File

@ -523,13 +523,13 @@ int main(int argc, char *argv[])
runTime.functionObjects().off();
Foam::word meshRegionName = polyMesh::defaultRegion;
args.optionReadIfPresent("region", meshRegionName);
args.readIfPresent("region", meshRegionName);
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
#include "createNamedPolyMesh.H"
const bool writeObj = args.optionFound("writeObj");
const bool writeObj = args.found("writeObj");
const word oldInstance = mesh.pointsInstance();

View File

@ -48,7 +48,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
const scalar scaleFactor = args.argRead<scalar>(1);
const scalar scaleFactor = args.read<scalar>(1);
#include "createTime.H"
#include "createMesh.H"

View File

@ -97,20 +97,20 @@ int main(int argc, char *argv[])
FatalError.exit();
}
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
fileName masterCase = args[1];
fileName addCase = args[2];
const word masterRegion =
args.optionLookupOrDefault<word>
args.lookupOrDefault<word>
(
"masterRegion",
polyMesh::defaultRegion
);
const word addRegion =
args.optionLookupOrDefault<word>
args.lookupOrDefault<word>
(
"masterRegion",
polyMesh::defaultRegion
@ -166,7 +166,7 @@ int main(int argc, char *argv[])
const bool specifiedInstance =
(
!overwrite
&& args.optionReadIfPresent("resultTime", meshInstance)
&& args.readIfPresent("resultTime", meshInstance)
);
if (specifiedInstance)

View File

@ -304,10 +304,10 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
const polyBoundaryMesh& patches = mesh.boundaryMesh();
const bool readDict = args.optionFound("dict");
const bool split = args.optionFound("split");
const bool overwrite = args.optionFound("overwrite");
const bool detectOnly = args.optionFound("detectOnly");
const bool readDict = args.found("dict");
const bool split = args.found("split");
const bool overwrite = args.found("overwrite");
const bool detectOnly = args.found("detectOnly");
if (readDict && (split || detectOnly))
{

View File

@ -47,7 +47,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
if (!overwrite)
{

View File

@ -168,7 +168,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createNamedDynamicFvMesh.H"
const bool checkAMI = args.optionFound("checkAMI");
const bool checkAMI = args.found("checkAMI");
if (checkAMI)
{

View File

@ -58,7 +58,7 @@ int main(int argc, char *argv[])
#include "createNamedPolyMesh.H"
const word zoneName = args[1];
const point outsidePoint = args.argRead<point>(2);
const point outsidePoint = args.read<point>(2);
Info<< "Orienting faceZone " << zoneName
<< " such that " << outsidePoint << " is outside"

View File

@ -401,7 +401,7 @@ int main(int argc, char *argv[])
}
}
const scalar featureAngle = args.argRead<scalar>(1);
const scalar featureAngle = args.read<scalar>(1);
const scalar minCos = Foam::cos(degToRad(featureAngle));
Info<< "Feature:" << featureAngle << endl
@ -409,7 +409,7 @@ int main(int argc, char *argv[])
<< endl;
const bool splitAllFaces = args.optionFound("splitAllFaces");
const bool splitAllFaces = args.found("splitAllFaces");
if (splitAllFaces)
{
Info<< "Splitting all internal faces to create multiple faces"
@ -417,12 +417,9 @@ int main(int argc, char *argv[])
<< endl;
}
const bool overwrite = args.optionFound("overwrite");
const bool doNotPreserveFaceZones = args.optionFound
(
"doNotPreserveFaceZones"
);
const bool concaveMultiCells = args.optionFound("concaveMultiCells");
const bool overwrite = args.found("overwrite");
const bool doNotPreserveFaceZones = args.found("doNotPreserveFaceZones");
const bool concaveMultiCells = args.found("concaveMultiCells");
if (concaveMultiCells)
{
Info<< "Generating multiple cells for points on concave feature edges."

View File

@ -182,9 +182,9 @@ int main(int argc, char *argv[])
// Read/construct control dictionary
//
const bool readDict = args.optionFound("dict");
const bool refineAllCells = args.optionFound("all");
const bool overwrite = args.optionFound("overwrite");
const bool readDict = args.found("dict");
const bool refineAllCells = args.found("all");
const bool overwrite = args.found("overwrite");
// List of cells to refine
labelList refCells;

View File

@ -653,9 +653,9 @@ int main(int argc, char *argv[])
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
const bool readDict = args.optionFound("dict");
const bool doFrontWidth = args.optionFound("frontWidth");
const bool overwrite = args.optionFound("overwrite");
const bool readDict = args.found("dict");
const bool doFrontWidth = args.found("frontWidth");
const bool overwrite = args.found("overwrite");
label band;
scalar profile;

View File

@ -83,10 +83,10 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
vector n1(args.argRead<vector>(1));
vector n1(args.read<vector>(1));
n1 /= mag(n1);
vector n2(args.argRead<vector>(2));
vector n2(args.read<vector>(2));
n2 /= mag(n2);
const tensor rotT(rotationTensor(n1, n2));

View File

@ -768,10 +768,10 @@ int main(int argc, char *argv[])
#include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
const bool writeVTK = !args.optionFound("noVTK");
const bool loop = args.optionFound("loop");
const bool batch = args.optionFound("batch");
const bool noSync = args.optionFound("noSync");
const bool writeVTK = !args.found("noVTK");
const bool loop = args.found("loop");
const bool batch = args.found("batch");
const bool noSync = args.found("noSync");
if (loop && !batch)
{

View File

@ -77,7 +77,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
const bool noFlipMap = args.optionFound("noFlipMap");
const bool noFlipMap = args.found("noFlipMap");
// Get times list
(void)timeSelector::selectIfPresent(runTime, args);

View File

@ -129,7 +129,7 @@ int main(int argc, char *argv[])
const word setName = args[1];
const word masterPatch = args[2];
const word slavePatch = args[3];
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
// List of faces to split
faceSet facesSet(mesh, setName);

View File

@ -1487,23 +1487,23 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
word blockedFacesName;
if (args.optionReadIfPresent("blockedFaces", blockedFacesName))
if (args.readIfPresent("blockedFaces", blockedFacesName))
{
Info<< "Reading blocked internal faces from faceSet "
<< blockedFacesName << nl << endl;
}
const bool makeCellZones = args.optionFound("makeCellZones");
const bool largestOnly = args.optionFound("largestOnly");
const bool insidePoint = args.optionFound("insidePoint");
const bool useCellZones = args.optionFound("cellZones");
const bool useCellZonesOnly = args.optionFound("cellZonesOnly");
const bool useCellZonesFile = args.optionFound("cellZonesFileOnly");
const bool overwrite = args.optionFound("overwrite");
const bool detectOnly = args.optionFound("detectOnly");
const bool sloppyCellZones = args.optionFound("sloppyCellZones");
const bool useFaceZones = args.optionFound("useFaceZones");
const bool prefixRegion = args.optionFound("prefixRegion");
const bool makeCellZones = args.found("makeCellZones");
const bool largestOnly = args.found("largestOnly");
const bool insidePoint = args.found("insidePoint");
const bool useCellZones = args.found("cellZones");
const bool useCellZonesOnly = args.found("cellZonesOnly");
const bool useCellZonesFile = args.found("cellZonesFileOnly");
const bool overwrite = args.found("overwrite");
const bool detectOnly = args.found("detectOnly");
const bool sloppyCellZones = args.found("sloppyCellZones");
const bool useFaceZones = args.found("useFaceZones");
const bool prefixRegion = args.found("prefixRegion");
if
@ -2001,7 +2001,7 @@ int main(int argc, char *argv[])
if (insidePoint)
{
const point insidePoint = args.optionRead<point>("insidePoint");
const point insidePoint = args.opt<point>("insidePoint");
label regionI = -1;

View File

@ -153,7 +153,7 @@ int main(int argc, char *argv[])
if (useCommandArgs)
{
if (args.optionFound("dict"))
if (args.found("dict"))
{
FatalErrorInFunction
<< "Cannot specify both dictionary and command-line arguments"
@ -171,21 +171,21 @@ int main(int argc, char *argv[])
{
// Carp about inapplicable options
if (args.optionFound("integral"))
if (args.found("integral"))
{
FatalErrorInFunction
<< "Only specify -integral with command-line arguments"
<< endl;
}
if (args.optionFound("partial"))
if (args.found("partial"))
{
FatalErrorInFunction
<< "Only specify -partial with command-line arguments"
<< endl;
}
if (args.optionFound("perfect"))
if (args.found("perfect"))
{
FatalErrorInFunction
<< "Only specify -perfect with command-line arguments"
@ -199,8 +199,8 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
const bool intermediate = args.optionFound("intermediate");
const bool overwrite = args.optionFound("overwrite");
const bool intermediate = args.found("intermediate");
const bool overwrite = args.found("overwrite");
const word dictName("stitchMeshDict");
@ -210,9 +210,9 @@ int main(int argc, char *argv[])
if (useCommandArgs)
{
// Command argument driven:
const int integralCover = args.optionFound("integral");
const int partialCover = args.optionFound("partial");
const int perfectCover = args.optionFound("perfect");
const int integralCover = args.found("integral");
const int partialCover = args.found("partial");
const int perfectCover = args.found("perfect");
if ((integralCover + partialCover + perfectCover) > 1)
{
@ -377,7 +377,7 @@ int main(int argc, char *argv[])
// set up the tolerances for the sliding mesh
dictionary slidingTolerances;
if (args.optionFound("toleranceDict"))
if (args.found("toleranceDict"))
{
IOdictionary toleranceFile
(

View File

@ -376,8 +376,8 @@ int main(int argc, char *argv[])
word meshInstance = mesh.pointsInstance();
word fieldsInstance = runTime.timeName();
const bool overwrite = args.optionFound("overwrite");
const bool specifiedInstance = args.optionReadIfPresent
const bool overwrite = args.found("overwrite");
const bool specifiedInstance = args.readIfPresent
(
"resultTime",
fieldsInstance
@ -396,7 +396,7 @@ int main(int argc, char *argv[])
labelList exposedPatchIDs;
if (args.optionFound("patch"))
if (args.found("patch"))
{
const word patchName = args["patch"];
@ -412,9 +412,9 @@ int main(int argc, char *argv[])
Info<< "Adding exposed internal faces to patch " << patchName
<< nl << endl;
}
else if (args.optionFound("patches"))
else if (args.found("patches"))
{
const wordReList patchNames(args.optionRead<wordReList>("patches"));
const wordReList patchNames(args.opt<wordReList>("patches"));
exposedPatchIDs = mesh.boundaryMesh().patchSet(patchNames).sortedToc();

View File

@ -217,7 +217,7 @@ int main(int argc, char *argv[])
#include "createNamedPolyMesh.H"
const bool noSync = args.optionFound("noSync");
const bool noSync = args.found("noSync");
const word dictName("topoSetDict");
#include "setSystemMeshDictionaryIO.H"

View File

@ -202,7 +202,7 @@ int main(int argc, char *argv[])
#include "addRegionOption.H"
#include "setRootCase.H"
const bool doRotateFields = args.optionFound("rotateFields");
const bool doRotateFields = args.found("rotateFields");
// Verify that an operation has been specified
{
@ -216,11 +216,11 @@ int main(int argc, char *argv[])
"scale"
};
if (!args.optionCount(operationNames))
if (!args.count(operationNames))
{
FatalError
<< "No operation supplied, "
<< "use least one of the following:" << nl
<< "use at least one of the following:" << nl
<< " ";
for (const auto& opName : operationNames)
@ -239,7 +239,7 @@ int main(int argc, char *argv[])
word regionName = polyMesh::defaultRegion;
fileName meshDir = polyMesh::meshSubDir;
if (args.optionReadIfPresent("region", regionName))
if (args.readIfPresent("region", regionName))
{
meshDir = regionName/polyMesh::meshSubDir;
}
@ -259,7 +259,7 @@ int main(int argc, char *argv[])
);
vector v;
if (args.optionReadIfPresent("translate", v))
if (args.readIfPresent("translate", v))
{
Info<< "Translating points by " << v << endl;
@ -267,18 +267,18 @@ int main(int argc, char *argv[])
}
vector origin;
const bool useOrigin = args.optionReadIfPresent("origin", origin);
const bool useOrigin = args.readIfPresent("origin", origin);
if (useOrigin)
{
Info<< "Set origin for rotations to " << origin << endl;
points -= origin;
}
if (args.optionFound("rotate"))
if (args.found("rotate"))
{
Pair<vector> n1n2
(
args.optionLookup("rotate")()
args.lookup("rotate")()
);
n1n2[0] /= mag(n1n2[0]);
n1n2[1] /= mag(n1n2[1]);
@ -294,11 +294,11 @@ int main(int argc, char *argv[])
rotateFields(args, runTime, rotT);
}
}
else if (args.optionFound("rotate-angle"))
else if (args.found("rotate-angle"))
{
const Tuple2<vector, scalar> axisAngle
(
args.optionLookup("rotate-angle")()
args.lookup("rotate-angle")()
);
Info<< "Rotating points " << nl
@ -319,7 +319,7 @@ int main(int argc, char *argv[])
rotateFields(args, runTime, quat.R());
}
}
else if (args.optionReadIfPresent("rollPitchYaw", v))
else if (args.readIfPresent("rollPitchYaw", v))
{
Info<< "Rotating points by" << nl
<< " roll " << v.x() << nl
@ -339,7 +339,7 @@ int main(int argc, char *argv[])
rotateFields(args, runTime, quat.R());
}
}
else if (args.optionReadIfPresent("yawPitchRoll", v))
else if (args.readIfPresent("yawPitchRoll", v))
{
Info<< "Rotating points by" << nl
<< " yaw " << v.x() << nl
@ -360,10 +360,10 @@ int main(int argc, char *argv[])
}
}
if (args.optionFound("scale"))
if (args.found("scale"))
{
// Use readList to handle single or multiple values
const List<scalar> scaling = args.optionReadList<scalar>("scale");
const List<scalar> scaling = args.readList<scalar>("scale");
if (scaling.size() == 1)
{

View File

@ -316,14 +316,14 @@ int main(int argc, char *argv[])
argList args(argc, argv);
const bool listIncludes = args.optionFound("includes");
const bool listIncludes = args.found("includes");
if (listIncludes)
{
Foam::functionEntries::includeEntry::log = true;
}
const bool disableEntries = args.optionFound("disableFunctionEntries");
const bool disableEntries = args.found("disableFunctionEntries");
if (disableEntries)
{
Info<< "Not expanding variables or dictionary directives" << endl;
@ -352,7 +352,7 @@ int main(int argc, char *argv[])
{
return 0;
}
else if (args.optionFound("expand"))
else if (args.found("expand"))
{
IOobject::writeBanner(Info)
<<"//\n// " << dictFileName << "\n//\n";
@ -370,7 +370,7 @@ int main(int argc, char *argv[])
dictionary diffDict;
{
fileName diffFileName;
if (args.optionReadIfPresent("diff", diffFileName))
if (args.readIfPresent("diff", diffFileName))
{
IFstream diffFile(diffFileName);
if (!diffFile.good())
@ -384,7 +384,7 @@ int main(int argc, char *argv[])
diffDict.read(diffFile, true);
optDiff = true;
}
else if (args.optionReadIfPresent("diffEtc", diffFileName))
else if (args.readIfPresent("diffEtc", diffFileName))
{
fileName foundName = findEtcFile(diffFileName);
if (foundName.empty())
@ -409,18 +409,18 @@ int main(int argc, char *argv[])
}
word scopedName; // Actually fileName, since it can contain '/' scoping
if (args.optionReadIfPresent("entry", scopedName))
if (args.readIfPresent("entry", scopedName))
{
upgradeScope(scopedName);
string newValue;
if
(
args.optionReadIfPresent("set", newValue)
|| args.optionReadIfPresent("add", newValue)
args.readIfPresent("set", newValue)
|| args.readIfPresent("add", newValue)
)
{
const bool overwrite = args.optionFound("set");
const bool overwrite = args.found("set");
// Dictionary name and keyword
const dictAndKeyword dAk(scopedName);
@ -455,7 +455,7 @@ int main(int argc, char *argv[])
Info<< finder.ref();
}
}
else if (args.optionFound("remove"))
else if (args.found("remove"))
{
// Dictionary name and keyword
const dictAndKeyword dAk(scopedName);
@ -510,14 +510,14 @@ int main(int argc, char *argv[])
<< "Cannot find entry " << scopedName
<< exit(FatalIOError, 2);
}
else if (args.optionFound("keywords"))
else if (args.found("keywords"))
{
for (const entry& e : finder.dict())
{
Info<< e.keyword() << endl;
}
}
else if (args.optionFound("value"))
else if (args.found("value"))
{
if (finder.isDict())
{
@ -543,7 +543,7 @@ int main(int argc, char *argv[])
}
}
}
else if (args.optionFound("keywords"))
else if (args.found("keywords"))
{
for (const entry& e : dict)
{

View File

@ -251,7 +251,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
// enable noConstant by switching
if (!args.optionFound("noConstant"))
if (!args.found("noConstant"))
{
args.setOption("constant", "");
}
@ -266,7 +266,7 @@ int main(int argc, char *argv[])
// Optional mesh (used to read Clouds)
autoPtr<polyMesh> meshPtr;
const bool enableEntries = args.optionFound("enableFunctionEntries");
const bool enableEntries = args.found("enableFunctionEntries");
if (enableEntries)
{
Info<< "Allowing dictionary preprocessing ('#include', '#codeStream')."
@ -288,7 +288,7 @@ int main(int argc, char *argv[])
fileName meshDir = polyMesh::meshSubDir;
fileName regionPrefix = "";
word regionName = polyMesh::defaultRegion;
if (args.optionReadIfPresent("region", regionName))
if (args.readIfPresent("region", regionName))
{
Info<< "Using region " << regionName << nl << endl;
regionPrefix = regionName;

View File

@ -92,14 +92,14 @@ void Foam::helpTypes::helpBoundary::execute
word condition(word::null);
word fieldName(word::null);
if (args.optionReadIfPresent("browse", condition))
if (args.readIfPresent("browse", condition))
{
// TODO: strip scoping info if present?
// e.g. conditions with leading "compressible::" will not be found
// ".*[fF]vPatchField.*" + className + ".*"
displayDoc(condition, ".*[fF]vPatchField.*", false, "H");
}
else if (args.optionFound("constraint"))
else if (args.found("constraint"))
{
HashSet<word> constraintTypes(fvPatch::constraintTypes());
Info<< "Constraint types:" << nl;
@ -109,7 +109,7 @@ void Foam::helpTypes::helpBoundary::execute
}
Info<< endl;
}
else if (args.optionReadIfPresent("field", fieldName))
else if (args.readIfPresent("field", fieldName))
{
IOobject fieldHeader
(
@ -122,7 +122,7 @@ void Foam::helpTypes::helpBoundary::execute
// Check for any type of volField
if (fieldHeader.typeHeaderOk<volScalarField>(false))
{
if (args.optionFound("fixedValue"))
if (args.found("fixedValue"))
{
fixedValueFieldConditions<scalar>(fieldHeader);
fixedValueFieldConditions<vector>(fieldHeader);
@ -145,7 +145,7 @@ void Foam::helpTypes::helpBoundary::execute
<< "Unable to read field " << fieldName << exit(FatalError);
}
}
else if (args.optionReadIfPresent("fixedValue", fieldName))
else if (args.readIfPresent("fixedValue", fieldName))
{
FatalErrorInFunction
<< "-field option must be specified when using the -fixedValue "

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