Skip to content
Snippets Groups Projects
Commit 6d98049f authored by Mark OLESEN's avatar Mark OLESEN
Browse files

BUG: incorrect blocked face synchronisation crashes regionSplit (#1370)

- now catch these and emit a warning.
  Still need to investigate the root cause in the caller(s) or regionSplit.
parent 0a83d1f9
Branches
No related tags found
No related merge requests found
...@@ -532,6 +532,8 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions ...@@ -532,6 +532,8 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions
// Buffer for swapping boundary information // Buffer for swapping boundary information
labelList nbrRegion(mesh().nBoundaryFaces()); labelList nbrRegion(mesh().nBoundaryFaces());
bool emitWarning = true;
do do
{ {
if (debug) if (debug)
...@@ -597,9 +599,22 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions ...@@ -597,9 +599,22 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions
const label sent = localToGlobal[orig]; const label sent = localToGlobal[orig];
const label recv = patchNbrRegion[patchFacei]; const label recv = patchNbrRegion[patchFacei];
// Record the minimum value seen if (recv == UNASSIGNED)
if (recv < sent) {
if (emitWarning)
{
Pout<<"Warning in regionSplit:"
" received unassigned on "
<< pp.name() << " at patchFace "
<< patchFacei
<< ". Check synchronisation in caller"
<< nl;
}
}
else if (recv < sent)
{ {
// Record the minimum value seen
auto fnd = updateLookup.find(sent); auto fnd = updateLookup.find(sent);
if (!fnd.found()) if (!fnd.found())
{ {
...@@ -644,6 +659,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions ...@@ -644,6 +659,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::reduceRegions
<< " local regions" << endl; << " local regions" << endl;
} }
emitWarning = false;
// Continue until there are no further changes // Continue until there are no further changes
} }
while (returnReduce(!updateLookup.empty(), orOp<bool>())); while (returnReduce(!updateLookup.empty(), orOp<bool>()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment