From 063d3ca9a46f3303d262683d6fc962e8a6fd4b72 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 8 Nov 2011 09:46:11 +0000 Subject: [PATCH] ENH: Test-GAMGAgglomeration: some printing --- .../Test-GAMGAgglomeration.C | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/applications/test/GAMGAgglomeration/Test-GAMGAgglomeration.C b/applications/test/GAMGAgglomeration/Test-GAMGAgglomeration.C index 1cfe12db48..b1d17278d3 100644 --- a/applications/test/GAMGAgglomeration/Test-GAMGAgglomeration.C +++ b/applications/test/GAMGAgglomeration/Test-GAMGAgglomeration.C @@ -53,18 +53,51 @@ int main(int argc, char *argv[]) labelList cellToCoarse(identity(mesh.nCells())); labelListList coarseToCell(invertOneToMany(mesh.nCells(), cellToCoarse)); + runTime++; + + // Write initial agglomeration + { + volScalarField scalarAgglomeration + ( + IOobject + ( + "agglomeration", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("aggomeration", dimless, 0.0) + ); + scalarField& fld = scalarAgglomeration.internalField(); + forAll(fld, cellI) + { + fld[cellI] = cellToCoarse[cellI]; + } + fld /= max(fld); + scalarAgglomeration.correctBoundaryConditions(); + scalarAgglomeration.write(); + + Info<< "Writing initial cell distribution to " + << runTime.timeName() << endl; + } + + for (label level = 0; level < agglom.size(); level++) { - runTime.setTime(dimensionedScalar("time", dimTime, level), level); + runTime++; - Info<< "Level = " << runTime.timeName() << nl << endl; + Info<< "Time = " << runTime.timeName() << nl << endl; const labelList& addr = agglom.restrictAddressing(level); label coarseSize = max(addr)+1; - Info<< " current size : " - << returnReduce(addr.size(), sumOp