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