diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H index 26ad6cc5e7..e57951a186 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H @@ -70,25 +70,6 @@ protected: // (usually there is only one) static label masterFace(const polyMesh&, const label, const label); -// // From mesh to compact row storage format -// // (like CompactListList) -// static void calcCSR -// ( -// const polyMesh& mesh, -// List& adjncy, -// List& xadj -// ); -// -// // From cell-cell connections to compact row storage format -// // (like CompactListList) -// static void calcCSR -// ( -// const labelListList& cellCells, -// List& adjncy, -// List& xadj -// ); - - private: // Private Member Functions diff --git a/src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C b/src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C index e9a61c729a..22f1d6a3d0 100644 --- a/src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C +++ b/src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C @@ -50,10 +50,14 @@ namespace Foam // is in the cells from neighbouring processors which need to be renumbered. void Foam::multiLevelDecomp::subsetGlobalCellCells ( + const label nDomains, + const label domainI, + const labelList& dist, + const labelListList& cellCells, const labelList& set, labelListList& subCellCells, - label& cutConnections + labelList& cutConnections ) const { // Determine new index for cells by inverting subset @@ -68,10 +72,14 @@ void Foam::multiLevelDecomp::subsetGlobalCellCells List > compactMap; mapDistribute map(globalCells, subCellCells, compactMap); map.distribute(oldToNew); + labelList allDist(dist); + map.distribute(allDist); + // Now subCellCells contains indices into oldToNew which are the // new locations of the neighbouring cells. + cutConnections.setSize(nDomains); cutConnections = 0; forAll(subCellCells, subCellI) @@ -85,7 +93,7 @@ void Foam::multiLevelDecomp::subsetGlobalCellCells label subCellI = oldToNew[cCells[i]]; if (subCellI == -1) { - cutConnections++; + cutConnections[allDist[cCells[i]]]++; } else { @@ -118,16 +126,6 @@ void Foam::multiLevelDecomp::decompose ) ); -//Pout<< "At level " << levelI << endl; -//forAll(dist, i) -//{ -// Pout<< " " << i << " at:" << points[i] -// << " original:" << pointMap[i] << " dist:" << dist[i] -// << " connected to:" << pointField(points, pointPoints[i]) -// << endl; -//} -//Pout<< endl; - forAll(pointMap, i) { label orig = pointMap[i]; @@ -146,30 +144,62 @@ void Foam::multiLevelDecomp::decompose finalDecomp *= methods_[levelI+1].nDomains(); // Extract processor+local index from point-point addressing - - forAll(domainToPoints, domainI) + if (debug && Pstream::master()) { - const labelList& myPoints = domainToPoints[domainI]; + Pout<< "Decomposition at level " << levelI << " :" << endl; + } + + for (label domainI = 0; domainI < n; domainI++) + { + // Extract elements for current domain + const labelList domainPoints(findIndices(dist, domainI)); // Subset point-wise data. - pointField subPoints(points, myPoints); - scalarField subWeights(pointWeights, myPoints); - labelList subPointMap(UIndirectList