diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C index 44d3cc027b..5982111f15 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -153,240 +153,6 @@ Foam::labelList Foam::decompositionMethod::decompose } -// Return the minimum face between two cells. Only relevant for -// cells with multiple faces inbetween. -Foam::label Foam::decompositionMethod::masterFace -( - const polyMesh& mesh, - const label own, - const label nei -) -{ - label minFaceI = labelMax; - - // Count multiple faces between own and nei only once - const cell& ownFaces = mesh.cells()[own]; - forAll(ownFaces, i) - { - label otherFaceI = ownFaces[i]; - - if (mesh.isInternalFace(otherFaceI)) - { - label nbrCellI = - ( - mesh.faceNeighbour()[otherFaceI] != own - ? mesh.faceNeighbour()[otherFaceI] - : mesh.faceOwner()[otherFaceI] - ); - - if (nbrCellI == nei) - { - minFaceI = min(minFaceI, otherFaceI); - } - } - } - - return minFaceI; -} - - -//void Foam::decompositionMethod::calcCSR -//( -// const polyMesh& mesh, -// List& adjncy, -// List& xadj -//) -//{ -// const polyBoundaryMesh& pbm = mesh.boundaryMesh(); -// -// // Make Metis CSR (Compressed Storage Format) storage -// // adjncy : contains neighbours (= edges in graph) -// // xadj(celli) : start of information in adjncy for celli -// -// -// // Count unique faces between cells -// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// labelList nFacesPerCell(mesh.nCells(), 0); -// -// // Internal faces -// for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++) -// { -// label own = mesh.faceOwner()[faceI]; -// label nei = mesh.faceNeighbour()[faceI]; -// -// if (faceI == masterFace(mesh, own, nei)) -// { -// nFacesPerCell[own]++; -// nFacesPerCell[nei]++; -// } -// } -// -// // Coupled faces. Only cyclics done. -// HashSet > cellPair(mesh.nFaces()-mesh.nInternalFaces()); -// -// forAll(pbm, patchI) -// { -// if -// ( -// isA(pbm[patchI]) -// && refCast(pbm[patchI]).owner() -// ) -// { -// const cyclicPolyPatch& cycPatch = refCast -// ( -// pbm[patchI] -// ); -// -// const labelUList& faceCells = cycPatch.faceCells(); -// const labelUList& nbrCells = -// cycPatch.neighbPatch().faceCells(); -// -// forAll(faceCells, facei) -// { -// label own = faceCells[facei]; -// label nei = nbrCells[facei]; -// -// if (cellPair.insert(edge(own, nei))) -// { -// nFacesPerCell[own]++; -// nFacesPerCell[nei]++; -// } -// } -// } -// } -// -// -// // Size tables -// // ~~~~~~~~~~~ -// -// // Sum nFacesPerCell -// xadj.setSize(mesh.nCells()+1); -// -// label nConnections = 0; -// -// for (label cellI = 0; cellI < mesh.nCells(); cellI++) -// { -// xadj[cellI] = nConnections; -// nConnections += nFacesPerCell[cellI]; -// } -// xadj[mesh.nCells()] = nConnections; -// adjncy.setSize(nConnections); -// -// -// -// // Fill tables -// // ~~~~~~~~~~~ -// -// nFacesPerCell = 0; -// -// // Internal faces -// for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++) -// { -// label own = mesh.faceOwner()[faceI]; -// label nei = mesh.faceNeighbour()[faceI]; -// -// if (faceI == masterFace(mesh, own, nei)) -// { -// adjncy[xadj[own] + nFacesPerCell[own]++] = nei; -// adjncy[xadj[nei] + nFacesPerCell[nei]++] = own; -// } -// } -// -// // Coupled faces. Only cyclics done. -// cellPair.clear(); -// forAll(pbm, patchI) -// { -// if -// ( -// isA(pbm[patchI]) -// && refCast(pbm[patchI]).owner() -// ) -// { -// const cyclicPolyPatch& cycPatch = refCast -// ( -// pbm[patchI] -// ); -// -// const labelUList& faceCells = cycPatch.faceCells(); -// const labelUList& nbrCells = -// cycPatch.neighbPatch().faceCells(); -// -// forAll(faceCells, facei) -// { -// label own = faceCells[facei]; -// label nei = nbrCells[facei]; -// -// if (cellPair.insert(edge(own, nei))) -// { -// adjncy[xadj[own] + nFacesPerCell[own]++] = nei; -// adjncy[xadj[nei] + nFacesPerCell[nei]++] = own; -// } -// } -// } -// } -//} -// -// -//// From cell-cell connections to Metis format (like CompactListList) -//void Foam::decompositionMethod::calcCSR -//( -// const labelListList& cellCells, -// List& adjncy, -// List& xadj -//) -//{ -// labelHashSet nbrCells; -// -// // Count number of internal faces -// label nConnections = 0; -// -// forAll(cellCells, coarseI) -// { -// nbrCells.clear(); -// -// const labelList& cCells = cellCells[coarseI]; -// -// forAll(cCells, i) -// { -// if (nbrCells.insert(cCells[i])) -// { -// nConnections++; -// } -// } -// } -// -// // Create the adjncy array as twice the size of the total number of -// // internal faces -// adjncy.setSize(nConnections); -// -// xadj.setSize(cellCells.size()+1); -// -// -// // Fill in xadj -// // ~~~~~~~~~~~~ -// label freeAdj = 0; -// -// forAll(cellCells, coarseI) -// { -// xadj[coarseI] = freeAdj; -// -// nbrCells.clear(); -// -// const labelList& cCells = cellCells[coarseI]; -// -// forAll(cCells, i) -// { -// if (nbrCells.insert(cCells[i])) -// { -// adjncy[freeAdj++] = cCells[i]; -// } -// } -// } -// xadj[cellCells.size()] = freeAdj; -//} - - void Foam::decompositionMethod::calcCellCells ( const polyMesh& mesh, @@ -395,25 +161,17 @@ void Foam::decompositionMethod::calcCellCells CompactListList