ENH: createPatch: check for overlapping patches. Fixes #2193

This commit is contained in:
mattijs
2021-09-01 08:29:32 +01:00
parent 8be3f3d910
commit d5fd97d991

View File

@ -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,