Skip to content
Snippets Groups Projects
Commit ed60b412 authored by stefano zampini's avatar stefano zampini Committed by Mark OLESEN
Browse files

ENH: add Norm type to foam monitor

parent 12437b0c
1 merge request!1Fix for the GPU case + performance improvement for CG and foam L1 norm computation
......@@ -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);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment