mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -28,7 +28,7 @@ surfaceScalarField phi
|
|||||||
fvc::flux(U)
|
fvc::flux(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (args.optionFound("initialiseUBCs"))
|
if (args.found("initialiseUBCs"))
|
||||||
{
|
{
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
phi = fvc::flux(U);
|
phi = fvc::flux(U);
|
||||||
@ -41,7 +41,7 @@ if (args.optionFound("initialiseUBCs"))
|
|||||||
word pName("p");
|
word pName("p");
|
||||||
|
|
||||||
// Update name of the pressure field from the command-line option
|
// 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
|
// Infer the pressure BCs from the velocity
|
||||||
wordList pBCTypes
|
wordList pBCTypes
|
||||||
|
|||||||
@ -28,7 +28,7 @@ surfaceScalarField phi
|
|||||||
fvc::flux(U)
|
fvc::flux(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (args.optionFound("initialiseUBCs"))
|
if (args.found("initialiseUBCs"))
|
||||||
{
|
{
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
phi = fvc::flux(U);
|
phi = fvc::flux(U);
|
||||||
@ -41,7 +41,7 @@ if (args.optionFound("initialiseUBCs"))
|
|||||||
word pName("p");
|
word pName("p");
|
||||||
|
|
||||||
// Update name of the pressure field from the command-line option
|
// 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
|
// Infer the pressure BCs from the velocity
|
||||||
wordList pBCTypes
|
wordList pBCTypes
|
||||||
|
|||||||
@ -193,13 +193,13 @@ int main(int argc, char *argv[])
|
|||||||
phi.write();
|
phi.write();
|
||||||
|
|
||||||
// Optionally write Phi
|
// Optionally write Phi
|
||||||
if (args.optionFound("writePhi"))
|
if (args.found("writePhi"))
|
||||||
{
|
{
|
||||||
Phi.write();
|
Phi.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the pressure field from the Euler equation
|
// Calculate the pressure field from the Euler equation
|
||||||
if (args.optionFound("writep"))
|
if (args.found("writep"))
|
||||||
{
|
{
|
||||||
Info<< nl << "Calculating approximate pressure field" << endl;
|
Info<< nl << "Calculating approximate pressure field" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -181,13 +181,13 @@ int main(int argc, char *argv[])
|
|||||||
phi.write();
|
phi.write();
|
||||||
|
|
||||||
// Optionally write Phi
|
// Optionally write Phi
|
||||||
if (args.optionFound("writePhi"))
|
if (args.found("writePhi"))
|
||||||
{
|
{
|
||||||
Phi.write();
|
Phi.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the pressure field from the Euler equation
|
// Calculate the pressure field from the Euler equation
|
||||||
if (args.optionFound("writep"))
|
if (args.found("writep"))
|
||||||
{
|
{
|
||||||
Info<< nl << "Calculating approximate pressure field" << endl;
|
Info<< nl << "Calculating approximate pressure field" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
psi.write();
|
psi.write();
|
||||||
|
|
||||||
if (!args.optionFound("noH") || args.optionFound("HdotGradH"))
|
if (!args.found("noH") || args.found("HdotGradH"))
|
||||||
{
|
{
|
||||||
volVectorField H
|
volVectorField H
|
||||||
(
|
(
|
||||||
@ -99,7 +99,7 @@ int main(int argc, char *argv[])
|
|||||||
fvc::reconstruct(fvc::snGrad(psi)*mesh.magSf())
|
fvc::reconstruct(fvc::snGrad(psi)*mesh.magSf())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!args.optionFound("noH"))
|
if (!args.found("noH"))
|
||||||
{
|
{
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "Creating field H for time "
|
<< "Creating field H for time "
|
||||||
@ -108,7 +108,7 @@ int main(int argc, char *argv[])
|
|||||||
H.write();
|
H.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("HdotGradH"))
|
if (args.found("HdotGradH"))
|
||||||
{
|
{
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "Creating field HdotGradH for time "
|
<< "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
|
Info<< nl
|
||||||
<< "Creating field B for time "
|
<< "Creating field B for time "
|
||||||
|
|||||||
@ -123,7 +123,7 @@ volScalarField alphac
|
|||||||
);
|
);
|
||||||
|
|
||||||
word kinematicCloudName("kinematicCloud");
|
word kinematicCloudName("kinematicCloud");
|
||||||
args.optionReadIfPresent("cloud", kinematicCloudName);
|
args.readIfPresent("cloud", kinematicCloudName);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
basicKinematicTypeCloud kinematicCloud
|
basicKinematicTypeCloud kinematicCloud
|
||||||
|
|||||||
@ -58,7 +58,7 @@ volScalarField mu
|
|||||||
);
|
);
|
||||||
|
|
||||||
word kinematicCloudName("kinematicCloud");
|
word kinematicCloudName("kinematicCloud");
|
||||||
args.optionReadIfPresent("cloud", kinematicCloudName);
|
args.readIfPresent("cloud", kinematicCloudName);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
basicKinematicCollidingCloud kinematicCloud
|
basicKinematicCollidingCloud kinematicCloud
|
||||||
|
|||||||
@ -51,7 +51,7 @@ autoPtr<compressible::turbulenceModel> turbulence
|
|||||||
|
|
||||||
const word kinematicCloudName
|
const word kinematicCloudName
|
||||||
(
|
(
|
||||||
args.optionLookupOrDefault<word>("cloud", "kinematicCloud")
|
args.lookupOrDefault<word>("cloud", "kinematicCloud")
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
|
|||||||
@ -96,7 +96,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< nl << "Specify an option! " << nl << endl;
|
Info<< nl << "Specify an option! " << nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("label"))
|
if (args.found("label"))
|
||||||
{
|
{
|
||||||
FixedList<label, 100000> list1(1);
|
FixedList<label, 100000> list1(1);
|
||||||
FixedList<label, 100000> list2(0);
|
FixedList<label, 100000> list2(0);
|
||||||
@ -104,7 +104,7 @@ int main(int argc, char *argv[])
|
|||||||
runSwapTest(1000001, list1, list2);
|
runSwapTest(1000001, list1, list2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("float"))
|
if (args.found("float"))
|
||||||
{
|
{
|
||||||
FixedList<double, 100000> list1(1.0);
|
FixedList<double, 100000> list1(1.0);
|
||||||
FixedList<double, 100000> list2(0.0);
|
FixedList<double, 100000> list2(0.0);
|
||||||
@ -112,7 +112,7 @@ int main(int argc, char *argv[])
|
|||||||
runSwapTest(1000001, list1, list2);
|
runSwapTest(1000001, list1, list2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("vector"))
|
if (args.found("vector"))
|
||||||
{
|
{
|
||||||
FixedList<vector, 100000> list1(vector::one);
|
FixedList<vector, 100000> list1(vector::one);
|
||||||
FixedList<vector, 100000> list2(vector::zero);
|
FixedList<vector, 100000> list2(vector::zero);
|
||||||
@ -120,7 +120,7 @@ int main(int argc, char *argv[])
|
|||||||
runSwapTest(100001, list1, list2);
|
runSwapTest(100001, list1, list2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("labelList"))
|
if (args.found("labelList"))
|
||||||
{
|
{
|
||||||
typedef labelList testType;
|
typedef labelList testType;
|
||||||
testType initVal(500);
|
testType initVal(500);
|
||||||
@ -134,7 +134,7 @@ int main(int argc, char *argv[])
|
|||||||
runSwapTest(100001, list1, list2);
|
runSwapTest(100001, list1, list2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("vectorList"))
|
if (args.found("vectorList"))
|
||||||
{
|
{
|
||||||
typedef vectorList testType;
|
typedef vectorList testType;
|
||||||
testType initVal(500);
|
testType initVal(500);
|
||||||
@ -148,7 +148,7 @@ int main(int argc, char *argv[])
|
|||||||
runSwapTest(100001, list1, list2);
|
runSwapTest(100001, list1, list2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("fixedLabel"))
|
if (args.found("fixedLabel"))
|
||||||
{
|
{
|
||||||
typedef FixedList<label,1000> testType;
|
typedef FixedList<label,1000> testType;
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ int main(int argc, char *argv[])
|
|||||||
runSwapTest(100001, list1, list2);
|
runSwapTest(100001, list1, list2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("fixedLabelList"))
|
if (args.found("fixedLabelList"))
|
||||||
{
|
{
|
||||||
typedef labelList testType;
|
typedef labelList testType;
|
||||||
typedef FixedList<testType,10> containerType;
|
typedef FixedList<testType,10> containerType;
|
||||||
|
|||||||
@ -53,8 +53,8 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
bool writeObj = args.optionFound("writeObj");
|
bool writeObj = args.found("writeObj");
|
||||||
bool normalise = args.optionFound("normalise");
|
bool normalise = args.found("normalise");
|
||||||
|
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
|||||||
@ -151,9 +151,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
const bool optStd = args.optionFound("std");
|
const bool optStd = args.found("std");
|
||||||
const bool optSet = args.optionFound("set");
|
const bool optSet = args.found("set");
|
||||||
const bool optFnd = args.optionFound("find");
|
const bool optFnd = args.found("find");
|
||||||
|
|
||||||
|
|
||||||
cpuTime timer;
|
cpuTime timer;
|
||||||
|
|||||||
@ -49,9 +49,9 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
wordReList matcher;
|
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;
|
Info<<"limit names: " << matcher << nl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,7 +117,7 @@ int main(int argc, char *argv[])
|
|||||||
printInfo(idl3);
|
printInfo(idl3);
|
||||||
|
|
||||||
fileName binaryOutput;
|
fileName binaryOutput;
|
||||||
if (args.optionReadIfPresent("binary", binaryOutput))
|
if (args.readIfPresent("binary", binaryOutput))
|
||||||
{
|
{
|
||||||
Info<<"Writing output to " << binaryOutput << endl;
|
Info<<"Writing output to " << binaryOutput << endl;
|
||||||
|
|
||||||
|
|||||||
@ -331,29 +331,29 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
scalar xxx(-1);
|
scalar xxx(-1);
|
||||||
|
|
||||||
if (args.optionFound("flag"))
|
if (args.found("flag"))
|
||||||
{
|
{
|
||||||
Info<<"-flag:" << args["flag"] << endl;
|
Info<<"-flag:" << args["flag"] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionReadIfPresent<scalar>("float", xxx))
|
if (args.readIfPresent<scalar>("float", xxx))
|
||||||
{
|
{
|
||||||
Info<<"read float " << xxx << endl;
|
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
|
Info<< nl
|
||||||
|
|||||||
@ -212,28 +212,28 @@ int main(int argc, char *argv[])
|
|||||||
std::initializer_list<label> increments
|
std::initializer_list<label> increments
|
||||||
= {10000, 20000, 40000, 80000, 160000};
|
= {10000, 20000, 40000, 80000, 160000};
|
||||||
|
|
||||||
if (args.optionFound("label"))
|
if (args.found("label"))
|
||||||
{
|
{
|
||||||
List<label> list(10, 1);
|
List<label> list(10, 1);
|
||||||
|
|
||||||
runResizeTest(100000, list, increments);
|
runResizeTest(100000, list, increments);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("float"))
|
if (args.found("float"))
|
||||||
{
|
{
|
||||||
List<double> list(10, 1.0);
|
List<double> list(10, 1.0);
|
||||||
|
|
||||||
runResizeTest(10000, list, increments);
|
runResizeTest(10000, list, increments);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("vector"))
|
if (args.found("vector"))
|
||||||
{
|
{
|
||||||
List<vector> list(10, vector::one);
|
List<vector> list(10, vector::one);
|
||||||
|
|
||||||
runResizeTest(10000, list, increments);
|
runResizeTest(10000, list, increments);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("labelList"))
|
if (args.found("labelList"))
|
||||||
{
|
{
|
||||||
typedef labelList testType;
|
typedef labelList testType;
|
||||||
testType initVal(500, label(1));
|
testType initVal(500, label(1));
|
||||||
@ -243,7 +243,7 @@ int main(int argc, char *argv[])
|
|||||||
runResizeTest(200, list, increments);
|
runResizeTest(200, list, increments);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("vectorList"))
|
if (args.found("vectorList"))
|
||||||
{
|
{
|
||||||
typedef vectorList testType;
|
typedef vectorList testType;
|
||||||
testType initVal(500, vector::one);
|
testType initVal(500, vector::one);
|
||||||
@ -253,7 +253,7 @@ int main(int argc, char *argv[])
|
|||||||
runResizeTest(100, list, increments);
|
runResizeTest(100, list, increments);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("order"))
|
if (args.found("order"))
|
||||||
{
|
{
|
||||||
List<label> list(100000000, 1);
|
List<label> list(100000000, 1);
|
||||||
|
|
||||||
|
|||||||
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
|
|||||||
argList args(argc, argv, false, true);
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
|
|
||||||
if (args.optionFound("mask"))
|
if (args.found("mask"))
|
||||||
{
|
{
|
||||||
Info<< "bit width: " << unsigned(sizeof(unsigned)*CHAR_BIT) << endl;
|
Info<< "bit width: " << unsigned(sizeof(unsigned)*CHAR_BIT) << endl;
|
||||||
reportInfo<1>();
|
reportInfo<1>();
|
||||||
@ -135,7 +135,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "size: " << packLst.size() << nl;
|
Info<< "size: " << packLst.size() << nl;
|
||||||
|
|
||||||
if (args.optionFound("count"))
|
if (args.found("count"))
|
||||||
{
|
{
|
||||||
unsigned int rawCount = 0;
|
unsigned int rawCount = 0;
|
||||||
forAll(rawLst, elemI)
|
forAll(rawLst, elemI)
|
||||||
@ -149,7 +149,7 @@ int main(int argc, char *argv[])
|
|||||||
<< "packed count: " << packLst.count() << nl;
|
<< "packed count: " << packLst.count() << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("info"))
|
if (args.found("info"))
|
||||||
{
|
{
|
||||||
packLst.printInfo(Info);
|
packLst.printInfo(Info);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ Description
|
|||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
#include "IOstreams.H"
|
#include "IOstreams.H"
|
||||||
|
#include "Switch.H"
|
||||||
#include "StringStream.H"
|
#include "StringStream.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
@ -40,9 +41,9 @@ int main(int argc, char *argv[])
|
|||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
// argList::noFunctionObjects();
|
// argList::noFunctionObjects();
|
||||||
argList::removeOption("case");
|
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("scalar", "value", "Test parsing of scalar");
|
||||||
|
argList::addOption("string", "value", "Test string lookup");
|
||||||
|
|
||||||
// These are actually lies (never had -parseLabel, -parseScalar etc),
|
// These are actually lies (never had -parseLabel, -parseScalar etc),
|
||||||
// but good for testing...
|
// but good for testing...
|
||||||
@ -56,10 +57,15 @@ int main(int argc, char *argv[])
|
|||||||
// Fake a future option...
|
// Fake a future option...
|
||||||
argList::addOptionCompat("label", {"parse-label", 2112});
|
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: "
|
Info<<"have: "
|
||||||
<<args.optionCount({"label", "scalar"}) << " options" << nl;
|
<<args.count({"label", "scalar"}) << " options" << nl;
|
||||||
|
|
||||||
label ival;
|
label ival;
|
||||||
scalar sval;
|
scalar sval;
|
||||||
@ -67,23 +73,59 @@ int main(int argc, char *argv[])
|
|||||||
Info<< nl;
|
Info<< nl;
|
||||||
|
|
||||||
Info<< "-label = " << flush;
|
Info<< "-label = " << flush;
|
||||||
if (args.optionReadIfPresent("label", ival))
|
if (args.readIfPresent("label", ival))
|
||||||
{
|
{
|
||||||
Info<< ival << endl;
|
Info<< ival << nl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "not specified" << endl;
|
Info<< "not specified" << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "-scalar = " << flush;
|
Info<< "-scalar = " << flush;
|
||||||
if (args.optionReadIfPresent("scalar", sval))
|
if (args.readIfPresent("scalar", sval))
|
||||||
{
|
{
|
||||||
Info<< sval << endl;
|
Info<< sval << nl;
|
||||||
}
|
}
|
||||||
else
|
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;
|
Info<< "\nEnd\n" << endl;
|
||||||
|
|||||||
@ -74,9 +74,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const fileName decompFile = args[1];
|
const fileName decompFile = args[1];
|
||||||
|
|
||||||
const bool region = args.optionFound("region");
|
const bool region = args.found("region");
|
||||||
const bool allRegions = args.optionFound("allRegions");
|
const bool allRegions = args.found("allRegions");
|
||||||
const bool verbose = args.optionFound("verbose");
|
const bool verbose = args.found("verbose");
|
||||||
|
|
||||||
// Set time from database
|
// Set time from database
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
@ -85,7 +85,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Allow override of decomposeParDict location
|
// Allow override of decomposeParDict location
|
||||||
fileName decompDictFile;
|
fileName decompDictFile;
|
||||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
args.readIfPresent("decomposeParDict", decompDictFile);
|
||||||
|
|
||||||
wordList regionNames;
|
wordList regionNames;
|
||||||
wordList regionDirs;
|
wordList regionDirs;
|
||||||
@ -109,7 +109,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
word regionName;
|
word regionName;
|
||||||
if (args.optionReadIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
regionNames = wordList(1, regionName);
|
regionNames = wordList(1, regionName);
|
||||||
regionDirs = regionNames;
|
regionDirs = regionNames;
|
||||||
|
|||||||
@ -105,15 +105,15 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
const bool region = args.optionFound("region");
|
const bool region = args.found("region");
|
||||||
const bool allRegions = args.optionFound("allRegions");
|
const bool allRegions = args.found("allRegions");
|
||||||
const bool verbose = args.optionFound("verbose");
|
const bool verbose = args.found("verbose");
|
||||||
|
|
||||||
const label numSubdomains =
|
const label numSubdomains =
|
||||||
args.optionLookupOrDefault<label>("domains", 0);
|
args.lookupOrDefault<label>("domains", 0);
|
||||||
|
|
||||||
const word methodName =
|
const word methodName =
|
||||||
args.optionLookupOrDefault<word>("method", word::null);
|
args.lookupOrDefault<word>("method", word::null);
|
||||||
|
|
||||||
|
|
||||||
// Set time from database
|
// Set time from database
|
||||||
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Allow override of decomposeParDict location
|
// Allow override of decomposeParDict location
|
||||||
fileName decompDictFile;
|
fileName decompDictFile;
|
||||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
args.readIfPresent("decomposeParDict", decompDictFile);
|
||||||
|
|
||||||
wordList regionNames;
|
wordList regionNames;
|
||||||
wordList regionDirs;
|
wordList regionDirs;
|
||||||
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
word regionName;
|
word regionName;
|
||||||
if (args.optionReadIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
regionNames = wordList(1, regionName);
|
regionNames = wordList(1, regionName);
|
||||||
regionDirs = regionNames;
|
regionDirs = regionNames;
|
||||||
|
|||||||
@ -54,8 +54,8 @@ int main(int argc, char *argv[])
|
|||||||
argList::addArgument("dict .. dictN");
|
argList::addArgument("dict .. dictN");
|
||||||
argList args(argc, argv, false, true);
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
const bool optInfo = args.optionFound("info");
|
const bool optInfo = args.found("info");
|
||||||
const bool optValue = args.optionFound("value");
|
const bool optValue = args.found("value");
|
||||||
|
|
||||||
for (label argi=1; argi < args.size(); ++argi)
|
for (label argi=1; argi < args.size(); ++argi)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
|
|||||||
// First handle no parameters
|
// First handle no parameters
|
||||||
if (args.size() == 1)
|
if (args.size() == 1)
|
||||||
{
|
{
|
||||||
if (args.optionFound("list"))
|
if (args.found("list"))
|
||||||
{
|
{
|
||||||
fileNameList results = findEtcDirs();
|
fileNameList results = findEtcDirs();
|
||||||
printList(results);
|
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;
|
int error = 0;
|
||||||
|
|
||||||
|
|||||||
@ -45,11 +45,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
const label maxCount = args.optionLookupOrDefault<label>("max", 1000);
|
const label maxCount = args.lookupOrDefault<label>("max", 1000);
|
||||||
|
|
||||||
externalFileCoupler coupler;
|
externalFileCoupler coupler;
|
||||||
|
|
||||||
if (args.optionFound("slave"))
|
if (args.found("slave"))
|
||||||
{
|
{
|
||||||
const word role = "slave";
|
const word role = "slave";
|
||||||
Info<< "Running as " << role << " max=" << maxCount << endl;
|
Info<< "Running as " << role << " max=" << maxCount << endl;
|
||||||
|
|||||||
@ -177,9 +177,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Run default tests, unless only specific tests are requested
|
// Run default tests, unless only specific tests are requested
|
||||||
const bool defaultTests =
|
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> = ";
|
Info<< "From initializer_list<word> = ";
|
||||||
fileName file1
|
fileName file1
|
||||||
@ -231,7 +231,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// Test various ext() methods
|
// Test various ext() methods
|
||||||
if (args.optionFound("ext"))
|
if (args.found("ext"))
|
||||||
{
|
{
|
||||||
Info<<nl << nl << "handling of fileName extension" << nl;
|
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;
|
unsigned nFail = 0;
|
||||||
Info<< nl << "Test fileName::validate" << nl;
|
Info<< nl << "Test fileName::validate" << nl;
|
||||||
|
|||||||
@ -75,7 +75,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
fileName pathName;
|
fileName pathName;
|
||||||
if (args.optionReadIfPresent("case", pathName))
|
if (args.readIfPresent("case", pathName))
|
||||||
{
|
{
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "-case" << nl
|
<< "-case" << nl
|
||||||
@ -95,10 +95,8 @@ int main(int argc, char *argv[])
|
|||||||
printCleaning(pathName);
|
printCleaning(pathName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("istream"))
|
if (args.readIfPresent("istream", pathName))
|
||||||
{
|
{
|
||||||
args.optionLookup("istream")() >> pathName;
|
|
||||||
|
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "-case" << nl
|
<< "-case" << nl
|
||||||
<< "path = " << args.path() << nl
|
<< "path = " << args.path() << nl
|
||||||
|
|||||||
@ -45,7 +45,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nReps = 10000;
|
label nReps = 10000;
|
||||||
|
|
||||||
const point sample = args.argRead<point>(1);
|
const point sample = args.read<point>(1);
|
||||||
|
|
||||||
const polyMesh::cellDecomposition decompMode = polyMesh::CELL_TETS;
|
const polyMesh::cellDecomposition decompMode = polyMesh::CELL_TETS;
|
||||||
|
|
||||||
|
|||||||
@ -106,8 +106,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const word dictName("fvSolution");
|
const word dictName("fvSolution");
|
||||||
|
|
||||||
bool optRewrite = args.optionFound("rewrite");
|
bool optRewrite = args.found("rewrite");
|
||||||
bool optShow = args.optionFound("show");
|
bool optShow = args.found("show");
|
||||||
|
|
||||||
IOdictionary solutionDict
|
IOdictionary solutionDict
|
||||||
(
|
(
|
||||||
|
|||||||
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
argList args(argc, argv, false, true);
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
if (args.optionFound("verbose"))
|
if (args.found("verbose"))
|
||||||
{
|
{
|
||||||
labelRange::debug = 1;
|
labelRange::debug = 1;
|
||||||
}
|
}
|
||||||
@ -101,8 +101,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
label start = args.argRead<label>(argI);
|
label start = args.read<label>(argI);
|
||||||
label size = args.argRead<label>(argI+1);
|
label size = args.read<label>(argI+1);
|
||||||
++argI;
|
++argI;
|
||||||
|
|
||||||
range.reset(start, size);
|
range.reset(start, size);
|
||||||
|
|||||||
@ -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));
|
tensorField mI(momentOfInertia::meshInertia(mesh));
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const string& srcFile = args[argI];
|
const string& srcFile = args[argI];
|
||||||
|
|
||||||
if (args.optionFound("ext"))
|
if (args.found("ext"))
|
||||||
{
|
{
|
||||||
if (mvBak(srcFile, args["ext"]))
|
if (mvBak(srcFile, args["ext"]))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -166,8 +166,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
recursive = Switch(args[1]);
|
recursive = Switch(args[1]);
|
||||||
|
|
||||||
const bool optMesh = args.optionFound("mesh");
|
const bool optMesh = args.found("mesh");
|
||||||
const bool optSkip = args.optionFound("skip");
|
const bool optSkip = args.found("skip");
|
||||||
const objectRegistry& db = (optMesh ? mesh.thisDb() : runTime);
|
const objectRegistry& db = (optMesh ? mesh.thisDb() : runTime);
|
||||||
|
|
||||||
Info<<"## start ##" << nl;
|
Info<<"## start ##" << nl;
|
||||||
|
|||||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
vector rotVector;
|
vector rotVector;
|
||||||
|
|
||||||
if (args.optionReadIfPresent("rollPitchYaw", rotVector))
|
if (args.readIfPresent("rollPitchYaw", rotVector))
|
||||||
{
|
{
|
||||||
Info<< "Rotate by" << nl
|
Info<< "Rotate by" << nl
|
||||||
<< " roll " << rotVector.x() << nl
|
<< " roll " << rotVector.x() << nl
|
||||||
@ -81,7 +81,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "quaternion " << quat << endl;
|
Info<< "quaternion " << quat << endl;
|
||||||
Info<< "rotation = " << quat.R() << endl;
|
Info<< "rotation = " << quat.R() << endl;
|
||||||
}
|
}
|
||||||
if (args.optionReadIfPresent("yawPitchRoll", rotVector))
|
if (args.readIfPresent("yawPitchRoll", rotVector))
|
||||||
{
|
{
|
||||||
Info<< "Rotate by" << nl
|
Info<< "Rotate by" << nl
|
||||||
<< " yaw " << rotVector.x() << nl
|
<< " yaw " << rotVector.x() << nl
|
||||||
@ -96,11 +96,11 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "quaternion " << quat << endl;
|
Info<< "quaternion " << quat << endl;
|
||||||
Info<< "rotation = " << quat.R() << endl;
|
Info<< "rotation = " << quat.R() << endl;
|
||||||
}
|
}
|
||||||
if (args.optionFound("rotate-angle"))
|
if (args.found("rotate-angle"))
|
||||||
{
|
{
|
||||||
const Tuple2<vector, scalar> axisAngle
|
const Tuple2<vector, scalar> axisAngle
|
||||||
(
|
(
|
||||||
args.optionLookup("rotate-angle")()
|
args.lookup("rotate-angle")()
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Rotate" << nl
|
Info<< "Rotate" << nl
|
||||||
|
|||||||
@ -63,9 +63,9 @@ int main(int argc, char *argv[])
|
|||||||
args.printUsage();
|
args.printUsage();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool useBSpline = args.optionFound("B");
|
bool useBSpline = args.found("B");
|
||||||
bool useCatmullRom = args.optionFound("CMR");
|
bool useCatmullRom = args.found("CMR");
|
||||||
label nSeg = args.optionLookupOrDefault<label>("n", 20);
|
label nSeg = args.lookupOrDefault<label>("n", 20);
|
||||||
|
|
||||||
if (!useCatmullRom && !useBSpline)
|
if (!useCatmullRom && !useBSpline)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -105,18 +105,12 @@ int main(int argc, char *argv[])
|
|||||||
args.printUsage();
|
args.printUsage();
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool keepEmpty = args.optionFound("empty");
|
const bool keepEmpty = args.found("empty");
|
||||||
|
|
||||||
int nopts = 0;
|
const label nopts =
|
||||||
for (auto optName : { "any", "slash", "space", "sub", "fixed", "char" })
|
args.count({"any", "slash", "space", "sub", "fixed", "char"});
|
||||||
{
|
|
||||||
if (args.optionFound(optName))
|
|
||||||
{
|
|
||||||
++nopts;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args.optionFound("any"))
|
if (args.found("any"))
|
||||||
{
|
{
|
||||||
const std::string& str = args["any"];
|
const std::string& str = args["any"];
|
||||||
Info<< "split on any chars" << nl
|
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"];
|
const std::string& str = args["sub"];
|
||||||
Info<< "split on substring" << nl
|
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
|
Info<< "split on space" << nl
|
||||||
<< "~~~~~~~~~~~~~~" << 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];
|
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
|
Info<< "split on fixed width = " << width << nl
|
||||||
<< "~~~~~~~~~~~~~~" << nl;
|
<< "~~~~~~~~~~~~~~" << nl;
|
||||||
@ -210,7 +204,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
if (!nopts || args.optionFound("slash"))
|
if (!nopts || args.found("slash"))
|
||||||
{
|
{
|
||||||
const char delim = '/';
|
const char delim = '/';
|
||||||
|
|
||||||
|
|||||||
@ -128,7 +128,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.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");
|
const word outputFile(args.executable() + ".obj");
|
||||||
|
|
||||||
@ -145,18 +145,18 @@ int main(int argc, char *argv[])
|
|||||||
Info<< endl;
|
Info<< endl;
|
||||||
|
|
||||||
|
|
||||||
if (args.optionFound("debug2"))
|
if (args.found("debug2"))
|
||||||
{
|
{
|
||||||
surfaceIntersection::debug |= 2;
|
surfaceIntersection::debug |= 2;
|
||||||
}
|
}
|
||||||
if (args.optionFound("debug4"))
|
if (args.found("debug4"))
|
||||||
{
|
{
|
||||||
surfaceIntersection::debug |= 4;
|
surfaceIntersection::debug |= 4;
|
||||||
}
|
}
|
||||||
const bool optPrint = args.optionFound("print");
|
const bool optPrint = args.found("print");
|
||||||
|
|
||||||
dictionary intersectOptions;
|
dictionary intersectOptions;
|
||||||
if (args.optionFound("dict"))
|
if (args.found("dict"))
|
||||||
{
|
{
|
||||||
intersectOptions = IOdictionary
|
intersectOptions = IOdictionary
|
||||||
(
|
(
|
||||||
@ -190,12 +190,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
word mergeOp;
|
word mergeOp;
|
||||||
if (args.optionFound("mergePoints"))
|
if (args.found("mergePoints"))
|
||||||
{
|
{
|
||||||
cuts.mergePoints(args.optionRead<scalar>("mergePoints"));
|
cuts.mergePoints(args.opt<scalar>("mergePoints"));
|
||||||
mergeOp = "mergePoints";
|
mergeOp = "mergePoints";
|
||||||
}
|
}
|
||||||
else if (args.optionFound("mergeEdges"))
|
else if (args.found("mergeEdges"))
|
||||||
{
|
{
|
||||||
cuts.mergeEdges();
|
cuts.mergeEdges();
|
||||||
mergeOp = "mergeEdges";
|
mergeOp = "mergeEdges";
|
||||||
|
|||||||
@ -142,8 +142,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
const bool optStdout = args.optionFound("stdout");
|
const bool optStdout = args.found("stdout");
|
||||||
const scalar scaleFactor = args.optionLookupOrDefault("scale", 0.0);
|
const scalar scaleFactor = args.lookupOrDefault("scale", 0.0);
|
||||||
|
|
||||||
const fileName importName = args[1];
|
const fileName importName = args[1];
|
||||||
const fileName exportName = optStdout ? "-stdout" : args[2];
|
const fileName exportName = optStdout ? "-stdout" : args[2];
|
||||||
@ -157,7 +157,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!args.optionFound("triSurface")
|
!args.found("triSurface")
|
||||||
&&
|
&&
|
||||||
(
|
(
|
||||||
!MeshedSurface<face>::canRead(importName, true)
|
!MeshedSurface<face>::canRead(importName, true)
|
||||||
@ -172,7 +172,7 @@ int main(int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("triSurface"))
|
if (args.found("triSurface"))
|
||||||
{
|
{
|
||||||
triSurface surf(importName);
|
triSurface surf(importName);
|
||||||
|
|
||||||
@ -198,14 +198,14 @@ int main(int argc, char *argv[])
|
|||||||
// surf2.read(is); // FAIL: private method
|
// surf2.read(is); // FAIL: private method
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("orient"))
|
if (args.found("orient"))
|
||||||
{
|
{
|
||||||
Info<< "Checking surface orientation" << endl;
|
Info<< "Checking surface orientation" << endl;
|
||||||
PatchTools::checkOrientation(surf, true);
|
PatchTools::checkOrientation(surf, true);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("clean"))
|
if (args.found("clean"))
|
||||||
{
|
{
|
||||||
Info<< "Cleaning up surface" << endl;
|
Info<< "Cleaning up surface" << endl;
|
||||||
surf.cleanup(true);
|
surf.cleanup(true);
|
||||||
@ -234,10 +234,10 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// normally write sorted (looks nicer)
|
// 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);
|
UnsortedMeshedSurface<face> surf(importName);
|
||||||
|
|
||||||
@ -263,14 +263,14 @@ int main(int argc, char *argv[])
|
|||||||
// surf2.read(is); // FAIL: private method
|
// surf2.read(is); // FAIL: private method
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("orient"))
|
if (args.found("orient"))
|
||||||
{
|
{
|
||||||
Info<< "Checking surface orientation" << endl;
|
Info<< "Checking surface orientation" << endl;
|
||||||
PatchTools::checkOrientation(surf, true);
|
PatchTools::checkOrientation(surf, true);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("clean"))
|
if (args.found("clean"))
|
||||||
{
|
{
|
||||||
Info<< "Cleaning up surface" << endl;
|
Info<< "Cleaning up surface" << endl;
|
||||||
surf.cleanup(true);
|
surf.cleanup(true);
|
||||||
@ -301,7 +301,7 @@ int main(int argc, char *argv[])
|
|||||||
surf.write(exportName);
|
surf.write(exportName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionFound("triFace"))
|
else if (args.found("triFace"))
|
||||||
{
|
{
|
||||||
MeshedSurface<triFace> surf(importName);
|
MeshedSurface<triFace> surf(importName);
|
||||||
|
|
||||||
@ -327,14 +327,14 @@ int main(int argc, char *argv[])
|
|||||||
// surf2.read(is); // FAIL: private method
|
// surf2.read(is); // FAIL: private method
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("orient"))
|
if (args.found("orient"))
|
||||||
{
|
{
|
||||||
Info<< "Checking surface orientation" << endl;
|
Info<< "Checking surface orientation" << endl;
|
||||||
PatchTools::checkOrientation(surf, true);
|
PatchTools::checkOrientation(surf, true);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("clean"))
|
if (args.found("clean"))
|
||||||
{
|
{
|
||||||
Info<< "Cleaning up surface" << endl;
|
Info<< "Cleaning up surface" << endl;
|
||||||
surf.cleanup(true);
|
surf.cleanup(true);
|
||||||
@ -391,14 +391,14 @@ int main(int argc, char *argv[])
|
|||||||
// surf2.read(is); // FAIL: private method
|
// surf2.read(is); // FAIL: private method
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("orient"))
|
if (args.found("orient"))
|
||||||
{
|
{
|
||||||
Info<< "Checking surface orientation" << endl;
|
Info<< "Checking surface orientation" << endl;
|
||||||
PatchTools::checkOrientation(surf, true);
|
PatchTools::checkOrientation(surf, true);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("clean"))
|
if (args.found("clean"))
|
||||||
{
|
{
|
||||||
Info<< "Cleaning up surface" << endl;
|
Info<< "Cleaning up surface" << endl;
|
||||||
surf.cleanup(true);
|
surf.cleanup(true);
|
||||||
@ -406,7 +406,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("testModify"))
|
if (args.found("testModify"))
|
||||||
{
|
{
|
||||||
Info<< "Use ModifiableMeshedSurface to shift (1, 0, 0)" << endl;
|
Info<< "Use ModifiableMeshedSurface to shift (1, 0, 0)" << endl;
|
||||||
Info<< "original" << nl;
|
Info<< "original" << nl;
|
||||||
@ -457,7 +457,7 @@ int main(int argc, char *argv[])
|
|||||||
surf.write(exportName);
|
surf.write(exportName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("surfMesh"))
|
if (args.found("surfMesh"))
|
||||||
{
|
{
|
||||||
Foam::Time runTime
|
Foam::Time runTime
|
||||||
(
|
(
|
||||||
|
|||||||
@ -51,9 +51,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
argList args(argc, argv, false, true);
|
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;
|
cpuTime timer;
|
||||||
for (label count = 0; count < repeat; ++count)
|
for (label count = 0; count < repeat; ++count)
|
||||||
@ -111,7 +111,7 @@ int main(int argc, char *argv[])
|
|||||||
<< timer.cpuTimeIncrement() << " s\n\n";
|
<< timer.cpuTimeIncrement() << " s\n\n";
|
||||||
|
|
||||||
fileName inputFile;
|
fileName inputFile;
|
||||||
if (args.optionReadIfPresent("file", inputFile))
|
if (args.readIfPresent("file", inputFile))
|
||||||
{
|
{
|
||||||
IFstream is(inputFile);
|
IFstream is(inputFile);
|
||||||
|
|
||||||
|
|||||||
@ -320,7 +320,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
word emptyPatchName;
|
word emptyPatchName;
|
||||||
if (args.optionReadIfPresent("addEmptyPatch", emptyPatchName))
|
if (args.readIfPresent("addEmptyPatch", emptyPatchName))
|
||||||
{
|
{
|
||||||
dictionary emptyPatchDict;
|
dictionary emptyPatchDict;
|
||||||
emptyPatchDict.add("type", "empty");
|
emptyPatchDict.add("type", "empty");
|
||||||
|
|||||||
@ -691,7 +691,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Reading blocked cells from cellSet " << blockedSetName
|
Info<< "Reading blocked cells from cellSet " << blockedSetName
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
|
|
||||||
// Read faceSets, lookup patches
|
// Read faceSets, lookup patches
|
||||||
|
|||||||
@ -102,10 +102,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
IOdictionary collapseDict(dictIO);
|
IOdictionary collapseDict(dictIO);
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
const bool collapseFaces = args.optionFound("collapseFaces");
|
const bool collapseFaces = args.found("collapseFaces");
|
||||||
const bool collapseFaceSet = args.optionFound("collapseFaceSet");
|
const bool collapseFaceSet = args.found("collapseFaceSet");
|
||||||
|
|
||||||
if (collapseFaces && collapseFaceSet)
|
if (collapseFaces && collapseFaceSet)
|
||||||
{
|
{
|
||||||
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
|
|||||||
word faceSetName("indirectPatchFaces");
|
word faceSetName("indirectPatchFaces");
|
||||||
IOobject::readOption readFlag = IOobject::READ_IF_PRESENT;
|
IOobject::readOption readFlag = IOobject::READ_IF_PRESENT;
|
||||||
|
|
||||||
if (args.optionReadIfPresent("collapseFaceSet", faceSetName))
|
if (args.readIfPresent("collapseFaceSet", faceSetName))
|
||||||
{
|
{
|
||||||
readFlag = IOobject::MUST_READ;
|
readFlag = IOobject::MUST_READ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -368,16 +368,16 @@ int main(int argc, char *argv[])
|
|||||||
#include "createPolyMesh.H"
|
#include "createPolyMesh.H"
|
||||||
const word oldInstance = mesh.pointsInstance();
|
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 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.lookupOrDefault("concaveAngle", 30.0);
|
||||||
scalar concaveSin = Foam::sin(degToRad(concaveAngle));
|
scalar concaveSin = Foam::sin(degToRad(concaveAngle));
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
const bool meshQuality = args.optionFound("meshQuality");
|
const bool meshQuality = args.found("meshQuality");
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@ -345,7 +345,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createPolyMesh.H"
|
#include "createPolyMesh.H"
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
Info<< "Reading modifyMeshDict\n" << endl;
|
Info<< "Reading modifyMeshDict\n" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -73,9 +73,9 @@ int main(int argc, char *argv[])
|
|||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
word cellSetName(args[1]);
|
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
|
Info<< "Reading cells to refine from cellSet " << cellSetName
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
|
|||||||
@ -84,8 +84,8 @@ int main(int argc, char *argv[])
|
|||||||
const wordReList patches((IStringStream(args[1])()));
|
const wordReList patches((IStringStream(args[1])()));
|
||||||
const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches));
|
const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches));
|
||||||
|
|
||||||
const scalar weight = args.argRead<scalar>(2);
|
const scalar weight = args.read<scalar>(2);
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
if (!patchSet.size())
|
if (!patchSet.size())
|
||||||
{
|
{
|
||||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Edit list of cells to refine according to specified set
|
// Edit list of cells to refine according to specified set
|
||||||
word setName;
|
word setName;
|
||||||
if (args.optionReadIfPresent("useSet", setName))
|
if (args.readIfPresent("useSet", setName))
|
||||||
{
|
{
|
||||||
Info<< "Subsetting cells to cut based on cellSet"
|
Info<< "Subsetting cells to cut based on cellSet"
|
||||||
<< setName << nl << endl;
|
<< setName << nl << endl;
|
||||||
|
|||||||
@ -118,7 +118,7 @@ int main(int argc, char *argv[])
|
|||||||
<< " to allow for some truncation error."
|
<< " to allow for some truncation error."
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
|
|
||||||
const bool readLevel = args.optionFound("readLevel");
|
const bool readLevel = args.found("readLevel");
|
||||||
|
|
||||||
const scalarField& vols = mesh.cellVolumes();
|
const scalarField& vols = mesh.cellVolumes();
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,7 @@ int main(int argc, char *argv[])
|
|||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
const word setName = args[1];
|
const word setName = args[1];
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
// Read faces
|
// Read faces
|
||||||
faceSet candidateSet(mesh, setName);
|
faceSet candidateSet(mesh, setName);
|
||||||
|
|||||||
@ -553,15 +553,15 @@ int main(int argc, char *argv[])
|
|||||||
#include "createPolyMesh.H"
|
#include "createPolyMesh.H"
|
||||||
const word oldInstance = mesh.pointsInstance();
|
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 minCos = Foam::cos(degToRad(featureAngle));
|
||||||
const scalar minSin = Foam::sin(degToRad(featureAngle));
|
const scalar minSin = Foam::sin(degToRad(featureAngle));
|
||||||
|
|
||||||
const bool readSet = args.optionFound("set");
|
const bool readSet = args.found("set");
|
||||||
const bool geometry = args.optionFound("geometry");
|
const bool geometry = args.found("geometry");
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
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
|
Info<< "Trying to split cells with internal angles > feature angle\n" << nl
|
||||||
<< "featureAngle : " << featureAngle << nl
|
<< "featureAngle : " << featureAngle << nl
|
||||||
|
|||||||
@ -311,7 +311,7 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
|
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
|
||||||
|
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
|
|||||||
@ -160,11 +160,11 @@ int main(int argc, char *argv[])
|
|||||||
Time runTime(args.rootPath(), args.caseName());
|
Time runTime(args.rootPath(), args.caseName());
|
||||||
runTime.functionObjects().off();
|
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
|
// exportName only has a size when export is in effect
|
||||||
fileName exportName;
|
fileName exportName;
|
||||||
if (args.optionReadIfPresent("name", exportName))
|
if (args.readIfPresent("name", exportName))
|
||||||
{
|
{
|
||||||
const word ext = exportName.ext();
|
const word ext = exportName.ext();
|
||||||
// strip erroneous extension (.ccm, .ccmg, .ccmp)
|
// strip erroneous extension (.ccm, .ccmg, .ccmp)
|
||||||
@ -173,22 +173,22 @@ int main(int argc, char *argv[])
|
|||||||
exportName = exportName.lessExt();
|
exportName = exportName.lessExt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionFound("export"))
|
else if (args.found("export"))
|
||||||
{
|
{
|
||||||
exportName = ccm::writer::defaultMeshName;
|
exportName = ccm::writer::defaultMeshName;
|
||||||
if (args.optionFound("case"))
|
if (args.found("case"))
|
||||||
{
|
{
|
||||||
exportName += '-' + args.globalCaseName();
|
exportName += '-' + args.globalCaseName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// By default, no scaling
|
// 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
|
// Default to binary output, unless otherwise specified
|
||||||
const IOstream::streamFormat format =
|
const IOstream::streamFormat format =
|
||||||
(
|
(
|
||||||
args.optionFound("ascii")
|
args.found("ascii")
|
||||||
? IOstream::ASCII
|
? IOstream::ASCII
|
||||||
: IOstream::BINARY
|
: IOstream::BINARY
|
||||||
);
|
);
|
||||||
@ -201,15 +201,15 @@ int main(int argc, char *argv[])
|
|||||||
// ~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
ccm::reader::options rOpts;
|
ccm::reader::options rOpts;
|
||||||
rOpts.removeBaffles(args.optionFound("noBaffles"));
|
rOpts.removeBaffles(args.found("noBaffles"));
|
||||||
rOpts.mergeInterfaces(args.optionFound("merge"));
|
rOpts.mergeInterfaces(args.found("merge"));
|
||||||
|
|
||||||
if (args.optionFound("numbered"))
|
if (args.found("numbered"))
|
||||||
{
|
{
|
||||||
rOpts.useNumberedNames(true);
|
rOpts.useNumberedNames(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("solids"))
|
if (args.found("solids"))
|
||||||
{
|
{
|
||||||
Info<< "treating solids like fluids" << endl;
|
Info<< "treating solids like fluids" << endl;
|
||||||
rOpts.keepSolid(true);
|
rOpts.keepSolid(true);
|
||||||
@ -235,7 +235,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
args.optionFound("remap")
|
args.found("remap")
|
||||||
? reader.remapMeshInfo(runTime, args["remap"])
|
? reader.remapMeshInfo(runTime, args["remap"])
|
||||||
: reader.remapMeshInfo(runTime)
|
: reader.remapMeshInfo(runTime)
|
||||||
)
|
)
|
||||||
@ -257,7 +257,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
autoPtr<polyMesh> mesh =
|
autoPtr<polyMesh> mesh =
|
||||||
(
|
(
|
||||||
args.optionFound("remap")
|
args.found("remap")
|
||||||
? reader.mesh(runTime, args["remap"])
|
? reader.mesh(runTime, args["remap"])
|
||||||
: reader.mesh(runTime)
|
: reader.mesh(runTime)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -123,12 +123,12 @@ int main(int argc, char *argv[])
|
|||||||
// get times list
|
// get times list
|
||||||
instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
||||||
|
|
||||||
const bool optMesh = args.optionFound("mesh");
|
const bool optMesh = args.found("mesh");
|
||||||
const bool optResults = args.optionFound("results");
|
const bool optResults = args.found("results");
|
||||||
const bool optOverwrite = args.optionFound("overwrite");
|
const bool optOverwrite = args.found("overwrite");
|
||||||
|
|
||||||
fileName exportName = ccm::writer::defaultMeshName;
|
fileName exportName = ccm::writer::defaultMeshName;
|
||||||
if (args.optionReadIfPresent("name", exportName))
|
if (args.readIfPresent("name", exportName))
|
||||||
{
|
{
|
||||||
const word ext = exportName.ext();
|
const word ext = exportName.ext();
|
||||||
// strip erroneous extension (.ccm, .ccmg, .ccmp)
|
// strip erroneous extension (.ccm, .ccmg, .ccmp)
|
||||||
@ -137,7 +137,7 @@ int main(int argc, char *argv[])
|
|||||||
exportName = exportName.lessExt();
|
exportName = exportName.lessExt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionFound("case"))
|
else if (args.found("case"))
|
||||||
{
|
{
|
||||||
exportName += '-' + args.globalCaseName();
|
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
|
// // skip over time=0, unless some other time option has been specified
|
||||||
// if
|
// if
|
||||||
// (
|
// (
|
||||||
// !args.optionFound("zeroTime")
|
// !args.found("zeroTime")
|
||||||
// && !args.optionFound("time")
|
// && !args.found("time")
|
||||||
// && !args.optionFound("latestTime")
|
// && !args.found("latestTime")
|
||||||
// && Times.size() > 2
|
// && Times.size() > 2
|
||||||
// )
|
// )
|
||||||
// {
|
// {
|
||||||
@ -253,7 +253,7 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
// writer.setTopologyFile(exportName + ".ccmg");
|
// writer.setTopologyFile(exportName + ".ccmg");
|
||||||
Info<< "writing solution:";
|
Info<< "writing solution:";
|
||||||
if (args.optionFound("remap"))
|
if (args.found("remap"))
|
||||||
{
|
{
|
||||||
writer.writeSolution(objects, args["remap"]);
|
writer.writeSolution(objects, args["remap"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
|
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
|
||||||
|
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ int main(int argc, char *argv[])
|
|||||||
// Binary output, unless otherwise specified
|
// Binary output, unless otherwise specified
|
||||||
const IOstream::streamFormat format =
|
const IOstream::streamFormat format =
|
||||||
(
|
(
|
||||||
args.optionFound("ascii")
|
args.found("ascii")
|
||||||
? IOstream::ASCII
|
? IOstream::ASCII
|
||||||
: IOstream::BINARY
|
: IOstream::BINARY
|
||||||
);
|
);
|
||||||
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
args[1],
|
args[1],
|
||||||
// Default no scaling
|
// 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);
|
reader.writeMesh(mesh(), format);
|
||||||
|
|
||||||
|
|
||||||
if (args.optionFound("check"))
|
if (args.found("check"))
|
||||||
{
|
{
|
||||||
checkFireEdges(mesh());
|
checkFireEdges(mesh());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -804,15 +804,15 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
args.optionReadIfPresent("scale", scaleFactor);
|
args.readIfPresent("scale", scaleFactor);
|
||||||
|
|
||||||
wordHashSet ignoreCellGroups;
|
wordHashSet ignoreCellGroups;
|
||||||
wordHashSet ignoreFaceGroups;
|
wordHashSet ignoreFaceGroups;
|
||||||
|
|
||||||
args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
|
args.readIfPresent("ignoreCellGroups", ignoreCellGroups);
|
||||||
args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
|
args.readIfPresent("ignoreFaceGroups", ignoreFaceGroups);
|
||||||
|
|
||||||
cubitFile = args.optionFound("cubit");
|
cubitFile = args.found("cubit");
|
||||||
|
|
||||||
if (cubitFile)
|
if (cubitFile)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -898,10 +898,10 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
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 writeSets = args.found("writeSets");
|
||||||
const bool writeZones = args.optionFound("writeZones");
|
const bool writeZones = args.found("writeZones");
|
||||||
|
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
@ -975,7 +975,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
scalar twoDThickness = 1.0;
|
scalar twoDThickness = 1.0;
|
||||||
|
|
||||||
if (!args.optionReadIfPresent("2D", twoDThickness))
|
if (!args.readIfPresent("2D", twoDThickness))
|
||||||
{
|
{
|
||||||
const scalar extrusionFactor = 0.02; //0.01 in each direction
|
const scalar extrusionFactor = 0.02; //0.01 in each direction
|
||||||
boundBox box(points);
|
boundBox box(points);
|
||||||
|
|||||||
@ -81,7 +81,7 @@ int main(int argc, char *argv[])
|
|||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
|
|
||||||
fileName exportName = meshWriter::defaultMeshName;
|
fileName exportName = meshWriter::defaultMeshName;
|
||||||
if (args.optionFound("case"))
|
if (args.found("case"))
|
||||||
{
|
{
|
||||||
exportName += '-' + args.globalCaseName();
|
exportName += '-' + args.globalCaseName();
|
||||||
}
|
}
|
||||||
@ -89,11 +89,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// write control options
|
// write control options
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~
|
||||||
fileFormats::FIREMeshWriter::binary = !args.optionFound("ascii");
|
fileFormats::FIREMeshWriter::binary = !args.found("ascii");
|
||||||
|
|
||||||
// Default: no rescaling
|
// Default: no rescaling
|
||||||
scalar scaleFactor = 1;
|
scalar scaleFactor = 1;
|
||||||
if (args.optionReadIfPresent("scale", scaleFactor))
|
if (args.readIfPresent("scale", scaleFactor))
|
||||||
{
|
{
|
||||||
if (scaleFactor <= 0)
|
if (scaleFactor <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -90,14 +90,14 @@ int main(int argc, char *argv[])
|
|||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
|
|
||||||
fileName exportName = meshWriter::defaultMeshName;
|
fileName exportName = meshWriter::defaultMeshName;
|
||||||
if (args.optionFound("case"))
|
if (args.found("case"))
|
||||||
{
|
{
|
||||||
exportName += '-' + args.globalCaseName();
|
exportName += '-' + args.globalCaseName();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default rescale from [m] to [mm]
|
// Default rescale from [m] to [mm]
|
||||||
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1000.0);
|
const scalar scaleFactor = args.lookupOrDefault("scale", 1000.0);
|
||||||
const bool writeBndFile = !args.optionFound("noBnd");
|
const bool writeBndFile = !args.found("noBnd");
|
||||||
|
|
||||||
#include "createPolyMesh.H"
|
#include "createPolyMesh.H"
|
||||||
|
|
||||||
|
|||||||
@ -77,8 +77,8 @@ int main(int argc, char *argv[])
|
|||||||
fileName exportName = args[1];
|
fileName exportName = args[1];
|
||||||
|
|
||||||
scalar scaleFactor = 0;
|
scalar scaleFactor = 0;
|
||||||
args.optionReadIfPresent<scalar>("scale", scaleFactor);
|
args.readIfPresent<scalar>("scale", scaleFactor);
|
||||||
const bool doTriangulate = args.optionFound("tri");
|
const bool doTriangulate = args.found("tri");
|
||||||
|
|
||||||
fileName exportBase = exportName.lessExt();
|
fileName exportBase = exportName.lessExt();
|
||||||
word exportExt = exportName.ext();
|
word exportExt = exportName.ext();
|
||||||
|
|||||||
@ -640,7 +640,7 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
|
const scalar scaleFactor = args.lookupOrDefault("scale", 1.0);
|
||||||
|
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
|
|||||||
@ -783,7 +783,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Foam::word regionName;
|
Foam::word regionName;
|
||||||
|
|
||||||
if (args.optionReadIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
Foam::Info
|
Foam::Info
|
||||||
<< "Creating polyMesh for region " << regionName << endl;
|
<< "Creating polyMesh for region " << regionName << endl;
|
||||||
@ -793,7 +793,7 @@ int main(int argc, char *argv[])
|
|||||||
regionName = Foam::polyMesh::defaultRegion;
|
regionName = Foam::polyMesh::defaultRegion;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool keepOrientation = args.optionFound("keepOrientation");
|
const bool keepOrientation = args.found("keepOrientation");
|
||||||
IFstream inFile(args[1]);
|
IFstream inFile(args[1]);
|
||||||
|
|
||||||
// Storage for points
|
// Storage for points
|
||||||
|
|||||||
@ -1122,7 +1122,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// For debugging: dump boundary faces as OBJ surface mesh
|
// 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"
|
Info<< "Writing boundary faces to OBJ file boundaryFaces.obj"
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
|
|||||||
@ -82,10 +82,10 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
const fileName kivaFileName =
|
const fileName kivaFileName =
|
||||||
args.optionLookupOrDefault<fileName>("file", "otape17");
|
args.lookupOrDefault<fileName>("file", "otape17");
|
||||||
|
|
||||||
kivaVersions kivaVersion = kiva3v;
|
kivaVersions kivaVersion = kiva3v;
|
||||||
if (args.optionFound("version"))
|
if (args.found("version"))
|
||||||
{
|
{
|
||||||
const word versionName = args["version"];
|
const word versionName = args["version"];
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
scalar zHeadMin = -GREAT;
|
scalar zHeadMin = -GREAT;
|
||||||
args.optionReadIfPresent("zHeadMin", zHeadMin);
|
args.readIfPresent("zHeadMin", zHeadMin);
|
||||||
|
|
||||||
#include "readKivaGrid.H"
|
#include "readKivaGrid.H"
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
const bool readHex = args.optionFound("hex");
|
const bool readHex = args.found("hex");
|
||||||
IFstream mshStream(args[1]);
|
IFstream mshStream(args[1]);
|
||||||
|
|
||||||
label nCells;
|
label nCells;
|
||||||
|
|||||||
@ -90,12 +90,12 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
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 readBlank = !args.found("noBlank");
|
||||||
const bool singleBlock = args.optionFound("singleBlock");
|
const bool singleBlock = args.found("singleBlock");
|
||||||
scalar twoDThickness = -1;
|
scalar twoDThickness = -1;
|
||||||
if (args.optionReadIfPresent("2D", twoDThickness))
|
if (args.readIfPresent("2D", twoDThickness))
|
||||||
{
|
{
|
||||||
Info<< "Reading 2D case by extruding points by " << twoDThickness
|
Info<< "Reading 2D case by extruding points by " << twoDThickness
|
||||||
<< " in z direction." << nl << endl;
|
<< " in z direction." << nl << endl;
|
||||||
|
|||||||
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
|
|||||||
// Binary output, unless otherwise specified
|
// Binary output, unless otherwise specified
|
||||||
const IOstream::streamFormat format =
|
const IOstream::streamFormat format =
|
||||||
(
|
(
|
||||||
args.optionFound("ascii")
|
args.found("ascii")
|
||||||
? IOstream::ASCII
|
? IOstream::ASCII
|
||||||
: IOstream::BINARY
|
: IOstream::BINARY
|
||||||
);
|
);
|
||||||
@ -113,8 +113,8 @@ int main(int argc, char *argv[])
|
|||||||
prefix,
|
prefix,
|
||||||
runTime,
|
runTime,
|
||||||
// Default rescale from [mm] to [m]
|
// Default rescale from [mm] to [m]
|
||||||
args.optionLookupOrDefault("scale", 0.001),
|
args.lookupOrDefault("scale", 0.001),
|
||||||
args.optionFound("solids")
|
args.found("solids")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
const fileName prefix = args[1];
|
const fileName prefix = args[1];
|
||||||
const bool readFaceFile = !args.optionFound("noFaceFile");
|
const bool readFaceFile = !args.found("noFaceFile");
|
||||||
|
|
||||||
const fileName nodeFile(prefix + ".node");
|
const fileName nodeFile(prefix + ".node");
|
||||||
const fileName eleFile(prefix + ".ele");
|
const fileName eleFile(prefix + ".ele");
|
||||||
|
|||||||
@ -429,13 +429,13 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const bool patchFaces = args.optionFound("patchFaces");
|
const bool patchFaces = args.found("patchFaces");
|
||||||
const bool patchEdges = args.optionFound("patchEdges");
|
const bool patchEdges = args.found("patchEdges");
|
||||||
const bool doCell = args.optionFound("cell");
|
const bool doCell = args.found("cell");
|
||||||
const bool doPoint = args.optionFound("point");
|
const bool doPoint = args.found("point");
|
||||||
const bool doFace = args.optionFound("face");
|
const bool doFace = args.found("face");
|
||||||
const bool doCellSet = args.optionFound("cellSet");
|
const bool doCellSet = args.found("cellSet");
|
||||||
const bool doFaceSet = args.optionFound("faceSet");
|
const bool doFaceSet = args.found("faceSet");
|
||||||
|
|
||||||
|
|
||||||
Info<< "Writing mesh objects as .obj files such that the object"
|
Info<< "Writing mesh objects as .obj files such that the object"
|
||||||
@ -467,19 +467,19 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (doCell)
|
if (doCell)
|
||||||
{
|
{
|
||||||
label celli = args.optionRead<label>("cell");
|
const label celli = args.opt<label>("cell");
|
||||||
|
|
||||||
writePoints(mesh, celli, runTime.timeName());
|
writePoints(mesh, celli, runTime.timeName());
|
||||||
}
|
}
|
||||||
if (doPoint)
|
if (doPoint)
|
||||||
{
|
{
|
||||||
label pointi = args.optionRead<label>("point");
|
const label pointi = args.opt<label>("point");
|
||||||
|
|
||||||
writePointCells(mesh, pointi, runTime.timeName());
|
writePointCells(mesh, pointi, runTime.timeName());
|
||||||
}
|
}
|
||||||
if (doFace)
|
if (doFace)
|
||||||
{
|
{
|
||||||
label facei = args.optionRead<label>("face");
|
const label facei = args.opt<label>("face");
|
||||||
|
|
||||||
fileName fName
|
fileName fName
|
||||||
(
|
(
|
||||||
|
|||||||
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
|
|||||||
word regionPath;
|
word regionPath;
|
||||||
|
|
||||||
// Check if the region is specified otherwise mesh the default region
|
// 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;
|
Info<< nl << "Generating mesh for region " << regionName << endl;
|
||||||
regionPath = regionName;
|
regionPath = regionName;
|
||||||
@ -140,7 +140,7 @@ int main(int argc, char *argv[])
|
|||||||
fileName dictPath;
|
fileName dictPath;
|
||||||
|
|
||||||
// Check if the dictionary is specified on the command-line
|
// Check if the dictionary is specified on the command-line
|
||||||
if (args.optionReadIfPresent("dict", dictPath))
|
if (args.readIfPresent("dict", dictPath))
|
||||||
{
|
{
|
||||||
if (isDir(dictPath))
|
if (isDir(dictPath))
|
||||||
{
|
{
|
||||||
@ -176,7 +176,7 @@ int main(int argc, char *argv[])
|
|||||||
dictPath = runTime.system()/regionPath/dictName;
|
dictPath = runTime.system()/regionPath/dictName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!args.optionFound("noClean"))
|
if (!args.found("noClean"))
|
||||||
{
|
{
|
||||||
fileName polyMeshPath
|
fileName polyMeshPath
|
||||||
(
|
(
|
||||||
@ -223,7 +223,7 @@ int main(int argc, char *argv[])
|
|||||||
IOdictionary meshDict(meshDictIO);
|
IOdictionary meshDict(meshDictIO);
|
||||||
blockMesh blocks(meshDict, regionName);
|
blockMesh blocks(meshDict, regionName);
|
||||||
|
|
||||||
if (args.optionFound("blockTopology"))
|
if (args.found("blockTopology"))
|
||||||
{
|
{
|
||||||
// Write mesh as edges.
|
// Write mesh as edges.
|
||||||
{
|
{
|
||||||
@ -383,7 +383,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< nl << "Writing polyMesh with "
|
Info<< nl << "Writing polyMesh with "
|
||||||
<< mesh.cellZones().size() << " cellZones";
|
<< mesh.cellZones().size() << " cellZones";
|
||||||
if (args.optionFound("sets") && !mesh.cellZones().empty())
|
if (args.found("sets") && !mesh.cellZones().empty())
|
||||||
{
|
{
|
||||||
Info<< " (written as cellSets too)";
|
Info<< " (written as cellSets too)";
|
||||||
}
|
}
|
||||||
@ -397,7 +397,7 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("sets"))
|
if (args.found("sets"))
|
||||||
{
|
{
|
||||||
forAll(mesh.cellZones(), zonei)
|
forAll(mesh.cellZones(), zonei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -268,7 +268,7 @@ int main(int argc, char *argv[])
|
|||||||
// Get optional regionName
|
// Get optional regionName
|
||||||
word regionName;
|
word regionName;
|
||||||
word regionDir;
|
word regionDir;
|
||||||
if (args.optionReadIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
regionDir = regionName;
|
regionDir = regionName;
|
||||||
Info<< "Create mesh " << regionName << " for time = "
|
Info<< "Create mesh " << regionName << " for time = "
|
||||||
|
|||||||
@ -1473,8 +1473,6 @@ void extrudeGeometricProperties
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::addNote("Create region mesh by extruding a faceZone or faceSet");
|
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();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
|
|
||||||
const word dictName("extrudeToRegionMeshDict");
|
const word dictName("extrudeToRegionMeshDict");
|
||||||
|
|
||||||
@ -1510,11 +1507,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
IOdictionary dict(dictIO);
|
IOdictionary dict(dictIO);
|
||||||
|
|
||||||
|
|
||||||
// Point generator
|
// Point generator
|
||||||
autoPtr<extrudeModel> model(extrudeModel::New(dict));
|
autoPtr<extrudeModel> model(extrudeModel::New(dict));
|
||||||
|
|
||||||
|
|
||||||
// Region
|
// Region
|
||||||
const word shellRegionName(dict.lookup("region"));
|
const word shellRegionName(dict.lookup("region"));
|
||||||
|
|
||||||
@ -1522,7 +1517,7 @@ int main(int argc, char *argv[])
|
|||||||
wordList zoneNames;
|
wordList zoneNames;
|
||||||
wordList zoneShadowNames;
|
wordList zoneShadowNames;
|
||||||
|
|
||||||
bool hasZones = dict.found("faceZones");
|
const bool hasZones = dict.found("faceZones");
|
||||||
if (hasZones)
|
if (hasZones)
|
||||||
{
|
{
|
||||||
dict.lookup("faceZones") >> zoneNames;
|
dict.lookup("faceZones") >> zoneNames;
|
||||||
|
|||||||
@ -128,7 +128,7 @@ int main(int argc, char *argv[])
|
|||||||
runTimeExtruded.functionObjects().off();
|
runTimeExtruded.functionObjects().off();
|
||||||
|
|
||||||
const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
|
const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
Info<< "Extruding from " << ExtrudeModeNames[surfaceFormat]
|
Info<< "Extruding from " << ExtrudeModeNames[surfaceFormat]
|
||||||
<< " at time " << runTimeExtruded.timeName() << endl;
|
<< " at time " << runTimeExtruded.timeName() << endl;
|
||||||
|
|||||||
@ -62,12 +62,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const bool checkGeometry = args.optionFound("checkGeometry");
|
const bool checkGeometry = args.found("checkGeometry");
|
||||||
const bool conformationOnly = args.optionFound("conformationOnly");
|
const bool conformationOnly = args.found("conformationOnly");
|
||||||
|
|
||||||
// Allow override of decomposeParDict location
|
// Allow override of decomposeParDict location
|
||||||
fileName decompDictFile;
|
fileName decompDictFile;
|
||||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
args.readIfPresent("decomposeParDict", decompDictFile);
|
||||||
|
|
||||||
IOdictionary foamyHexMeshDict
|
IOdictionary foamyHexMeshDict
|
||||||
(
|
(
|
||||||
|
|||||||
@ -62,7 +62,7 @@ scalar getMergeDistance
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
scalar mergeTol = defaultMergeTol;
|
scalar mergeTol = defaultMergeTol;
|
||||||
args.optionReadIfPresent("mergeTol", mergeTol);
|
args.readIfPresent("mergeTol", mergeTol);
|
||||||
|
|
||||||
scalar writeTol =
|
scalar writeTol =
|
||||||
Foam::pow(scalar(10.0), -scalar(IOstream::defaultPrecision()));
|
Foam::pow(scalar(10.0), -scalar(IOstream::defaultPrecision()));
|
||||||
@ -404,7 +404,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const bool writeMesh = args.optionFound("writeMesh");
|
const bool writeMesh = args.found("writeMesh");
|
||||||
|
|
||||||
if (writeMesh)
|
if (writeMesh)
|
||||||
{
|
{
|
||||||
@ -523,7 +523,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Allow override of decomposeParDict location
|
// Allow override of decomposeParDict location
|
||||||
fileName decompDictFile;
|
fileName decompDictFile;
|
||||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
args.readIfPresent("decomposeParDict", decompDictFile);
|
||||||
|
|
||||||
labelList decomp = decompositionModel::New
|
labelList decomp = decompositionModel::New
|
||||||
(
|
(
|
||||||
|
|||||||
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const labelVector n(args.argRead<labelVector>(1));
|
const labelVector n(args.read<labelVector>(1));
|
||||||
const fileName exportName = args[2];
|
const fileName exportName = args[2];
|
||||||
|
|
||||||
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
|
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
|
||||||
|
|||||||
@ -82,13 +82,13 @@ int main(int argc, char *argv[])
|
|||||||
const dictionary& extrusionDict(controlDict.subDict("extrusion"));
|
const dictionary& extrusionDict(controlDict.subDict("extrusion"));
|
||||||
|
|
||||||
Switch extrude(extrusionDict.lookup("extrude"));
|
Switch extrude(extrusionDict.lookup("extrude"));
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
// Read and triangulation
|
// Read and triangulation
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
CV2D mesh(runTime, controlDict);
|
CV2D mesh(runTime, controlDict);
|
||||||
|
|
||||||
if (args.optionFound("pointsFile"))
|
if (args.found("pointsFile"))
|
||||||
{
|
{
|
||||||
mesh.insertPoints(args["pointsFile"]);
|
mesh.insertPoints(args["pointsFile"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -711,22 +711,21 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
const bool checkGeometry = args.optionFound("checkGeometry");
|
const bool checkGeometry = args.found("checkGeometry");
|
||||||
const bool surfaceSimplify = args.optionFound("surfaceSimplify");
|
const bool surfaceSimplify = args.found("surfaceSimplify");
|
||||||
|
|
||||||
autoPtr<fvMesh> meshPtr;
|
autoPtr<fvMesh> meshPtr;
|
||||||
|
|
||||||
{
|
{
|
||||||
word regionName;
|
word regionName = fvMesh::defaultRegion;
|
||||||
if (args.optionReadIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
Info<< "Create mesh " << regionName << " for time = "
|
Info<< "Create mesh " << regionName << " for time = "
|
||||||
<< runTime.timeName() << nl << endl;
|
<< runTime.timeName() << nl << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
regionName = fvMesh::defaultRegion;
|
|
||||||
Info<< "Create mesh for time = "
|
Info<< "Create mesh for time = "
|
||||||
<< runTime.timeName() << nl << endl;
|
<< runTime.timeName() << nl << endl;
|
||||||
}
|
}
|
||||||
@ -792,7 +791,7 @@ int main(int argc, char *argv[])
|
|||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
fileName decompDictFile;
|
fileName decompDictFile;
|
||||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
args.readIfPresent("decomposeParDict", decompDictFile);
|
||||||
|
|
||||||
// A demand-driven decompositionMethod can have issues finding
|
// A demand-driven decompositionMethod can have issues finding
|
||||||
// an alternative decomposeParDict location.
|
// an alternative decomposeParDict location.
|
||||||
@ -1663,11 +1662,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
labelHashSet includePatches(bMesh.size());
|
labelHashSet includePatches(bMesh.size());
|
||||||
|
|
||||||
if (args.optionFound("patches"))
|
if (args.found("patches"))
|
||||||
{
|
{
|
||||||
includePatches = bMesh.patchSet
|
includePatches = bMesh.patchSet
|
||||||
(
|
(
|
||||||
wordReList(args.optionLookup("patches")())
|
wordReList(args.lookup("patches")())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1685,7 +1684,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
fileName outFileName
|
fileName outFileName
|
||||||
(
|
(
|
||||||
args.optionLookupOrDefault<fileName>
|
args.lookupOrDefault<fileName>
|
||||||
(
|
(
|
||||||
"outFile",
|
"outFile",
|
||||||
"constant/triSurface/simplifiedSurface.stl"
|
"constant/triSurface/simplifiedSurface.stl"
|
||||||
|
|||||||
@ -52,7 +52,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createPolyMesh.H"
|
#include "createPolyMesh.H"
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
if (!overwrite)
|
if (!overwrite)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -88,8 +88,8 @@ int main(int argc, char *argv[])
|
|||||||
<< " s\n" << endl << endl;
|
<< " s\n" << endl << endl;
|
||||||
|
|
||||||
|
|
||||||
const scalar featureAngle = args.argRead<scalar>(1);
|
const scalar featureAngle = args.read<scalar>(1);
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||||
|
|
||||||
|
|||||||
@ -126,20 +126,20 @@ int main(int argc, char *argv[])
|
|||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
#include "createNamedMesh.H"
|
#include "createNamedMesh.H"
|
||||||
|
|
||||||
const bool noTopology = args.optionFound("noTopology");
|
const bool noTopology = args.found("noTopology");
|
||||||
const bool allGeometry = args.optionFound("allGeometry");
|
const bool allGeometry = args.found("allGeometry");
|
||||||
const bool allTopology = args.optionFound("allTopology");
|
const bool allTopology = args.found("allTopology");
|
||||||
const bool meshQuality = args.optionFound("meshQuality");
|
const bool meshQuality = args.found("meshQuality");
|
||||||
|
|
||||||
word surfaceFormat;
|
word surfaceFormat;
|
||||||
const bool writeSets = args.optionReadIfPresent("writeSets", surfaceFormat);
|
const bool writeSets = args.readIfPresent("writeSets", surfaceFormat);
|
||||||
HashSet<word> selectedFields;
|
HashSet<word> selectedFields;
|
||||||
bool writeFields = args.optionReadIfPresent
|
bool writeFields = args.readIfPresent
|
||||||
(
|
(
|
||||||
"writeFields",
|
"writeFields",
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
if (!writeFields && args.optionFound("writeAllFields"))
|
if (!writeFields && args.found("writeAllFields"))
|
||||||
{
|
{
|
||||||
selectedFields.insert("nonOrthoAngle");
|
selectedFields.insert("nonOrthoAngle");
|
||||||
selectedFields.insert("faceWeight");
|
selectedFields.insert("faceWeight");
|
||||||
|
|||||||
@ -438,7 +438,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createNamedMesh.H"
|
#include "createNamedMesh.H"
|
||||||
|
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
|
|||||||
@ -523,13 +523,13 @@ int main(int argc, char *argv[])
|
|||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|
||||||
Foam::word meshRegionName = polyMesh::defaultRegion;
|
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"
|
#include "createNamedPolyMesh.H"
|
||||||
|
|
||||||
const bool writeObj = args.optionFound("writeObj");
|
const bool writeObj = args.found("writeObj");
|
||||||
|
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
const scalar scaleFactor = args.argRead<scalar>(1);
|
const scalar scaleFactor = args.read<scalar>(1);
|
||||||
|
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|||||||
@ -97,20 +97,20 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
fileName masterCase = args[1];
|
fileName masterCase = args[1];
|
||||||
fileName addCase = args[2];
|
fileName addCase = args[2];
|
||||||
|
|
||||||
const word masterRegion =
|
const word masterRegion =
|
||||||
args.optionLookupOrDefault<word>
|
args.lookupOrDefault<word>
|
||||||
(
|
(
|
||||||
"masterRegion",
|
"masterRegion",
|
||||||
polyMesh::defaultRegion
|
polyMesh::defaultRegion
|
||||||
);
|
);
|
||||||
|
|
||||||
const word addRegion =
|
const word addRegion =
|
||||||
args.optionLookupOrDefault<word>
|
args.lookupOrDefault<word>
|
||||||
(
|
(
|
||||||
"masterRegion",
|
"masterRegion",
|
||||||
polyMesh::defaultRegion
|
polyMesh::defaultRegion
|
||||||
@ -166,7 +166,7 @@ int main(int argc, char *argv[])
|
|||||||
const bool specifiedInstance =
|
const bool specifiedInstance =
|
||||||
(
|
(
|
||||||
!overwrite
|
!overwrite
|
||||||
&& args.optionReadIfPresent("resultTime", meshInstance)
|
&& args.readIfPresent("resultTime", meshInstance)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (specifiedInstance)
|
if (specifiedInstance)
|
||||||
|
|||||||
@ -304,10 +304,10 @@ int main(int argc, char *argv[])
|
|||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
const bool readDict = args.optionFound("dict");
|
const bool readDict = args.found("dict");
|
||||||
const bool split = args.optionFound("split");
|
const bool split = args.found("split");
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
const bool detectOnly = args.optionFound("detectOnly");
|
const bool detectOnly = args.found("detectOnly");
|
||||||
|
|
||||||
if (readDict && (split || detectOnly))
|
if (readDict && (split || detectOnly))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -47,7 +47,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
if (!overwrite)
|
if (!overwrite)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -168,7 +168,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createNamedDynamicFvMesh.H"
|
#include "createNamedDynamicFvMesh.H"
|
||||||
|
|
||||||
const bool checkAMI = args.optionFound("checkAMI");
|
const bool checkAMI = args.found("checkAMI");
|
||||||
|
|
||||||
if (checkAMI)
|
if (checkAMI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createNamedPolyMesh.H"
|
#include "createNamedPolyMesh.H"
|
||||||
|
|
||||||
const word zoneName = args[1];
|
const word zoneName = args[1];
|
||||||
const point outsidePoint = args.argRead<point>(2);
|
const point outsidePoint = args.read<point>(2);
|
||||||
|
|
||||||
Info<< "Orienting faceZone " << zoneName
|
Info<< "Orienting faceZone " << zoneName
|
||||||
<< " such that " << outsidePoint << " is outside"
|
<< " such that " << outsidePoint << " is outside"
|
||||||
|
|||||||
@ -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));
|
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||||
|
|
||||||
Info<< "Feature:" << featureAngle << endl
|
Info<< "Feature:" << featureAngle << endl
|
||||||
@ -409,7 +409,7 @@ int main(int argc, char *argv[])
|
|||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
const bool splitAllFaces = args.optionFound("splitAllFaces");
|
const bool splitAllFaces = args.found("splitAllFaces");
|
||||||
if (splitAllFaces)
|
if (splitAllFaces)
|
||||||
{
|
{
|
||||||
Info<< "Splitting all internal faces to create multiple faces"
|
Info<< "Splitting all internal faces to create multiple faces"
|
||||||
@ -417,12 +417,9 @@ int main(int argc, char *argv[])
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
const bool doNotPreserveFaceZones = args.optionFound
|
const bool doNotPreserveFaceZones = args.found("doNotPreserveFaceZones");
|
||||||
(
|
const bool concaveMultiCells = args.found("concaveMultiCells");
|
||||||
"doNotPreserveFaceZones"
|
|
||||||
);
|
|
||||||
const bool concaveMultiCells = args.optionFound("concaveMultiCells");
|
|
||||||
if (concaveMultiCells)
|
if (concaveMultiCells)
|
||||||
{
|
{
|
||||||
Info<< "Generating multiple cells for points on concave feature edges."
|
Info<< "Generating multiple cells for points on concave feature edges."
|
||||||
|
|||||||
@ -182,9 +182,9 @@ int main(int argc, char *argv[])
|
|||||||
// Read/construct control dictionary
|
// Read/construct control dictionary
|
||||||
//
|
//
|
||||||
|
|
||||||
const bool readDict = args.optionFound("dict");
|
const bool readDict = args.found("dict");
|
||||||
const bool refineAllCells = args.optionFound("all");
|
const bool refineAllCells = args.found("all");
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
// List of cells to refine
|
// List of cells to refine
|
||||||
labelList refCells;
|
labelList refCells;
|
||||||
|
|||||||
@ -653,9 +653,9 @@ int main(int argc, char *argv[])
|
|||||||
#include "createNamedMesh.H"
|
#include "createNamedMesh.H"
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
const bool readDict = args.optionFound("dict");
|
const bool readDict = args.found("dict");
|
||||||
const bool doFrontWidth = args.optionFound("frontWidth");
|
const bool doFrontWidth = args.found("frontWidth");
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
label band;
|
label band;
|
||||||
scalar profile;
|
scalar profile;
|
||||||
|
|||||||
@ -83,10 +83,10 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
vector n1(args.argRead<vector>(1));
|
vector n1(args.read<vector>(1));
|
||||||
n1 /= mag(n1);
|
n1 /= mag(n1);
|
||||||
|
|
||||||
vector n2(args.argRead<vector>(2));
|
vector n2(args.read<vector>(2));
|
||||||
n2 /= mag(n2);
|
n2 /= mag(n2);
|
||||||
|
|
||||||
const tensor rotT(rotationTensor(n1, n2));
|
const tensor rotT(rotationTensor(n1, n2));
|
||||||
|
|||||||
@ -768,10 +768,10 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
|
|
||||||
const bool writeVTK = !args.optionFound("noVTK");
|
const bool writeVTK = !args.found("noVTK");
|
||||||
const bool loop = args.optionFound("loop");
|
const bool loop = args.found("loop");
|
||||||
const bool batch = args.optionFound("batch");
|
const bool batch = args.found("batch");
|
||||||
const bool noSync = args.optionFound("noSync");
|
const bool noSync = args.found("noSync");
|
||||||
|
|
||||||
if (loop && !batch)
|
if (loop && !batch)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
const bool noFlipMap = args.optionFound("noFlipMap");
|
const bool noFlipMap = args.found("noFlipMap");
|
||||||
|
|
||||||
// Get times list
|
// Get times list
|
||||||
(void)timeSelector::selectIfPresent(runTime, args);
|
(void)timeSelector::selectIfPresent(runTime, args);
|
||||||
|
|||||||
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
|
|||||||
const word setName = args[1];
|
const word setName = args[1];
|
||||||
const word masterPatch = args[2];
|
const word masterPatch = args[2];
|
||||||
const word slavePatch = args[3];
|
const word slavePatch = args[3];
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
// List of faces to split
|
// List of faces to split
|
||||||
faceSet facesSet(mesh, setName);
|
faceSet facesSet(mesh, setName);
|
||||||
|
|||||||
@ -1487,23 +1487,23 @@ int main(int argc, char *argv[])
|
|||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
word blockedFacesName;
|
word blockedFacesName;
|
||||||
if (args.optionReadIfPresent("blockedFaces", blockedFacesName))
|
if (args.readIfPresent("blockedFaces", blockedFacesName))
|
||||||
{
|
{
|
||||||
Info<< "Reading blocked internal faces from faceSet "
|
Info<< "Reading blocked internal faces from faceSet "
|
||||||
<< blockedFacesName << nl << endl;
|
<< blockedFacesName << nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool makeCellZones = args.optionFound("makeCellZones");
|
const bool makeCellZones = args.found("makeCellZones");
|
||||||
const bool largestOnly = args.optionFound("largestOnly");
|
const bool largestOnly = args.found("largestOnly");
|
||||||
const bool insidePoint = args.optionFound("insidePoint");
|
const bool insidePoint = args.found("insidePoint");
|
||||||
const bool useCellZones = args.optionFound("cellZones");
|
const bool useCellZones = args.found("cellZones");
|
||||||
const bool useCellZonesOnly = args.optionFound("cellZonesOnly");
|
const bool useCellZonesOnly = args.found("cellZonesOnly");
|
||||||
const bool useCellZonesFile = args.optionFound("cellZonesFileOnly");
|
const bool useCellZonesFile = args.found("cellZonesFileOnly");
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
const bool detectOnly = args.optionFound("detectOnly");
|
const bool detectOnly = args.found("detectOnly");
|
||||||
const bool sloppyCellZones = args.optionFound("sloppyCellZones");
|
const bool sloppyCellZones = args.found("sloppyCellZones");
|
||||||
const bool useFaceZones = args.optionFound("useFaceZones");
|
const bool useFaceZones = args.found("useFaceZones");
|
||||||
const bool prefixRegion = args.optionFound("prefixRegion");
|
const bool prefixRegion = args.found("prefixRegion");
|
||||||
|
|
||||||
|
|
||||||
if
|
if
|
||||||
@ -2001,7 +2001,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (insidePoint)
|
if (insidePoint)
|
||||||
{
|
{
|
||||||
const point insidePoint = args.optionRead<point>("insidePoint");
|
const point insidePoint = args.opt<point>("insidePoint");
|
||||||
|
|
||||||
label regionI = -1;
|
label regionI = -1;
|
||||||
|
|
||||||
|
|||||||
@ -153,7 +153,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (useCommandArgs)
|
if (useCommandArgs)
|
||||||
{
|
{
|
||||||
if (args.optionFound("dict"))
|
if (args.found("dict"))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cannot specify both dictionary and command-line arguments"
|
<< "Cannot specify both dictionary and command-line arguments"
|
||||||
@ -171,21 +171,21 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// Carp about inapplicable options
|
// Carp about inapplicable options
|
||||||
|
|
||||||
if (args.optionFound("integral"))
|
if (args.found("integral"))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Only specify -integral with command-line arguments"
|
<< "Only specify -integral with command-line arguments"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("partial"))
|
if (args.found("partial"))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Only specify -partial with command-line arguments"
|
<< "Only specify -partial with command-line arguments"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("perfect"))
|
if (args.found("perfect"))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Only specify -perfect with command-line arguments"
|
<< "Only specify -perfect with command-line arguments"
|
||||||
@ -199,8 +199,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
const bool intermediate = args.optionFound("intermediate");
|
const bool intermediate = args.found("intermediate");
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
|
|
||||||
const word dictName("stitchMeshDict");
|
const word dictName("stitchMeshDict");
|
||||||
|
|
||||||
@ -210,9 +210,9 @@ int main(int argc, char *argv[])
|
|||||||
if (useCommandArgs)
|
if (useCommandArgs)
|
||||||
{
|
{
|
||||||
// Command argument driven:
|
// Command argument driven:
|
||||||
const int integralCover = args.optionFound("integral");
|
const int integralCover = args.found("integral");
|
||||||
const int partialCover = args.optionFound("partial");
|
const int partialCover = args.found("partial");
|
||||||
const int perfectCover = args.optionFound("perfect");
|
const int perfectCover = args.found("perfect");
|
||||||
|
|
||||||
if ((integralCover + partialCover + perfectCover) > 1)
|
if ((integralCover + partialCover + perfectCover) > 1)
|
||||||
{
|
{
|
||||||
@ -377,7 +377,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// set up the tolerances for the sliding mesh
|
// set up the tolerances for the sliding mesh
|
||||||
dictionary slidingTolerances;
|
dictionary slidingTolerances;
|
||||||
if (args.optionFound("toleranceDict"))
|
if (args.found("toleranceDict"))
|
||||||
{
|
{
|
||||||
IOdictionary toleranceFile
|
IOdictionary toleranceFile
|
||||||
(
|
(
|
||||||
|
|||||||
@ -376,8 +376,8 @@ int main(int argc, char *argv[])
|
|||||||
word meshInstance = mesh.pointsInstance();
|
word meshInstance = mesh.pointsInstance();
|
||||||
word fieldsInstance = runTime.timeName();
|
word fieldsInstance = runTime.timeName();
|
||||||
|
|
||||||
const bool overwrite = args.optionFound("overwrite");
|
const bool overwrite = args.found("overwrite");
|
||||||
const bool specifiedInstance = args.optionReadIfPresent
|
const bool specifiedInstance = args.readIfPresent
|
||||||
(
|
(
|
||||||
"resultTime",
|
"resultTime",
|
||||||
fieldsInstance
|
fieldsInstance
|
||||||
@ -396,7 +396,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
labelList exposedPatchIDs;
|
labelList exposedPatchIDs;
|
||||||
|
|
||||||
if (args.optionFound("patch"))
|
if (args.found("patch"))
|
||||||
{
|
{
|
||||||
const word patchName = args["patch"];
|
const word patchName = args["patch"];
|
||||||
|
|
||||||
@ -412,9 +412,9 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Adding exposed internal faces to patch " << patchName
|
Info<< "Adding exposed internal faces to patch " << patchName
|
||||||
<< nl << endl;
|
<< 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();
|
exposedPatchIDs = mesh.boundaryMesh().patchSet(patchNames).sortedToc();
|
||||||
|
|
||||||
|
|||||||
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "createNamedPolyMesh.H"
|
#include "createNamedPolyMesh.H"
|
||||||
|
|
||||||
const bool noSync = args.optionFound("noSync");
|
const bool noSync = args.found("noSync");
|
||||||
|
|
||||||
const word dictName("topoSetDict");
|
const word dictName("topoSetDict");
|
||||||
#include "setSystemMeshDictionaryIO.H"
|
#include "setSystemMeshDictionaryIO.H"
|
||||||
|
|||||||
@ -202,7 +202,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
const bool doRotateFields = args.optionFound("rotateFields");
|
const bool doRotateFields = args.found("rotateFields");
|
||||||
|
|
||||||
// Verify that an operation has been specified
|
// Verify that an operation has been specified
|
||||||
{
|
{
|
||||||
@ -216,11 +216,11 @@ int main(int argc, char *argv[])
|
|||||||
"scale"
|
"scale"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!args.optionCount(operationNames))
|
if (!args.count(operationNames))
|
||||||
{
|
{
|
||||||
FatalError
|
FatalError
|
||||||
<< "No operation supplied, "
|
<< "No operation supplied, "
|
||||||
<< "use least one of the following:" << nl
|
<< "use at least one of the following:" << nl
|
||||||
<< " ";
|
<< " ";
|
||||||
|
|
||||||
for (const auto& opName : operationNames)
|
for (const auto& opName : operationNames)
|
||||||
@ -239,7 +239,7 @@ int main(int argc, char *argv[])
|
|||||||
word regionName = polyMesh::defaultRegion;
|
word regionName = polyMesh::defaultRegion;
|
||||||
fileName meshDir = polyMesh::meshSubDir;
|
fileName meshDir = polyMesh::meshSubDir;
|
||||||
|
|
||||||
if (args.optionReadIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
meshDir = regionName/polyMesh::meshSubDir;
|
meshDir = regionName/polyMesh::meshSubDir;
|
||||||
}
|
}
|
||||||
@ -259,7 +259,7 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
vector v;
|
vector v;
|
||||||
if (args.optionReadIfPresent("translate", v))
|
if (args.readIfPresent("translate", v))
|
||||||
{
|
{
|
||||||
Info<< "Translating points by " << v << endl;
|
Info<< "Translating points by " << v << endl;
|
||||||
|
|
||||||
@ -267,18 +267,18 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
vector origin;
|
vector origin;
|
||||||
const bool useOrigin = args.optionReadIfPresent("origin", origin);
|
const bool useOrigin = args.readIfPresent("origin", origin);
|
||||||
if (useOrigin)
|
if (useOrigin)
|
||||||
{
|
{
|
||||||
Info<< "Set origin for rotations to " << origin << endl;
|
Info<< "Set origin for rotations to " << origin << endl;
|
||||||
points -= origin;
|
points -= origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("rotate"))
|
if (args.found("rotate"))
|
||||||
{
|
{
|
||||||
Pair<vector> n1n2
|
Pair<vector> n1n2
|
||||||
(
|
(
|
||||||
args.optionLookup("rotate")()
|
args.lookup("rotate")()
|
||||||
);
|
);
|
||||||
n1n2[0] /= mag(n1n2[0]);
|
n1n2[0] /= mag(n1n2[0]);
|
||||||
n1n2[1] /= mag(n1n2[1]);
|
n1n2[1] /= mag(n1n2[1]);
|
||||||
@ -294,11 +294,11 @@ int main(int argc, char *argv[])
|
|||||||
rotateFields(args, runTime, rotT);
|
rotateFields(args, runTime, rotT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionFound("rotate-angle"))
|
else if (args.found("rotate-angle"))
|
||||||
{
|
{
|
||||||
const Tuple2<vector, scalar> axisAngle
|
const Tuple2<vector, scalar> axisAngle
|
||||||
(
|
(
|
||||||
args.optionLookup("rotate-angle")()
|
args.lookup("rotate-angle")()
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Rotating points " << nl
|
Info<< "Rotating points " << nl
|
||||||
@ -319,7 +319,7 @@ int main(int argc, char *argv[])
|
|||||||
rotateFields(args, runTime, quat.R());
|
rotateFields(args, runTime, quat.R());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionReadIfPresent("rollPitchYaw", v))
|
else if (args.readIfPresent("rollPitchYaw", v))
|
||||||
{
|
{
|
||||||
Info<< "Rotating points by" << nl
|
Info<< "Rotating points by" << nl
|
||||||
<< " roll " << v.x() << nl
|
<< " roll " << v.x() << nl
|
||||||
@ -339,7 +339,7 @@ int main(int argc, char *argv[])
|
|||||||
rotateFields(args, runTime, quat.R());
|
rotateFields(args, runTime, quat.R());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionReadIfPresent("yawPitchRoll", v))
|
else if (args.readIfPresent("yawPitchRoll", v))
|
||||||
{
|
{
|
||||||
Info<< "Rotating points by" << nl
|
Info<< "Rotating points by" << nl
|
||||||
<< " yaw " << v.x() << 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
|
// 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)
|
if (scaling.size() == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -316,14 +316,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
const bool listIncludes = args.optionFound("includes");
|
const bool listIncludes = args.found("includes");
|
||||||
|
|
||||||
if (listIncludes)
|
if (listIncludes)
|
||||||
{
|
{
|
||||||
Foam::functionEntries::includeEntry::log = true;
|
Foam::functionEntries::includeEntry::log = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool disableEntries = args.optionFound("disableFunctionEntries");
|
const bool disableEntries = args.found("disableFunctionEntries");
|
||||||
if (disableEntries)
|
if (disableEntries)
|
||||||
{
|
{
|
||||||
Info<< "Not expanding variables or dictionary directives" << endl;
|
Info<< "Not expanding variables or dictionary directives" << endl;
|
||||||
@ -352,7 +352,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (args.optionFound("expand"))
|
else if (args.found("expand"))
|
||||||
{
|
{
|
||||||
IOobject::writeBanner(Info)
|
IOobject::writeBanner(Info)
|
||||||
<<"//\n// " << dictFileName << "\n//\n";
|
<<"//\n// " << dictFileName << "\n//\n";
|
||||||
@ -370,7 +370,7 @@ int main(int argc, char *argv[])
|
|||||||
dictionary diffDict;
|
dictionary diffDict;
|
||||||
{
|
{
|
||||||
fileName diffFileName;
|
fileName diffFileName;
|
||||||
if (args.optionReadIfPresent("diff", diffFileName))
|
if (args.readIfPresent("diff", diffFileName))
|
||||||
{
|
{
|
||||||
IFstream diffFile(diffFileName);
|
IFstream diffFile(diffFileName);
|
||||||
if (!diffFile.good())
|
if (!diffFile.good())
|
||||||
@ -384,7 +384,7 @@ int main(int argc, char *argv[])
|
|||||||
diffDict.read(diffFile, true);
|
diffDict.read(diffFile, true);
|
||||||
optDiff = true;
|
optDiff = true;
|
||||||
}
|
}
|
||||||
else if (args.optionReadIfPresent("diffEtc", diffFileName))
|
else if (args.readIfPresent("diffEtc", diffFileName))
|
||||||
{
|
{
|
||||||
fileName foundName = findEtcFile(diffFileName);
|
fileName foundName = findEtcFile(diffFileName);
|
||||||
if (foundName.empty())
|
if (foundName.empty())
|
||||||
@ -409,18 +409,18 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
word scopedName; // Actually fileName, since it can contain '/' scoping
|
word scopedName; // Actually fileName, since it can contain '/' scoping
|
||||||
if (args.optionReadIfPresent("entry", scopedName))
|
if (args.readIfPresent("entry", scopedName))
|
||||||
{
|
{
|
||||||
upgradeScope(scopedName);
|
upgradeScope(scopedName);
|
||||||
|
|
||||||
string newValue;
|
string newValue;
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
args.optionReadIfPresent("set", newValue)
|
args.readIfPresent("set", newValue)
|
||||||
|| args.optionReadIfPresent("add", newValue)
|
|| args.readIfPresent("add", newValue)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const bool overwrite = args.optionFound("set");
|
const bool overwrite = args.found("set");
|
||||||
|
|
||||||
// Dictionary name and keyword
|
// Dictionary name and keyword
|
||||||
const dictAndKeyword dAk(scopedName);
|
const dictAndKeyword dAk(scopedName);
|
||||||
@ -455,7 +455,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< finder.ref();
|
Info<< finder.ref();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionFound("remove"))
|
else if (args.found("remove"))
|
||||||
{
|
{
|
||||||
// Dictionary name and keyword
|
// Dictionary name and keyword
|
||||||
const dictAndKeyword dAk(scopedName);
|
const dictAndKeyword dAk(scopedName);
|
||||||
@ -510,14 +510,14 @@ int main(int argc, char *argv[])
|
|||||||
<< "Cannot find entry " << scopedName
|
<< "Cannot find entry " << scopedName
|
||||||
<< exit(FatalIOError, 2);
|
<< exit(FatalIOError, 2);
|
||||||
}
|
}
|
||||||
else if (args.optionFound("keywords"))
|
else if (args.found("keywords"))
|
||||||
{
|
{
|
||||||
for (const entry& e : finder.dict())
|
for (const entry& e : finder.dict())
|
||||||
{
|
{
|
||||||
Info<< e.keyword() << endl;
|
Info<< e.keyword() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionFound("value"))
|
else if (args.found("value"))
|
||||||
{
|
{
|
||||||
if (finder.isDict())
|
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)
|
for (const entry& e : dict)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -251,7 +251,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
// enable noConstant by switching
|
// enable noConstant by switching
|
||||||
if (!args.optionFound("noConstant"))
|
if (!args.found("noConstant"))
|
||||||
{
|
{
|
||||||
args.setOption("constant", "");
|
args.setOption("constant", "");
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ int main(int argc, char *argv[])
|
|||||||
// Optional mesh (used to read Clouds)
|
// Optional mesh (used to read Clouds)
|
||||||
autoPtr<polyMesh> meshPtr;
|
autoPtr<polyMesh> meshPtr;
|
||||||
|
|
||||||
const bool enableEntries = args.optionFound("enableFunctionEntries");
|
const bool enableEntries = args.found("enableFunctionEntries");
|
||||||
if (enableEntries)
|
if (enableEntries)
|
||||||
{
|
{
|
||||||
Info<< "Allowing dictionary preprocessing ('#include', '#codeStream')."
|
Info<< "Allowing dictionary preprocessing ('#include', '#codeStream')."
|
||||||
@ -288,7 +288,7 @@ int main(int argc, char *argv[])
|
|||||||
fileName meshDir = polyMesh::meshSubDir;
|
fileName meshDir = polyMesh::meshSubDir;
|
||||||
fileName regionPrefix = "";
|
fileName regionPrefix = "";
|
||||||
word regionName = polyMesh::defaultRegion;
|
word regionName = polyMesh::defaultRegion;
|
||||||
if (args.optionReadIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
Info<< "Using region " << regionName << nl << endl;
|
Info<< "Using region " << regionName << nl << endl;
|
||||||
regionPrefix = regionName;
|
regionPrefix = regionName;
|
||||||
|
|||||||
@ -92,14 +92,14 @@ void Foam::helpTypes::helpBoundary::execute
|
|||||||
word condition(word::null);
|
word condition(word::null);
|
||||||
word fieldName(word::null);
|
word fieldName(word::null);
|
||||||
|
|
||||||
if (args.optionReadIfPresent("browse", condition))
|
if (args.readIfPresent("browse", condition))
|
||||||
{
|
{
|
||||||
// TODO: strip scoping info if present?
|
// TODO: strip scoping info if present?
|
||||||
// e.g. conditions with leading "compressible::" will not be found
|
// e.g. conditions with leading "compressible::" will not be found
|
||||||
// ".*[fF]vPatchField.*" + className + ".*"
|
// ".*[fF]vPatchField.*" + className + ".*"
|
||||||
displayDoc(condition, ".*[fF]vPatchField.*", false, "H");
|
displayDoc(condition, ".*[fF]vPatchField.*", false, "H");
|
||||||
}
|
}
|
||||||
else if (args.optionFound("constraint"))
|
else if (args.found("constraint"))
|
||||||
{
|
{
|
||||||
HashSet<word> constraintTypes(fvPatch::constraintTypes());
|
HashSet<word> constraintTypes(fvPatch::constraintTypes());
|
||||||
Info<< "Constraint types:" << nl;
|
Info<< "Constraint types:" << nl;
|
||||||
@ -109,7 +109,7 @@ void Foam::helpTypes::helpBoundary::execute
|
|||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
else if (args.optionReadIfPresent("field", fieldName))
|
else if (args.readIfPresent("field", fieldName))
|
||||||
{
|
{
|
||||||
IOobject fieldHeader
|
IOobject fieldHeader
|
||||||
(
|
(
|
||||||
@ -122,7 +122,7 @@ void Foam::helpTypes::helpBoundary::execute
|
|||||||
// Check for any type of volField
|
// Check for any type of volField
|
||||||
if (fieldHeader.typeHeaderOk<volScalarField>(false))
|
if (fieldHeader.typeHeaderOk<volScalarField>(false))
|
||||||
{
|
{
|
||||||
if (args.optionFound("fixedValue"))
|
if (args.found("fixedValue"))
|
||||||
{
|
{
|
||||||
fixedValueFieldConditions<scalar>(fieldHeader);
|
fixedValueFieldConditions<scalar>(fieldHeader);
|
||||||
fixedValueFieldConditions<vector>(fieldHeader);
|
fixedValueFieldConditions<vector>(fieldHeader);
|
||||||
@ -145,7 +145,7 @@ void Foam::helpTypes::helpBoundary::execute
|
|||||||
<< "Unable to read field " << fieldName << exit(FatalError);
|
<< "Unable to read field " << fieldName << exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.optionReadIfPresent("fixedValue", fieldName))
|
else if (args.readIfPresent("fixedValue", fieldName))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "-field option must be specified when using the -fixedValue "
|
<< "-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
Reference in New Issue
Block a user