Skip to content
Snippets Groups Projects
Commit 31aa53e3 authored by Simone Bnà's avatar Simone Bnà
Browse files

BUG: update ksp tol for (*)Final solvers

parent 296404d7
Branches
Tags
No related merge requests found
......@@ -182,13 +182,12 @@ Foam::solverPerformance Foam::petscSolver::solve
updateKsp(ksp, Amat, !ctx.caching.needsPrecondUpdate());
}
// Solver name from petsc dictionary
// Solver name from petsc
KSPType ksptype;
KSPGetType(ksp, &ksptype);
const word solverName
(
ksptype
// petscDict_.get<word>("solver")
);
// Use built-in residual norm computation
......@@ -200,7 +199,7 @@ Foam::solverPerformance Foam::petscSolver::solve
// Setup class containing solver performance data
solverPerformance solverPerf
(
"petsc-" + solverName,
"PETSc-" + solverName,
fieldName_
);
......@@ -280,6 +279,16 @@ void Foam::petscSolver::updateKsp
}
KSPSetOperators(ksp, Amat, Amat);
// update tolerance and relTol for the (*)Final solver
KSPSetTolerances
(
ksp,
relTol_,
tolerance_,
PETSC_DEFAULT,
maxIter_
);
}
......
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