From 8fd3cee834860f89ac5579a39cb524cbf9c806c7 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 15 Jun 2015 17:14:24 +0100 Subject: [PATCH] pairPatchAgglomeration: Stop agglomeration loop if no further agglomeration is achieved Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1157 --- .../pairPatchAgglomeration/pairPatchAgglomeration.C | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.C b/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.C index 9931d9c31..f3c986bac 100644 --- a/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.C +++ b/src/fvAgglomerationMethods/pairPatchAgglomeration/pairPatchAgglomeration.C @@ -365,7 +365,7 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch } -void Foam::pairPatchAgglomeration:: agglomerate() +void Foam::pairPatchAgglomeration::agglomerate() { label nPairLevels = 0; label nCreatedLevels = 1; // 0 level is the base patch @@ -380,13 +380,15 @@ void Foam::pairPatchAgglomeration:: agglomerate() do { + label nCoarseFacesPrev = nCoarseFaces; + finalAgglomPtr = agglomerateOneLevel ( nCoarseFaces, patch ); - if (nCoarseFaces > 0) + if (nCoarseFaces > 0 && nCoarseFaces != nCoarseFacesPrev) { if ( @@ -524,7 +526,7 @@ Foam::tmp Foam::pairPatchAgglomeration::agglomerateOneLevel { // if not create single-cell "clusters" for each coarseCellMap[facei] = nCoarseFaces; - nCoarseFaces ++; + nCoarseFaces++; } } }