diff --git a/etc/controlDict b/etc/controlDict index b9c41cb3a4..fba02069de 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -135,7 +135,7 @@ DebugSwitches FDIC 0; FaceCellWave 0; GAMG 0; - GAMGAgglomeration 0; + GAMGAgglomeration 1; GAMGInterface 0; GAMGInterfaceField 0; Gamma 0; diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 19a8138fe5..6d346617c1 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -331,10 +331,8 @@ eagerGAMGProcAgglomeration = $(GAMGProcAgglomerations)/eagerGAMGProcAgglomeratio $(eagerGAMGProcAgglomeration)/eagerGAMGProcAgglomeration.C noneGAMGProcAgglomeration = $(GAMGProcAgglomerations)/noneGAMGProcAgglomeration $(noneGAMGProcAgglomeration)/noneGAMGProcAgglomeration.C -/* -cellFaceRatioGAMGProcAgglomeration = $(GAMGProcAgglomerations)/cellFaceRatioGAMGProcAgglomeration -$(cellFaceRatioGAMGProcAgglomeration)/cellFaceRatioGAMGProcAgglomeration.C -*/ +procFacesGAMGProcAgglomeration = $(GAMGProcAgglomerations)/procFacesGAMGProcAgglomeration +$(procFacesGAMGProcAgglomeration)/procFacesGAMGProcAgglomeration.C meshes/lduMesh/lduMesh.C diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C index e6781ed23f..066aa39d3b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C @@ -351,7 +351,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing ); - if (debug) + if (debug & 2) { Pout<< "GAMGAgglomeration :" << " agglomerated level " << fineLevelIndex 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 d1551eb399..a53a5fe9ab 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -27,9 +27,9 @@ License #include "lduMesh.H" #include "lduMatrix.H" #include "Time.H" -#include "dlLibraryTable.H" #include "GAMGInterface.H" #include "GAMGProcAgglomeration.H" +#include "IOmanip.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -67,23 +67,94 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels) procBoundaryFaceMap_.setSize(nCreatedLevels); procAgglomeratorPtr_().agglomerate(); - } - if (debug) - { - for (label levelI = 0; levelI <= size(); levelI++) + + if (debug) { - if (hasMeshLevel(levelI)) + + Info<< "GAMGAgglomeration:" << nl + << " local agglomerator : " << type() << nl + << " processor agglomerator : " + << procAgglomeratorPtr_().type() << nl + << nl; + + Info<< setw(40) << "nCells" + << setw(24) << "nInterfaces" + << setw(24) << "Ratio" << nl + << setw(8) << "Level" + << setw(8) << "nProcs" + << " " + << setw(8) << "avg" + << setw(8) << "max" + << " " + << setw(8) << "avg" + << setw(8) << "max" + << " " << setw(4) << "avg" + << " " << setw(4) << "max" + << nl + << setw(8) << "-----" + << setw(8) << "------" + << " " + << setw(8) << "---" + << setw(8) << "---" + << " " + << setw(8) << "---" + << setw(8) << "---" + << " " << setw(4) << "---" + << " " << setw(4) << "---" + << nl; + + for (label levelI = 0; levelI <= size(); levelI++) { - const lduMesh& fineMesh = meshLevel(levelI); - Pout<< "Level " << levelI << " fine mesh:"<< nl; - Pout<< fineMesh.info() << endl; - } - else - { - Pout<< "Level " << levelI << " has no fine mesh:" << nl - << endl; + label nProcs = 0; + label nCells = 0; + label nInterfaces = 0; + label nIntFaces = 0; + scalar ratio = 0.0; + + if (hasMeshLevel(levelI)) + { + nProcs = 1; + + const lduMesh& fineMesh = meshLevel(levelI); + nCells = fineMesh.lduAddr().size(); + + const lduInterfacePtrsList interfaces = + fineMesh.interfaces(); + forAll(interfaces, i) + { + if (interfaces.set(i)) + { + nInterfaces++; + nIntFaces += interfaces[i].faceCells().size(); + } + } + ratio = scalar(nIntFaces)/nCells; + } + + label totNprocs = returnReduce(nProcs, sumOp