Bugfix in faceZone reconstruction procedure

Forgot to take into account the "turning face" index and decrement by one
This commit is contained in:
Vuko Vukcevic 2019-06-24 09:51:40 +02:00
parent 49769f0397
commit 15af49e74a

View file

@ -1915,18 +1915,23 @@ Foam::processorMeshesReconstructor::reconstructMesh(const Time& db)
// Get the face index in the new, reconstructed mesh // Get the face index in the new, reconstructed mesh
const label& newFaceI = curFaceProcAddr[oldFaceI]; const label& newFaceI = curFaceProcAddr[oldFaceI];
// Check if the face is mapped (if the index is >= 0) // Check if the face is mapped.
if (newFaceI > -1) // Note:
// 1. Need to decrement by 1 because of the face turning
// 2. No need to handle negative new indices coming from
// slave processor because we'd end up with
// duplicate entries (two faces on two processors
// merged into a single one)
if (newFaceI > 0)
{ {
// This is a face that's been correctly // This is a face that's been correctly
// mapped, insert the face in the new zone // mapped, insert the face in the new zone
zoneReconFaces[nFaces] = newFaceI; zoneReconFaces[nFaces] = newFaceI - 1;
// Also store the flip map of the face. Note: I'm // Also store the flip map of the face. We don't
// pretty sure that we don't need to check whether // need to check whether the flip map has been
// the flip map has been preserved because the // preserved because we only get the combined faces
// combined faces are inserted from master side // that are inserted from master side.
// always.
zoneReconFaceFlips[nFaces] = zoneFlipMap[i]; zoneReconFaceFlips[nFaces] = zoneFlipMap[i];
// Increment the number of faces for this zone // Increment the number of faces for this zone