Skip to content
GitLab
Explore
Sign in
Register
This is an archived project. Repository and other project resources are read-only.
Commits on Source (1)
COMP: use PetscInt_FMT instead of deprecated %D format specification
· 36260ba7
Mark OLESEN
authored
Dec 09, 2022
36260ba7
Hide whitespace changes
Inline
Side-by-side
src/petsc4Foam/utils/petscUtils.C
View file @
36260ba7
...
...
@@ -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
);
...
...