ENH: ensightWrite, vtkWrite support for excluding fields and patches

- functionality similar to that provided by foamToEnsight, foamToVTK
  which allows blocking out patches (eg, outer walls, inlet/outlet)
  that are not particularly interesting to visualize
This commit is contained in:
Mark Olesen
2022-11-18 15:28:14 +01:00
parent ec1d66d640
commit d9ab5d54ef
10 changed files with 192 additions and 118 deletions

View File

@ -59,6 +59,8 @@ Foam::labelList Foam::functionObjects::vtkWrite::getSelectedPatches
{
DynamicList<label> patchIDs(patches.size());
wordRes::filter patchFilter(selectPatches_, blockPatches_);
for (const polyPatch& pp : patches)
{
if (isType<emptyPolyPatch>(pp))
@ -70,12 +72,7 @@ Foam::labelList Foam::functionObjects::vtkWrite::getSelectedPatches
break; // No processor patches
}
if
(
selectPatches_.size()
? selectPatches_.match(pp.name())
: true
)
if (patchFilter(pp.name()))
{
patchIDs.append(pp.index());
}
@ -180,9 +177,14 @@ bool Foam::functionObjects::vtkWrite::readSelection(const dictionary& dict)
selectPatches_.clear();
dict.readIfPresent("patches", selectPatches_);
blockPatches_.clear();
dict.readIfPresent("excludePatches", blockPatches_);
selectFields_.clear();
dict.readEntry("fields", selectFields_);
selectFields_.uniq();
blockFields_.clear();
dict.readIfPresent("excludeFields", blockFields_);
// Actions to define selection
selection_ = dict.subOrEmptyDict("selection");