diff --git a/utilities/FMSToSurface/FMSToSurface.C b/utilities/FMSToSurface/FMSToSurface.C index 9692da4d101d70d0bbde42c2df87c14dc9f7d5af..cee66fb3d2006533b6bcdb22a390387155e322e0 100644 --- a/utilities/FMSToSurface/FMSToSurface.C +++ b/utilities/FMSToSurface/FMSToSurface.C @@ -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"; diff --git a/utilities/generateBoundaryLayers/generateBoundaryLayers.C b/utilities/generateBoundaryLayers/generateBoundaryLayers.C index dcdf2c21c417d1abf65d34b916425d85fa02a184..fbd843f53c7bbc77d53011ff03b993447d473979 100644 --- a/utilities/generateBoundaryLayers/generateBoundaryLayers.C +++ b/utilities/generateBoundaryLayers/generateBoundaryLayers.C @@ -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); diff --git a/utilities/improveMeshQuality/improveMeshQuality.C b/utilities/improveMeshQuality/improveMeshQuality.C index badfd144065fb68ea52ca5fb05bbb4f128de5d55..1d3010227c70496a4331a042cdb466e7c9050e6e 100644 --- a/utilities/improveMeshQuality/improveMeshQuality.C +++ b/utilities/improveMeshQuality/improveMeshQuality.C @@ -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; } diff --git a/utilities/mergeSurfacePatches/mergeSurfacePatches.C b/utilities/mergeSurfacePatches/mergeSurfacePatches.C index 22d7caf25ad8551bb49afbbb1ba5da51a32e4044..d4898012fee29cd38017ea7a05275edb5cd2438e 100644 --- a/utilities/mergeSurfacePatches/mergeSurfacePatches.C +++ b/utilities/mergeSurfacePatches/mergeSurfacePatches.C @@ -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; } diff --git a/utilities/scaleMesh/scaleMesh.C b/utilities/scaleMesh/scaleMesh.C index c496c60380d04a645fbde84d2614158c4560fd79..9d4903b4b347bdab7b1b0b709d71bf1cd2b586a3 100644 --- a/utilities/scaleMesh/scaleMesh.C +++ b/utilities/scaleMesh/scaleMesh.C @@ -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; diff --git a/utilities/scaleSurfaceMesh/scaleSurfaceMesh.C b/utilities/scaleSurfaceMesh/scaleSurfaceMesh.C index a71ebc5f3e5e8ba1279b66fa0d7d260cd2e41d53..000339b9bd450af80c9f21baf32d1343415e36e7 100644 --- a/utilities/scaleSurfaceMesh/scaleSurfaceMesh.C +++ b/utilities/scaleSurfaceMesh/scaleSurfaceMesh.C @@ -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); diff --git a/utilities/surfaceFeatureEdges/surfaceFeatureEdges.C b/utilities/surfaceFeatureEdges/surfaceFeatureEdges.C index 079144fd1f4c930de1b4bc353c5e68f6e27539fe..acbd7d36df8b202c6d7f5180df62bcda255f0861 100644 --- a/utilities/surfaceFeatureEdges/surfaceFeatureEdges.C +++ b/utilities/surfaceFeatureEdges/surfaceFeatureEdges.C @@ -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; } diff --git a/utilities/surfaceToFMS/surfaceToFMS.C b/utilities/surfaceToFMS/surfaceToFMS.C index a705a42ec1d16645f15a0a3924115811dd73962b..e738a67af796e4b59f9551b575e5563c54c5921c 100644 --- a/utilities/surfaceToFMS/surfaceToFMS.C +++ b/utilities/surfaceToFMS/surfaceToFMS.C @@ -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); }