Commit 20ca801a authored by Mark Olesen's avatar Mark Olesen

STYLE: avoid deprecated argList methods

parent 23d46a1b
......@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
origSurf.writeSurface(outFileName);
// export surface subsets as separate surface meshes
if (args.optionFound("exportSubsets"))
if (args.found("exportSubsets"))
{
DynList<label> subsetIDs;
origSurf.facetSubsetIndices(subsetIDs);
......@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
}
}
if (args.optionFound("exportFeatureEdges"))
if (args.found("exportFeatureEdges"))
{
fileName fName = outFileNoExt+"_featureEdges";
fName += ".vtk";
......
......@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
polyMeshGen pmg(runTime);
pmg.read();
const bool is2DLayer = args.optionFound("2DLayers");
const bool is2DLayer = args.found("2DLayers");
// generate the initial boundary layer
generateLayer(pmg, meshDict, is2DLayer);
......
......@@ -64,31 +64,31 @@ int main(int argc, char *argv[])
// Read the settings
if (!args.optionReadIfPresent("nLoops", nLoops))
if (!args.readIfPresent("nLoops", nLoops))
{
Info<< "Default number of loops is "
<< nLoops << endl;
}
if (!args.optionReadIfPresent("nIterations", nIterations))
if (!args.readIfPresent("nIterations", nIterations))
{
Info<< "Default number of iterations is "
<< nIterations << endl;
}
if (!args.optionReadIfPresent("nSurfaceIterations", nSurfaceIterations))
if (!args.readIfPresent("nSurfaceIterations", nSurfaceIterations))
{
Info<< "Default number of surface iterations is "
<< nSurfaceIterations << endl;
}
if (!args.optionReadIfPresent("qualityThreshold", qualityThreshold))
if (!args.readIfPresent("qualityThreshold", qualityThreshold))
{
Info<< "Using default quality threshold 0.1" << endl;
}
word constrainedCellSet;
if (!args.optionReadIfPresent("constrainedCellSet", constrainedCellSet))
if (!args.readIfPresent("constrainedCellSet", constrainedCellSet))
{
Info<< "No constraints applied on the smoothing procedure" << endl;
}
......
......@@ -69,7 +69,8 @@ void getPatchIds
if (nFound != patchNames.size())
{
WarningInFunction
<< "Not all supplied patch names were found on the surface mesh" << endl;
<< "Not all supplied patch names were found on the surface mesh"
<< endl;
}
}
......@@ -321,12 +322,9 @@ int main(int argc, char *argv[])
fileName outFileName(inFileName);
if (args.optionFound("output"))
{
outFileName = args["output"];
}
args.readIfPresent("output", outFileName);
const bool keepPatches = args.optionFound("keep");
const bool keepPatches = args.found("keep");
// Read original surface
triSurf origSurf(inFileName);
......@@ -334,16 +332,16 @@ int main(int argc, char *argv[])
// Get patch ids
DynamicList<label> patchIds;
if (args.options().found("patchNames"))
if (args.found("patchNames"))
{
if (args.optionFound("patchIds"))
if (args.found("patchIds"))
{
FatalError() << "Cannot specify both patch names and ids"
FatalErrorInFunction
<< "Cannot specify both patch names and ids" << nl
<< Foam::abort(FatalError);
}
IStringStream is(args["patchNames"]);
wordList patchNames(is);
wordList patchNames(args.getList<word>("patchNames"));
getPatchIds
(
......@@ -352,20 +350,15 @@ int main(int argc, char *argv[])
patchIds
);
}
if (args.optionFound("patchIds"))
else if (args.found("patchIds"))
{
IStringStream is(args["patchIds"]);
patchIds.append(labelList(is));
patchIds.append(args.getList<label>("patchIds"));
}
if (args.optionFound("patchIdRange"))
labelPair idRange;
if (args.readIfPresent("patchIdRange", idRange))
{
IStringStream is(args["patchIdRange"]);
Pair<label> idRange(is);
for (label id = idRange.first(); id <= idRange.second(); id++)
for (label id = idRange.first(); id <= idRange.second(); ++id)
{
patchIds.append(id);
}
......@@ -373,7 +366,8 @@ int main(int argc, char *argv[])
if (!patchIds.size())
{
FatalError() << "No patches specified"
FatalErrorInFunction
<< "No patches specified" << nl
<< Foam::abort(FatalError);
}
......@@ -389,11 +383,11 @@ int main(int argc, char *argv[])
// Write new surface mesh
newSurf->writeSurface(outFileName);
Info<< "Original surface patches: " << origSurf.patches().size() << endl;
Info<< "Final surface patches: " << newSurf->patches().size() << endl;
Info<< "Surface written to " << outFileName << endl;
Info<< "Original surface patches: " << origSurf.patches().size() << nl
<< "Final surface patches: " << newSurf->patches().size() << nl
<< "Surface written to " << outFileName << endl;
Info<< "End\n" << endl;
Info<< "\nEnd\n" << endl;
return 0;
}
......
......@@ -48,8 +48,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
// const scalar scalingFactor(readScalar(args[1]));
const scalar scalingFactor(args.argRead<scalar>(1));
const scalar scalingFactor(args.get<scalar>(1));
Info<< "Scaling mesh vertices by a factor " << scalingFactor << endl;
......
......@@ -54,8 +54,7 @@ int main(int argc, char *argv[])
const fileName inFileName(args[1]);
const fileName outFileName(args[2]);
// const scalar scalingFactor(readScalar(args[3]));
const scalar scalingFactor(args.argRead<scalar>(3));
const scalar scalingFactor(args.get<scalar>(3));
// read the surface mesh
triSurf surface(inFileName);
......
......@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
}
scalar tol(45.0);
if (!args.optionReadIfPresent("angle", tol))
if (!args.readIfPresent("angle", tol))
{
Info<< "Using 45 deg as default angle!" << endl;
}
......
......@@ -52,7 +52,8 @@ int main(int argc, char *argv[])
const fileName inFileName(args[1]);
if (inFileName.ext() == "fms")
{
FatalError << "trying to convert a fms file to itself"
FatalErrorInFunction
<< "trying to convert a fms file to itself" << nl
<< exit(FatalError);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment