ENH: change wordRes to be a List of wordRe instead of a wrapper (issue #259)

- this permits direct storage of a list with additional matcher
  capabilities

- provide wordRes::matcher class for similar behaviour as previously
This commit is contained in:
Mark Olesen
2018-02-21 10:05:30 +01:00
parent 03b287ed24
commit c126464d1c
113 changed files with 572 additions and 801 deletions

View File

@ -81,12 +81,11 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance();
// Find set of patches from the list of regular expressions provided
const wordReList patches((IStringStream(args[1])()));
const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches));
const wordRes patches(args.readList<wordRe>(1));
const scalar weight = args.read<scalar>(2);
const bool overwrite = args.found("overwrite");
const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches));
if (!patchSet.size())
{
FatalErrorInFunction

View File

@ -1666,7 +1666,7 @@ int main(int argc, char *argv[])
{
includePatches = bMesh.patchSet
(
wordReList(args.lookup("patches")())
args.readList<wordRe>("patches")
);
}
else

View File

@ -414,7 +414,7 @@ int main(int argc, char *argv[])
}
else if (args.found("patches"))
{
const wordReList patchNames(args.opt<wordReList>("patches"));
const wordRes patchNames(args.readList<wordRe>("patches"));
exposedPatchIDs = mesh.boundaryMesh().patchSet(patchNames).sortedToc();

View File

@ -360,10 +360,10 @@ int main(int argc, char *argv[])
}
}
if (args.found("scale"))
List<scalar> scaling;
if (args.readListIfPresent("scale", scaling))
{
// Use readList to handle single or multiple values
const List<scalar> scaling = args.readList<scalar>("scale");
// readList handles single or multiple values
if (scaling.size() == 1)
{