mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add wordRes::matching() method
- returns indices of matching entries.
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user