diff --git a/src/petsc4Foam/utils/petscUtils.C b/src/petsc4Foam/utils/petscUtils.C index 004649e47a9fd4a26108895fe4c11d92afbcccdd..4dcd0af45057084a50870f199bfe7f059dac7ce0 100644 --- a/src/petsc4Foam/utils/petscUtils.C +++ b/src/petsc4Foam/utils/petscUtils.C @@ -196,6 +196,7 @@ PetscErrorCode Foam::PetscUtils::foamKSPMonitorFoam PetscInt tablevel; const char *prefix; PetscReal fnorm; + KSPNormType ntype; PetscFunctionBeginUser; auto* ctx = static_cast<petscLinearSolverContext*>(cctx); @@ -210,7 +211,8 @@ PetscErrorCode Foam::PetscUtils::foamKSPMonitorFoam if (it == 0) { ierr = PetscViewerASCIIPrintf(viewer, " Residual norms for %s solve.\n", prefix);CHKERRQ(ierr); } - ierr = PetscViewerASCIIPrintf(viewer, "%3D KSP Residual foamnorm %14.12e (PETSc L2 %14.12e)\n", it, (double)fnorm, (double)rnorm);CHKERRQ(ierr); + ierr = KSPGetNormType(ksp, &ntype);CHKERRQ(ierr); + ierr = PetscViewerASCIIPrintf(viewer, "%3D KSP Residual foamnorm %14.12e (PETSc %s norm %14.12e)\n", it, (double)fnorm, KSPNormTypes[ntype], (double)rnorm);CHKERRQ(ierr); ierr = PetscViewerASCIISubtractTab(viewer, tablevel);CHKERRQ(ierr); PetscFunctionReturn(0); }