From 9025a4d66fea8c87eb913217898f9a4e758362b8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 7 Aug 2013 09:58:29 +0100 Subject: [PATCH] BUG: decompositionMethod: enforce explicitConnections to be on same proc --- .../decompositionMethod/decompositionMethod.C | 45 +++++++++++++++++++ .../decompositionMethod/decompositionMethod.H | 7 ++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C index a04edc3149..53baa65b18 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -884,6 +884,51 @@ Foam::labelList Foam::decompositionMethod::decompose ); + + // Implement the explicitConnections since above decompose + // does not know about them + forAll(explicitConnections, i) + { + const labelPair& baffle = explicitConnections[i]; + label f0 = baffle.first(); + label f1 = baffle.second(); + + if (!blockedFace[f0] && !blockedFace[f1]) + { + // Note: what if internal faces and owner and neighbour on + // different processor? So for now just push owner side + // proc + + const label procI = finalDecomp[mesh.faceOwner()[f0]]; + + finalDecomp[mesh.faceOwner()[f1]] = procI; + if (mesh.isInternalFace(f1)) + { + finalDecomp[mesh.faceNeighbour()[f1]] = procI; + } + } + else if (blockedFace[f0] != blockedFace[f1]) + { + FatalErrorIn + ( + "labelList decompose\n" + "(\n" + " const polyMesh&,\n" + " const scalarField&,\n" + " const boolList&,\n" + " const PtrList&,\n" + " const labelList&,\n" + " const List&\n" + ")" + ) << "On explicit connection between faces " << f0 + << " and " << f1 + << " the two blockedFace status are not equal : " + << blockedFace[f0] << " and " << blockedFace[f1] + << exit(FatalError); + } + } + + // For specifiedProcessorFaces rework the cellToProc to enforce // all on one processor since we can't guarantee that the input // to regionSplit was a single region. diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H index 43e538dc4e..638cbcb59b 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H @@ -266,13 +266,16 @@ public: ); // Decompose a mesh with constraints: - // - blockedFace : whether owner and neighbour should be on + // - blockedFace : whether owner and neighbour should be on same + // processor // - specifiedProcessorFaces, specifiedProcessor : sets of faces // that should go to same processor (as specified in // specifiedProcessor, can be -1) // - explicitConnections : connections between baffle faces + // (blockedFace should be false on these). Owner and + // neighbour on same processor. // Set all to zero size to have unconstrained decomposition. - labelList decompose + virtual labelList decompose ( const polyMesh& mesh, const scalarField& cellWeights,