ENH: variable-specific debug flags (finiteArea solvers)

This commit is contained in:
Kutalmis Bercin
2021-08-16 14:29:51 +01:00
committed by Mark Olesen
parent dabe506e9e
commit f0fb0d4263
2 changed files with 19 additions and 5 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,6 +60,13 @@ Foam::SolverPerformance<Type> Foam::faMatrix<Type>::solve
<< "solving faMatrix<Type>"
<< endl;
const int logLevel =
solverControls.getOrDefault<int>
(
"log",
SolverPerformance<Type>::debug
);
auto& psi =
const_cast<GeometricField<Type, faPatchField, areaMesh>&>(psi_);
@ -141,7 +148,7 @@ Foam::SolverPerformance<Type> Foam::faMatrix<Type>::solve
solverControls
)->solve(psiCmpt, sourceCmpt, cmpt);
if (SolverPerformance<Type>::debug)
if (logLevel)
{
solverPerf.print(Info);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -62,7 +62,14 @@ Foam::solverPerformance Foam::faMatrix<Foam::scalar>::solve
<< "solving faMatrix<scalar>"
<< endl;
GeometricField<scalar, faPatchField, areaMesh>& psi =
const int logLevel =
solverControls.getOrDefault<int>
(
"log",
solverPerformance::debug
);
auto& psi =
const_cast<GeometricField<scalar, faPatchField, areaMesh>&>(psi_);
scalarField saveDiag(diag());
@ -82,7 +89,7 @@ Foam::solverPerformance Foam::faMatrix<Foam::scalar>::solve
solverControls
)->solve(psi.ref(), totalSource);
if (solverPerformance::debug)
if (logLevel)
{
solverPerf.print(Info);
}