From 77152f3f104ff6da0fa061a93e41ba6d75db276c Mon Sep 17 00:00:00 2001 From: Henry Weller <http://cfd.direct> Date: Sun, 4 Sep 2016 10:35:19 +0100 Subject: [PATCH] polyBoundaryMesh: Remove patchGroups which clash with patch names This allows freedom in the naming of patches when patchGroup-based boundary specification is not used. Patch contributed by Mattijs Janssens --- .../polyBoundaryMesh/polyBoundaryMesh.C | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index 9b14e03833..94b8e5e0b3 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -443,16 +443,6 @@ Foam::polyBoundaryMesh::groupPatchIDs() const { const word& name = groups[i]; - if (findPatchID(name) != -1) - { - WarningInFunction - << "Patch " << bm[patchi].name() - << " specifies a group " << name - << " which is also a patch name." - << " This might give problems later on." << endl; - } - - HashTable<labelList, word>::iterator iter = groupPatchIDs.find ( name @@ -468,7 +458,21 @@ Foam::polyBoundaryMesh::groupPatchIDs() const } } } + + // Remove patch names from patchGroups + forAll(bm, patchi) + { + if (groupPatchIDs.erase(bm[patchi].name())) + { + WarningInFunction + << "Removing patchGroup '" << bm[patchi].name() + << "' which clashes with patch " << patchi + << " of the same name." + << endl; + } + } } + return groupPatchIDsPtr_(); } -- GitLab