BUG: singleProcessorFaceSets: fix parallel/. Fixes #2359.

The logic was not maintaining consistent sets of constraints
on different processors. A single processor with a full
match (very easy with 0 local faces) would invalidate
adding the constraint.
This commit is contained in:
mattijs
2022-02-10 12:10:00 +00:00
parent ad6d3a088e
commit 3902ac2857

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2016 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2019,2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -143,7 +143,18 @@ void Foam::decompositionConstraints::singleProcessorFaceSets::add
const labelList& faceLabels = specifiedProcessorFaces[setI];
for (const label facei : faceLabels)
{
faceToSet[facei] = setI;
if (faceToSet[facei] == -1)
{
faceToSet[facei] = setI;
}
else if (faceToSet[facei] != setI)
{
WarningInFunction << "Face " << facei
<< " at " << mesh.faceCentres()[facei]
<< " is already in existing constraint "
<< faceToSet[facei]
<< endl;
}
}
}
@ -190,7 +201,7 @@ void Foam::decompositionConstraints::singleProcessorFaceSets::add
}
}
reduce(store, andOp<bool>());
reduce(store, orOp<bool>());
if (store)
{