mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: ensightWrite: allow inGroup names in patches and excludePatches
This commit is contained in:
@ -122,6 +122,29 @@ Foam::functionObjects::ensightWrite::ensightWrite
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::wordRes Foam::functionObjects::ensightWrite::patchNameSet
|
||||||
|
(
|
||||||
|
const UList<wordRe>& select
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
||||||
|
|
||||||
|
const labelList patchIDs
|
||||||
|
(
|
||||||
|
pbm.patchSet(select).sortedToc()
|
||||||
|
);
|
||||||
|
|
||||||
|
wordRes names(patchIDs.size());
|
||||||
|
|
||||||
|
for (const label patchi : patchIDs)
|
||||||
|
{
|
||||||
|
names[patchi] = mesh_.boundary()[patchi].name();
|
||||||
|
}
|
||||||
|
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
|
bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
|
||||||
@ -152,22 +175,27 @@ bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
|
|||||||
<< "conversion of the boundaries" << endl;
|
<< "conversion of the boundaries" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
wordRes list;
|
|
||||||
if (dict.readIfPresent("patches", list))
|
|
||||||
{
|
|
||||||
list.uniq();
|
|
||||||
writeOpts_.patchSelection(list);
|
|
||||||
}
|
|
||||||
if (dict.readIfPresent("excludePatches", list))
|
|
||||||
{
|
|
||||||
list.uniq();
|
|
||||||
writeOpts_.patchExclude(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dict.readIfPresent("faceZones", list))
|
if (dict.found("patches"))
|
||||||
{
|
{
|
||||||
list.uniq();
|
writeOpts_.patchSelection
|
||||||
writeOpts_.faceZoneSelection(list);
|
(
|
||||||
|
wordRes::uniq(patchNameSet(dict.get<wordRes>("patches")))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (dict.found("excludePatches"))
|
||||||
|
{
|
||||||
|
writeOpts_.patchExclude
|
||||||
|
(
|
||||||
|
wordRes::uniq(patchNameSet(dict.get<wordRes>("excludePatches")))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (dict.found("faceZones"))
|
||||||
|
{
|
||||||
|
writeOpts_.faceZoneSelection
|
||||||
|
(
|
||||||
|
wordRes::uniq(dict.get<wordRes>("faceZones"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -233,6 +233,11 @@ class ensightWrite
|
|||||||
//- Update meshes, subMeshes etc.
|
//- Update meshes, subMeshes etc.
|
||||||
bool update();
|
bool update();
|
||||||
|
|
||||||
|
//- Return the set of names of available patches and patch groups
|
||||||
|
//- corresponding to the given names
|
||||||
|
// A convenience wrapper for \c polyBoundaryMesh::patchSet
|
||||||
|
wordRes patchNameSet(const UList<wordRe>& select) const;
|
||||||
|
|
||||||
|
|
||||||
// Write
|
// Write
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user