diff --git a/src/foam/matrices/lduMatrix/solvers/GAMG/interfaces/ggiGAMGInterface/ggiGAMGInterface.H b/src/foam/matrices/lduMatrix/solvers/GAMG/interfaces/ggiGAMGInterface/ggiGAMGInterface.H index f29197939..e63b2c07b 100644 --- a/src/foam/matrices/lduMatrix/solvers/GAMG/interfaces/ggiGAMGInterface/ggiGAMGInterface.H +++ b/src/foam/matrices/lduMatrix/solvers/GAMG/interfaces/ggiGAMGInterface/ggiGAMGInterface.H @@ -108,7 +108,7 @@ class ggiGAMGInterface // Private static data //- Processor cluster offset index - static const label procOffset = 1000000; + static const label procOffset = 4000000; public: diff --git a/src/lduSolvers/amg/amgPolicy/pamgPolicy.C b/src/lduSolvers/amg/amgPolicy/pamgPolicy.C index 80cde8871..b0e436133 100644 --- a/src/lduSolvers/amg/amgPolicy/pamgPolicy.C +++ b/src/lduSolvers/amg/amgPolicy/pamgPolicy.C @@ -301,12 +301,26 @@ void Foam::pamgPolicy::calcChild() // whole gang of processes; otherwise I may end up with a different // number of agglomeration levels on different processors. - if (nCoarseEqns_ > minCoarseEqns()) + if (nCoarseEqns_ > minCoarseEqns() && 3*nCoarseEqns_ <= 2*nEqns) { coarsen_ = true; } reduce(coarsen_, andOp()); + + if (lduMatrix::debug >= 2) + { + Pout << "Coarse level size: " << nCoarseEqns_; + + if (coarsen_) + { + Pout << ". Accepted" << endl; + } + else + { + Pout << ". Rejected" << endl; + } + } } @@ -414,8 +428,8 @@ Foam::autoPtr Foam::pamgPolicy::restrictMatrix if (rmUpperAddr == rmLowerAddr) { // For each fine coeff inside of a coarse cluster keep the address - // of the cluster corresponding to the coeff in th - // e coeffRestrictAddr as a negative index + // of the cluster corresponding to the coeff in the + // coeffRestrictAddr as a negative index coeffRestrictAddr[fineCoeffi] = -(rmUpperAddr + 1); } else @@ -425,7 +439,7 @@ Foam::autoPtr Foam::pamgPolicy::restrictMatrix label cOwn = rmUpperAddr; label cNei = rmLowerAddr; - // get coarse owner and neighbour + // Get coarse owner and neighbour if (rmUpperAddr > rmLowerAddr) { cOwn = rmLowerAddr; @@ -438,7 +452,7 @@ Foam::autoPtr Foam::pamgPolicy::restrictMatrix bool nbrFound = false; label& ccnCoeffs = blockNnbrs[cOwn]; - for (int i=0; i Foam::pamgPolicy::restrictMatrix // Add the coarse level + // Set the coarse ldu addressing onto the list lduPrimitiveMesh* coarseAddrPtr = new lduPrimitiveMesh ( @@ -597,6 +612,7 @@ Foam::autoPtr Foam::pamgPolicy::restrictMatrix } } + // Create GAMG interfaces forAll (interfaceFields, intI) { if (interfaceFields.set(intI)) @@ -665,7 +681,8 @@ Foam::autoPtr Foam::pamgPolicy::restrictMatrix lduMatrix* coarseMatrixPtr = new lduMatrix(*coarseAddrPtr); lduMatrix& coarseMatrix = *coarseMatrixPtr; - // Coarse matrix diagonal initialised by restricting the finer mesh diagonal + // Coarse matrix diagonal initialised by restricting the + // finer mesh diagonal scalarField& coarseDiag = coarseMatrix.diag(); restrictResidual(matrix_.diag(), coarseDiag);