From e4fe63a696a525aebcc90644951978c0a52381d1 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Fri, 23 Dec 2011 12:11:37 +0000 Subject: [PATCH] BUG: decompositionMethod: numbering across coupled boundaries --- .../decompositionMethod/decompositionMethod.C | 19 ++++++++------- .../decompose/ptscotchDecomp/ptscotchDecomp.C | 23 ------------------- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C index 363000bad67..e0e96412d3f 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -236,8 +236,8 @@ void Foam::decompositionMethod::calcCellCells label globalNei = globalNeighbour[bFaceI]; if ( - globalAgglom.isLocal(globalNei) - && globalAgglom.toLocal(globalNei) != own + !globalAgglom.isLocal(globalNei) + || globalAgglom.toLocal(globalNei) != own ) { nFacesPerCell[own]++; @@ -285,10 +285,11 @@ void Foam::decompositionMethod::calcCellCells label own = agglom[faceOwner[faceI]]; label globalNei = globalNeighbour[bFaceI]; + if ( - globalAgglom.isLocal(globalNei) - && globalAgglom.toLocal(globalNei) != own + !globalAgglom.isLocal(globalNei) + || globalAgglom.toLocal(globalNei) != own ) { m[offsets[own] + nFacesPerCell[own]++] = globalNei; @@ -304,15 +305,15 @@ void Foam::decompositionMethod::calcCellCells // Check for duplicates connections between cells // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Done as postprocessing step since we now have cellCells. - label startIndex = 0; label newIndex = 0; labelHashSet nbrCells; forAll(cellCells, cellI) { nbrCells.clear(); - nbrCells.insert(cellI); + nbrCells.insert(globalAgglom.toGlobal(cellI)); - label& endIndex = cellCells.offsets()[cellI+1]; + label startIndex = cellCells.offsets()[cellI]; + label endIndex = cellCells.offsets()[cellI+1]; for (label i = startIndex; i < endIndex; i++) { @@ -321,9 +322,7 @@ void Foam::decompositionMethod::calcCellCells cellCells.m()[newIndex++] = cellCells.m()[i]; } } - - startIndex = endIndex; - endIndex = newIndex; + cellCells.offsets()[cellI+1] = newIndex; } cellCells.m().setSize(newIndex); diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C index 54be6ad834a..e7c4995a362 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C @@ -371,29 +371,6 @@ Foam::label Foam::ptscotchDecomp::decompose Pout<< "ptscotchDecomp : entering with xadj:" << xadj.size() << endl; } - -if (debug) -{ - Pout<< "nProcessors_:" << nProcessors_ << endl; - - globalIndex globalCells(xadj.size()-1); - - Pout<< "Xadj:" << endl; - for (label cellI = 0; cellI < xadj.size()-1; cellI++) - { - Pout<< "cell:" << cellI - << " global:" << globalCells.toGlobal(cellI) - << " connected to:" << endl; - label start = xadj[cellI]; - label end = xadj[cellI+1]; - for (label i = start; i < end; i++) - { - Pout<< " cell:" << adjncy[i] << endl; - } - } - Pout<< endl; -} - // Dump graph if (decompositionDict_.found("ptscotchCoeffs")) { -- GitLab