Commits (4)
......@@ -118,7 +118,7 @@ For more details, the user can read the paper [1].
|------|-------|-----------|
| Mark Olesen | ESI-OpenCFD | |
| Simone Bna | CINECA | simone.bna@cineca.it |
| Stefano Zampini | KAUST | |
| Stefano Zampini | KAUST | stefano.zampini@gmail.com |
----
......
......@@ -230,6 +230,9 @@ Foam::solverPerformance Foam::petscSolver::scalarSolve
fieldName_
);
// Retain copy of solverPerformance
ctx.performance = solverPerf;
// Create solution and rhs vectors for PETSc
// We could create these once, and call PlaceArray/ResetArray instead
PetscWrappedVector petsc_psi(psi, Amat);
......@@ -247,7 +250,7 @@ Foam::solverPerformance Foam::petscSolver::scalarSolve
if (usePetscResidualNorm)
{
// Add monitor to record initial residual
solverPerf.initialResidual() = 0;
ctx.performance.initialResidual() = 0;
KSPMonitorSet
(
ksp,
......@@ -293,22 +296,19 @@ Foam::solverPerformance Foam::petscSolver::scalarSolve
// Set nIterations and final residual
PetscInt nIters;
KSPGetIterationNumber(ksp, &nIters);
solverPerf.nIterations() = nIters;
ctx.performance.nIterations() = nIters;
if (usePetscResidualNorm)
{
PetscReal rnorm;
KSPGetResidualNorm(ksp, &rnorm);
solverPerf.finalResidual() = rnorm;
ctx.performance.finalResidual() = rnorm;
}
// Retain copy of solverPerformance
ctx.performance = solverPerf;
ctx.caching.eventEnd();
// Return solver performance to OpenFOAM
return solverPerf;
return ctx.performance;
}
......
......@@ -33,7 +33,8 @@ then
done
# Allclean, Allrun etc may not exist
for i in "$src"/All*
# OpenFOAM-1912 and earlier with geometry in tutorial (not as resource)
for i in "$src"/All* "$src/flange.ans"
do
if [ -f "$i" ]
then
......