argList - specializations for optionRead<string> etc.

- new optionLookupOrDefault and additional form of optionReadIfPresent
  with a default value
This commit is contained in:
Mark Olesen
2009-12-02 13:45:11 +01:00
parent 6b9534c9ce
commit c3457b5152
15 changed files with 263 additions and 174 deletions

View File

@ -177,13 +177,11 @@ int main(int argc, char *argv[])
Info<< "Reading surface from " << surfName << " ..." << endl;
bool readSet = args.optionFound("faceSet");
word setName;
bool readSet = args.optionReadIfPresent("faceSet", setName);
if (readSet)
{
setName = args.option("faceSet");
Info<< "Repatching only the faces in faceSet " << setName
<< " according to nearest surface triangle ..." << endl;
}
@ -193,8 +191,7 @@ int main(int argc, char *argv[])
<< " triangle ..." << endl;
}
scalar searchTol = 1E-3;
args.optionReadIfPresent("tol", searchTol);
scalar searchTol = args.optionLookupOrDefault("tol", 1e-3);
// Get search box. Anything not within this box will not be considered.
const boundBox& meshBb = mesh.globalData().bb();
@ -211,7 +208,7 @@ int main(int argc, char *argv[])
forAll(mesh.boundaryMesh(), patchI)
{
Info<< " " << mesh.boundaryMesh()[patchI].name() << '\t'
<< mesh.boundaryMesh()[patchI].size() << endl;
<< mesh.boundaryMesh()[patchI].size() << nl;
}
Info<< endl;