diff --git a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C index fed03a58f9..deaa397e03 100644 --- a/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -31,6 +31,7 @@ License #include "regionSplit.H" #include "localPointRegion.H" #include "minData.H" +#include "BitOps.H" #include "FaceCellWave.H" #include "preserveBafflesConstraint.H" @@ -48,7 +49,8 @@ namespace Foam // Fallback name when searching for optional coefficients directories static const word defaultName("coeffs"); -} + +} // End namespace Foam // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // @@ -654,15 +656,15 @@ void Foam::decompositionMethod::calcCellCells // Check for duplicates connections between cells // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Done as postprocessing step since we now have cellCells. - label newIndex = 0; - labelHashSet nbrCells; - if (cellCells.size() == 0) { return; } + label newIndex = 0; + labelHashSet nbrCells; + label startIndex = cellCells.offsets()[0]; forAll(cellCells, celli) @@ -783,8 +785,8 @@ void Foam::decompositionMethod::calcCellCells forAll(pp, i) { const label own = agglom[faceOwner[facei]]; - const label globalNei = globalNeighbour[bFacei]; + if ( !globalAgglom.isLocal(globalNei) @@ -839,7 +841,6 @@ void Foam::decompositionMethod::calcCellCells forAll(pp, i) { const label own = agglom[faceOwner[facei]]; - const label globalNei = globalNeighbour[bFacei]; if @@ -848,7 +849,7 @@ void Foam::decompositionMethod::calcCellCells || globalAgglom.toLocal(globalNei) != own ) { - label ownIndex = offsets[own] + nFacesPerCell[own]++; + const label ownIndex = offsets[own] + nFacesPerCell[own]++; m[ownIndex] = globalNei; w[ownIndex] = mag(mesh.faceAreas()[facei]); } @@ -863,15 +864,15 @@ void Foam::decompositionMethod::calcCellCells // Check for duplicates connections between cells // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Done as postprocessing step since we now have cellCells. - label newIndex = 0; - labelHashSet nbrCells; - if (cellCells.size() == 0) { return; } + label newIndex = 0; + labelHashSet nbrCells; + label startIndex = cellCells.offsets()[0]; forAll(cellCells, celli) @@ -923,9 +924,9 @@ Foam::labelList Foam::decompositionMethod::decompose ) const { // Any weights specified? - label nWeights = returnReduce(cellWeights.size(), sumOp