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:
Mark Olesen
2018-01-08 15:35:18 +01:00
parent 2feb11dbeb
commit 345a2a42f1
168 changed files with 1161 additions and 1040 deletions

View File

@ -691,7 +691,7 @@ int main(int argc, char *argv[])
Info<< "Reading blocked cells from cellSet " << blockedSetName
<< endl;
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
// Read faceSets, lookup patches

View File

@ -102,10 +102,10 @@ int main(int argc, char *argv[])
IOdictionary collapseDict(dictIO);
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
const bool collapseFaces = args.optionFound("collapseFaces");
const bool collapseFaceSet = args.optionFound("collapseFaceSet");
const bool collapseFaces = args.found("collapseFaces");
const bool collapseFaceSet = args.found("collapseFaceSet");
if (collapseFaces && collapseFaceSet)
{
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
word faceSetName("indirectPatchFaces");
IOobject::readOption readFlag = IOobject::READ_IF_PRESENT;
if (args.optionReadIfPresent("collapseFaceSet", faceSetName))
if (args.readIfPresent("collapseFaceSet", faceSetName))
{
readFlag = IOobject::MUST_READ;
}

View File

@ -368,16 +368,16 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H"
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));
// Sin of angle between two consecutive edges on a face.
// 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));
const bool overwrite = args.optionFound("overwrite");
const bool meshQuality = args.optionFound("meshQuality");
const bool overwrite = args.found("overwrite");
const bool meshQuality = args.found("meshQuality");
Info<< "Merging all faces of a cell" << nl
<< " - which are on the same patch" << nl

View File

@ -345,7 +345,7 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
Info<< "Reading modifyMeshDict\n" << endl;

View File

@ -73,9 +73,9 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
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
<< nl << endl;

View File

@ -84,8 +84,8 @@ int main(int argc, char *argv[])
const wordReList patches((IStringStream(args[1])()));
const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches));
const scalar weight = args.argRead<scalar>(2);
const bool overwrite = args.optionFound("overwrite");
const scalar weight = args.read<scalar>(2);
const bool overwrite = args.found("overwrite");
if (!patchSet.size())
{
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
// Edit list of cells to refine according to specified set
word setName;
if (args.optionReadIfPresent("useSet", setName))
if (args.readIfPresent("useSet", setName))
{
Info<< "Subsetting cells to cut based on cellSet"
<< setName << nl << endl;

View File

@ -118,7 +118,7 @@ int main(int argc, char *argv[])
<< " to allow for some truncation error."
<< nl << endl;
const bool readLevel = args.optionFound("readLevel");
const bool readLevel = args.found("readLevel");
const scalarField& vols = mesh.cellVolumes();

View File

@ -63,7 +63,7 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
const word setName = args[1];
const bool overwrite = args.optionFound("overwrite");
const bool overwrite = args.found("overwrite");
// Read faces
faceSet candidateSet(mesh, setName);

View File

@ -553,15 +553,15 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H"
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 minSin = Foam::sin(degToRad(featureAngle));
const bool readSet = args.optionFound("set");
const bool geometry = args.optionFound("geometry");
const bool overwrite = args.optionFound("overwrite");
const bool readSet = args.found("set");
const bool geometry = args.found("geometry");
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
<< "featureAngle : " << featureAngle << nl