diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index 19f3603e185d7c3ffb93848cf8eea8c967495d69..888281fb13a268549f93f30ee517b0d302a884cd 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -656,6 +656,9 @@ int main(int argc, char *argv[]) polyTopoChange meshMod(mesh); + // Mark all repatched faces. This makes sure that the faces to repatch + // do not overlap + bitSet isRepatchedBoundary(mesh.nBoundaryFaces()); for (const dictionary& dict : patchSources) { @@ -695,6 +698,15 @@ int main(int argc, char *argv[]) destPatchi, meshMod ); + + if (!isRepatchedBoundary.set(pp.offset()+i)) + { + FatalErrorInFunction + << "Face " << pp.start() + i << " from patch " + << pp.name() << " is already marked to be moved" + << " to patch " << meshMod.region()[pp.start() + i] + << exit(FatalError); + } } } } @@ -722,6 +734,15 @@ int main(int argc, char *argv[]) << " faces." << exit(FatalError); } + if (!isRepatchedBoundary.set(facei-mesh.nInternalFaces())) + { + FatalErrorInFunction + << "Face " << facei << " from set " + << set.name() << " is already marked to be moved" + << " to patch " << meshMod.region()[facei] + << exit(FatalError); + } + changePatchID ( mesh,