From 0b7a873c07de0764f134dacd7eb34e7153900dc2 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 3 Jul 2013 22:16:40 +0100 Subject: [PATCH] fvMatrixSolve: print solver messages only if the SolverPerformance debug switch is set etc/controlDict: Set SolverPerformance debug switch default to 1 --- etc/controlDict | 1 + .../matrices/LduMatrix/LduMatrix/SolverPerformance.C | 3 +-- src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C | 12 ++++++++---- .../fvMatrices/fvScalarMatrix/fvScalarMatrix.C | 10 ++++++++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/etc/controlDict b/etc/controlDict index fba02069de..8f811534dc 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -266,6 +266,7 @@ DebugSwitches SingleKineticRateDevolatilisation 0; SingleMixtureFraction 0; Smagorinsky 0; + SolverPerformance 1; SpalartAllmaras 0; SpalartAllmarasDDES 0; SpalartAllmarasIDDES 0; diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C index 5cf4e60efa..6a4cf06508 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C @@ -65,8 +65,7 @@ bool Foam::SolverPerformance::checkConvergence { if (debug >= 2) { - //Info<< solverName_ - Pout<< solverName_ + Info<< solverName_ << ": Iteration " << noIterations_ << " residual = " << finalResidual_ << endl; diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index f1490ac9ce..333acca086 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -200,8 +200,10 @@ Foam::solverPerformance Foam::fvMatrix::solveSegregated solverControls )->solve(psiCmpt, sourceCmpt, cmpt); - //solverPerf.print(Info); - solverPerf.print(Info(this->mesh().comm())); + if (solverPerformance::debug) + { + solverPerf.print(Info(this->mesh().comm())); + } solverPerfVec = max(solverPerfVec, solverPerf); solverPerfVec.solverName() = solverPerf.solverName(); @@ -265,8 +267,10 @@ Foam::solverPerformance Foam::fvMatrix::solveCoupled coupledMatrixSolver->solve(psi) ); - //solverPerf.print(Info); - solverPerf.print(Info(this->mesh().comm())); + if (SolverPerformance::debug) + { + solverPerf.print(Info(this->mesh().comm())); + } psi.correctBoundaryConditions(); diff --git a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C index 4a200f7476..7bd9c2a2c2 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C @@ -118,7 +118,10 @@ Foam::solverPerformance Foam::fvMatrix::fvSolver::solve totalSource ); - solverPerf.print(Info(fvMat_.mesh().comm())); + if (solverPerformance::debug) + { + solverPerf.print(Info(fvMat_.mesh().comm())); + } fvMat_.diag() = saveDiag; @@ -165,7 +168,10 @@ Foam::solverPerformance Foam::fvMatrix::solveSegregated solverControls )->solve(psi.internalField(), totalSource); - solverPerf.print(Info(mesh().comm())); + if (solverPerformance::debug) + { + solverPerf.print(Info(mesh().comm())); + } diag() = saveDiag;