mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: allow new patch names in subsetMesh (issue #1019)
Previously had 3 possibilities for handling exposed internal faces
1. use default "oldInternalFaces"
2. specify -patch, to use the specified (existing) patch
3. specify -patches, to use the geometrically closest patches
Now relaxed the restriction on -patch to allow specification of a new
(not yet existing) patch name. This improves flexibility, but won't
catch typing mistakes.
Harmonize behaviour of -patches and -patch. When -patches is used to
specify a single, non-regex patch name, it now behaves identically to
-patch. Since the getList handling for options already allows special
treatment for single parameter lists, the following will work
identically:
subsetMesh -patch patch0
subsetMesh -patches patch0
subsetMesh -patches '( patch0 )'
In the future it might be reasonable to fully combine the behaviour of
'-patch' and '-patches' and treat them as aliases for each other.
ENH: support subsetMesh on a cellZone.
- when the '-zone' option is specified, the command argument is treated
as the name (or names) of cellZones to be selected instead of as the
name of the cellSet.
The command argument can be a single word, regex, or list of
word/regex.
Eg,
subsetMesh -zone -patch mypatch mixer
subsetMesh -zone -patch mypatch '(mixer "moving.*" )'
STYLE: simplify set handling and other code cleanup in subsetMesh
This commit is contained in:
@ -56,6 +56,11 @@ inline void markUsed
|
||||
} // End anonymous namespace
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
Foam::word Foam::fvMeshSubset::exposedPatchName("oldInternalFaces");
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::fvMeshSubset::checkCellSubset() const
|
||||
@ -571,7 +576,7 @@ void Foam::fvMeshSubset::setCellSubset
|
||||
{
|
||||
// No explicit patch specified. Put in oldInternalFaces patch.
|
||||
// Check if patch with this name already exists.
|
||||
wantedPatchID = oldPatches.findPatchID("oldInternalFaces");
|
||||
wantedPatchID = oldPatches.findPatchID(exposedPatchName);
|
||||
}
|
||||
else if (wantedPatchID < 0 || wantedPatchID >= oldPatches.size())
|
||||
{
|
||||
@ -1078,7 +1083,7 @@ void Foam::fvMeshSubset::setCellSubset
|
||||
{
|
||||
newBoundary[nNewPatches] = new emptyPolyPatch
|
||||
(
|
||||
"oldInternalFaces",
|
||||
exposedPatchName,
|
||||
boundaryPatchSizes[oldInternalPatchID],
|
||||
patchStart,
|
||||
nNewPatches,
|
||||
@ -1086,7 +1091,7 @@ void Foam::fvMeshSubset::setCellSubset
|
||||
emptyPolyPatch::typeName
|
||||
);
|
||||
|
||||
//Pout<< " oldInternalFaces : "
|
||||
//Pout<< " " << exposedPatchName << " : "
|
||||
// << boundaryPatchSizes[oldInternalPatchID] << endl;
|
||||
|
||||
// The index for the first patch is -1 as it originates from
|
||||
|
||||
@ -153,6 +153,12 @@ class fvMeshSubset
|
||||
|
||||
public:
|
||||
|
||||
// Static Data Members
|
||||
|
||||
//- Name for exposed internal faces (default: oldInternalFaces)
|
||||
static word exposedPatchName;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given a mesh to subset
|
||||
|
||||
Reference in New Issue
Block a user