ENH: add wordRes::matching() method

- returns indices of matching entries.
This commit is contained in:
Mark Olesen
2018-11-09 21:21:15 +01:00
parent dff2569c7f
commit 91cfe4c271
13 changed files with 114 additions and 18 deletions

View File

@ -26,6 +26,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "stringListOps.H"
#include "FlatOutput.H"
#include "IOstreams.H"
#include "StringStream.H"
@ -64,7 +65,10 @@ int main(int argc, char *argv[])
matches = findStrings(reLst, strLst);
Info<< "matches found for " << reLst << nl << matches << nl;
Info<< "matching " << flatOutput(reLst) << " => "
<< reLst.matching(strLst) << nl;
Info<< "matches found for " << flatOutput(reLst) << " => "
<< matches << nl;
forAll(matches, i)
{
Info<< " -> " << strLst[matches[i]] << nl;

View File

@ -518,7 +518,8 @@ int main(int argc, char *argv[])
patchNames[patchi] = surf.patches()[patchi].name();
}
labelList indices = findStrings(baffleSelect, patchNames);
labelList indices(baffleSelect.matching(patchNames));
for (const label patchId : indices)
{
surfBaffleRegions[patchId] = true;