wildcards in selection

This commit is contained in:
mattijs
2009-01-12 16:39:20 +00:00
parent 59261a9556
commit b74f109639
8 changed files with 96 additions and 46 deletions

View File

@ -57,21 +57,36 @@ Foam::topoSetSource::addToUsageTable Foam::patchToFace::usage_
void Foam::patchToFace::combine(topoSet& set, const bool add) const
{
label patchI = mesh_.boundaryMesh().findPatchID(patchName_);
bool hasMatched = false;
if (patchI != -1)
forAll(mesh_.boundaryMesh(), patchI)
{
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
for (label faceI = pp.start(); faceI < pp.start() + pp.size(); faceI++)
if (patchName_.match(pp.name()))
{
addOrDelete(set, faceI, add);
Info<< " Found matching patch " << pp.name()
<< " with " << pp.size() << " faces." << endl;
hasMatched = true;
for
(
label faceI = pp.start();
faceI < pp.start() + pp.size();
faceI++
)
{
addOrDelete(set, faceI, add);
}
}
}
else
if (!hasMatched)
{
WarningIn("patchToFace::combine(topoSet&, const bool)")
<< "Cannot find patch named " << patchName_ << endl
<< "Cannot find any patch named " << patchName_ << endl
<< "Valid names are " << mesh_.boundaryMesh().names() << endl;
}
}