Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (1)
......@@ -165,16 +165,38 @@ PetscErrorCode Foam::PetscUtils::foamKSPMonitorFoam
ierr = PetscStrtolower(normtype);CHKERRQ(ierr);
if (ctx->useFoamTest) // we are using foam convergence testing, list foam norm first
{
ierr = PetscViewerASCIIPrintf(viewer, "%3D KSP Residual foam norm %14.12e (PETSc %s norm %14.12e)\n", it, (double)fnorm, normtype, (double)rnorm);CHKERRQ(ierr);
ierr = PetscViewerASCIIPrintf
(
viewer,
"%4" PetscInt_FMT " KSP Residual foam norm %14.12e (PETSc %s norm %14.12e)\n",
it,
static_cast<double>(fnorm),
normtype,
static_cast<double>(rnorm)
);CHKERRQ(ierr);
}
else // we are using KSP default convergence testing, list KSP norm first
{
ierr = PetscViewerASCIIPrintf(viewer, "%3D KSP Residual %s norm %14.12e (foam norm %14.12e)\n", it, normtype, (double)rnorm, (double)fnorm);CHKERRQ(ierr);
ierr = PetscViewerASCIIPrintf
(
viewer,
"%4" PetscInt_FMT " KSP Residual %s norm %14.12e (foam norm %14.12e)\n",
it,
normtype,
static_cast<double>(rnorm),
static_cast<double>(fnorm)
);CHKERRQ(ierr);
}
}
else // KSP has no norm, list foam norm only
{
ierr = PetscViewerASCIIPrintf(viewer, "%3D KSP Residual foam norm %14.12e\n", it, (double)fnorm);CHKERRQ(ierr);
ierr = PetscViewerASCIIPrintf
(
viewer,
"%4" PetscInt_FMT " KSP Residual foam norm %14.12e\n",
it,
static_cast<double>(fnorm)
);CHKERRQ(ierr);
}
ierr = PetscViewerASCIISubtractTab(viewer, tablevel);CHKERRQ(ierr);
PetscFunctionReturn(0);
......