ENH: reduce reliance on stringListOps functions

- findStrings, findMatchingStrings now mostly covered by matching
  intrinsics in wordRe and wordRes.

  Add static wordRes match() and matching() variants

COMP: remove stringListOps include from objectRegistry.H

- was already noted for removal (NOV-2018)
This commit is contained in:
Mark Olesen
2024-04-12 21:03:27 +02:00
parent 92c329a8a9
commit 16dd92b38e
36 changed files with 239 additions and 124 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -294,7 +294,7 @@ bool Foam::searchableSurfaceModifiers::cut::modify
// Find the surfaces to cut with
for (const wordRe& cutterName : cutterNames_)
{
labelList geomIDs = findStrings(cutterName, geometry_.names());
labelList geomIDs = wordRes::matching(cutterName, geometry_.names());
for (const label geomI : geomIDs)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2015-2022 OpenCFD Ltd.
Copyright (C) 2015-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -130,9 +130,14 @@ int main(int argc, char *argv[])
for (const entry& e : regionsDict)
{
const keyType& regionName = e.keyword();
const wordRe regionName(e.keyword());
const dictionary& regionDict = e.dict();
labelList regionIDs
(
wordRes::matching(regionName, surf.regions())
);
autoPtr<searchableSurfaceModifier> modifier
(
searchableSurfaceModifier::New
@ -143,9 +148,6 @@ int main(int argc, char *argv[])
)
);
labelList regionIDs =
findStrings(regionName, surf.regions());
if (modifier().modify(regionIDs, surf))
{
changed = true;