From faa6d0e4dad9530a05fc4015d3af213950e7df52 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 6 Sep 2016 13:29:05 +0100 Subject: [PATCH] GAMGAgglomeration: Add support for nCellsInCoarsestLevel = 1 and better agglomeration termination Patch provided by Mattijs Janssens Resolves bug-report http://bugs.openfoam.org/view.php?id=2226 --- .../GAMGAgglomeration/GAMGAgglomeration.C | 15 +++++++++++---- .../GAMGAgglomeration/GAMGAgglomeration.H | 6 +++++- .../pairGAMGAgglomeration/pairGAMGAgglomerate.C | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 6f7665b944..eb73b6f436 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -206,13 +206,20 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels) bool Foam::GAMGAgglomeration::continueAgglomerating ( + const label nFineCells, const label nCoarseCells ) const { - // Check the need for further agglomeration on all processors - bool contAgg = nCoarseCells >= nCellsInCoarsestLevel_; - mesh().reduce(contAgg, andOp()); - return contAgg; + const label nTotalCoarseCells = returnReduce(nCoarseCells, sumOp