From 3540cda2f97c6cd63fcfe79195ccf73f803f936f Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 16 Jul 2013 21:27:05 +0100 Subject: [PATCH] ENH: bandCompression: addressing in losort form --- .../meshes/bandCompression/bandCompression.C | 127 +++++++++++++++++- .../meshes/bandCompression/bandCompression.H | 5 +- 2 files changed, 130 insertions(+), 2 deletions(-) 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