mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
adjust solvers and utilities to use new argList methods
- also drop various unused time options from src/OpenFOAM/include
This commit is contained in:
@ -107,7 +107,7 @@ Foam::ensightMesh::ensightMesh
|
||||
const cellModel& wedge = *(cellModeller::lookup("wedge"));
|
||||
const cellModel& hex = *(cellModeller::lookup("hex"));
|
||||
|
||||
if (!args.options().found("noPatches"))
|
||||
if (!args.optionFound("noPatches"))
|
||||
{
|
||||
forAll (mesh_.boundaryMesh(), patchI)
|
||||
{
|
||||
@ -136,9 +136,9 @@ Foam::ensightMesh::ensightMesh
|
||||
|
||||
combineReduce(allPatchNames_, concatPatchNames());
|
||||
|
||||
if (args.options().found("patches"))
|
||||
if (args.optionFound("patches"))
|
||||
{
|
||||
wordList patchNameList(IStringStream(args.options()["patches"])());
|
||||
wordList patchNameList(args.optionLookup("patches")());
|
||||
|
||||
if (patchNameList.empty())
|
||||
{
|
||||
@ -228,7 +228,7 @@ Foam::ensightMesh::ensightMesh
|
||||
reduce(meshCellSets_.nPolys, sumOp<label>());
|
||||
}
|
||||
|
||||
if (!args.options().found("noPatches"))
|
||||
if (!args.optionFound("noPatches"))
|
||||
{
|
||||
forAll (mesh.boundary(), patchI)
|
||||
{
|
||||
|
||||
@ -100,11 +100,7 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
|
||||
// Check options
|
||||
bool binary = true;
|
||||
if (args.options().found("ascii"))
|
||||
{
|
||||
binary = false;
|
||||
}
|
||||
bool binary = !args.optionFound("ascii");
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// default to binary output, unless otherwise specified
|
||||
IOstream::streamFormat format = IOstream::BINARY;
|
||||
if (args.options().found("ascii"))
|
||||
if (args.optionFound("ascii"))
|
||||
{
|
||||
format = IOstream::ASCII;
|
||||
}
|
||||
@ -115,14 +115,14 @@ int main(int argc, char *argv[])
|
||||
// control for renumbering iterations
|
||||
bool optIndex = false;
|
||||
label indexingNumber = 0;
|
||||
if (args.options().found("index"))
|
||||
if (args.optionFound("index"))
|
||||
{
|
||||
optIndex = true;
|
||||
indexingNumber = readLabel(IStringStream(args.options()["index"])());
|
||||
indexingNumber = args.optionRead<label>("index");
|
||||
}
|
||||
|
||||
// always write the geometry, unless the -noMesh option is specified
|
||||
bool optNoMesh = args.options().found("noMesh");
|
||||
bool optNoMesh = args.optionFound("noMesh");
|
||||
|
||||
fileName ensightDir = args.rootPath()/args.globalCaseName()/"Ensight";
|
||||
fileName dataDir = ensightDir/"data";
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
if (args.options().found("time"))
|
||||
{
|
||||
scalar time(readScalar(IStringStream(args.options()["time"])()));
|
||||
|
||||
int nearestIndex = -1;
|
||||
scalar nearestDiff = Foam::GREAT;
|
||||
|
||||
forAll(Times, timeIndex)
|
||||
{
|
||||
scalar diff = fabs(Times[timeIndex].value() - time);
|
||||
if (diff < nearestDiff)
|
||||
{
|
||||
nearestDiff = diff;
|
||||
nearestIndex = timeIndex;
|
||||
}
|
||||
}
|
||||
|
||||
startTime = nearestIndex;
|
||||
endTime = nearestIndex + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
startTime = 0;
|
||||
endTime = Times.size();
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ int main(int argc, char *argv[])
|
||||
new fieldviewTopology
|
||||
(
|
||||
mesh,
|
||||
!args.options().found("noWall")
|
||||
!args.optionFound("noWall")
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -246,11 +246,10 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
bool doWriteInternal = !args.options().found("noInternal");
|
||||
bool doFaceZones = !args.options().found("noFaceZones");
|
||||
bool doLinks = !args.options().found("noLinks");
|
||||
|
||||
bool binary = !args.options().found("ascii");
|
||||
bool doWriteInternal = !args.optionFound("noInternal");
|
||||
bool doFaceZones = !args.optionFound("noFaceZones");
|
||||
bool doLinks = !args.optionFound("noLinks");
|
||||
bool binary = !args.optionFound("ascii");
|
||||
|
||||
if (binary && (sizeof(floatScalar) != 4 || sizeof(label) != 4))
|
||||
{
|
||||
@ -260,7 +259,7 @@ int main(int argc, char *argv[])
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
bool nearCellValue = args.options().found("nearCellValue");
|
||||
bool nearCellValue = args.optionFound("nearCellValue");
|
||||
|
||||
if (nearCellValue)
|
||||
{
|
||||
@ -269,7 +268,7 @@ int main(int argc, char *argv[])
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
bool noPointValues = args.options().found("noPointValues");
|
||||
bool noPointValues = args.optionFound("noPointValues");
|
||||
|
||||
if (noPointValues)
|
||||
{
|
||||
@ -277,12 +276,12 @@ int main(int argc, char *argv[])
|
||||
<< "Outputting cell values only" << nl << endl;
|
||||
}
|
||||
|
||||
bool allPatches = args.options().found("allPatches");
|
||||
bool allPatches = args.optionFound("allPatches");
|
||||
|
||||
HashSet<word> excludePatches;
|
||||
if (args.options().found("excludePatches"))
|
||||
if (args.optionFound("excludePatches"))
|
||||
{
|
||||
IStringStream(args.options()["excludePatches"])() >> excludePatches;
|
||||
args.optionLookup("excludePatches")() >> excludePatches;
|
||||
|
||||
Info<< "Not including patches " << excludePatches << nl << endl;
|
||||
}
|
||||
@ -290,9 +289,9 @@ int main(int argc, char *argv[])
|
||||
word cellSetName;
|
||||
string vtkName;
|
||||
|
||||
if (args.options().found("cellSet"))
|
||||
if (args.optionFound("cellSet"))
|
||||
{
|
||||
cellSetName = args.options()["cellSet"];
|
||||
cellSetName = args.option("cellSet");
|
||||
vtkName = cellSetName;
|
||||
}
|
||||
else if (Pstream::parRun())
|
||||
@ -332,8 +331,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if
|
||||
(
|
||||
args.options().found("time")
|
||||
|| args.options().found("latestTime")
|
||||
args.optionFound("time")
|
||||
|| args.optionFound("latestTime")
|
||||
|| cellSetName.size()
|
||||
|| regionName != polyMesh::defaultRegion
|
||||
)
|
||||
@ -377,10 +376,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// If faceSet: write faceSet only (as polydata)
|
||||
if (args.options().found("faceSet"))
|
||||
if (args.optionFound("faceSet"))
|
||||
{
|
||||
// Load the faceSet
|
||||
faceSet set(mesh, args.options()["faceSet"]);
|
||||
faceSet set(mesh, args.option("faceSet"));
|
||||
|
||||
// Filename as if patch with same name.
|
||||
mkDir(fvPath/set.name());
|
||||
@ -400,10 +399,10 @@ int main(int argc, char *argv[])
|
||||
continue;
|
||||
}
|
||||
// If pointSet: write pointSet only (as polydata)
|
||||
if (args.options().found("pointSet"))
|
||||
if (args.optionFound("pointSet"))
|
||||
{
|
||||
// Load the pointSet
|
||||
pointSet set(mesh, args.options()["pointSet"]);
|
||||
pointSet set(mesh, args.option("pointSet"));
|
||||
|
||||
// Filename as if patch with same name.
|
||||
mkDir(fvPath/set.name());
|
||||
@ -428,9 +427,9 @@ int main(int argc, char *argv[])
|
||||
IOobjectList objects(mesh, runTime.timeName());
|
||||
|
||||
HashSet<word> selectedFields;
|
||||
if (args.options().found("fields"))
|
||||
if (args.optionFound("fields"))
|
||||
{
|
||||
IStringStream(args.options()["fields"])() >> selectedFields;
|
||||
args.optionLookup("fields")() >> selectedFields;
|
||||
}
|
||||
|
||||
// Construct the vol fields (on the original mesh if subsetted)
|
||||
@ -608,7 +607,7 @@ int main(int argc, char *argv[])
|
||||
//
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
if (args.options().found("surfaceFields"))
|
||||
if (args.optionFound("surfaceFields"))
|
||||
{
|
||||
PtrList<surfaceScalarField> ssf;
|
||||
readFields
|
||||
|
||||
@ -82,7 +82,7 @@ namespace Foam
|
||||
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
bool writeResults = !args.optionFound("noWrite");
|
||||
|
||||
wordList extensiveVSFNames
|
||||
(
|
||||
|
||||
@ -53,15 +53,13 @@ namespace Foam
|
||||
{
|
||||
void execFlowFunctionObjects(const argList& args, const Time& runTime)
|
||||
{
|
||||
if (args.options().found("dict"))
|
||||
if (args.optionFound("dict"))
|
||||
{
|
||||
fileName dictName(args.options()["dict"]);
|
||||
|
||||
IOdictionary dict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
dictName,
|
||||
args.option("dict"),
|
||||
runTime.system(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
|
||||
@ -86,7 +86,7 @@ namespace Foam
|
||||
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
bool writeResults = !args.optionFound("noWrite");
|
||||
|
||||
IOobject phiHeader
|
||||
(
|
||||
|
||||
@ -38,7 +38,7 @@ Description
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
bool writeResults = !args.optionFound("noWrite");
|
||||
|
||||
IOobject Uheader
|
||||
(
|
||||
|
||||
@ -47,7 +47,7 @@ Description
|
||||
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
bool writeResults = !args.optionFound("noWrite");
|
||||
|
||||
IOobject phiHeader
|
||||
(
|
||||
|
||||
@ -39,7 +39,7 @@ Description
|
||||
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
bool writeResults = !args.optionFound("noWrite");
|
||||
|
||||
IOobject Uheader
|
||||
(
|
||||
|
||||
@ -39,7 +39,7 @@ Description
|
||||
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
bool writeResults = !args.optionFound("noWrite");
|
||||
|
||||
IOobject Uheader
|
||||
(
|
||||
|
||||
@ -39,7 +39,7 @@ Description
|
||||
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
bool writeResults = !args.optionFound("noWrite");
|
||||
|
||||
IOobject kheader
|
||||
(
|
||||
|
||||
@ -39,7 +39,7 @@ Description
|
||||
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
bool writeResults = !args.optionFound("noWrite");
|
||||
|
||||
IOobject Uheader
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user