diff --git a/src/OpenFOAM/meshes/bandCompression/bandCompression.C b/src/OpenFOAM/meshes/bandCompression/bandCompression.C index 96da4db0dc..6a74fdf58a 100644 --- a/src/OpenFOAM/meshes/bandCompression/bandCompression.C +++ b/src/OpenFOAM/meshes/bandCompression/bandCompression.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -146,4 +146,129 @@ Foam::labelList Foam::bandCompression(const labelListList& cellCellAddressing) } +Foam::labelList Foam::bandCompression +( + const labelList& cellCells, + const labelList& offsets +) +{ + // Count number of neighbours + labelList numNbrs(offsets.size()-1, 0); + forAll(numNbrs, cellI) + { + label start = offsets[cellI]; + label end = offsets[cellI+1]; + + for (label faceI = start; faceI < end; faceI++) + { + numNbrs[cellI]++; + numNbrs[cellCells[faceI]]++; + } + } + + + labelList newOrder(offsets.size()-1); + + // the business bit of the renumbering + SLList