From: prill Date: Tue, 22 May 2007 10:05:55 +0000 (+0000) Subject: SolverControl fix for PETSc Richardson method. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d46eff94eb0b92dd068090473dcee2f25d8fcff;p=dealii-svn.git SolverControl fix for PETSc Richardson method. git-svn-id: https://svn.dealii.org/trunk@14686 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/petsc_solver.cc b/deal.II/lac/source/petsc_solver.cc index 59d2f97d71..36102d81e0 100644 --- a/deal.II/lac/source/petsc_solver.cc +++ b/deal.II/lac/source/petsc_solver.cc @@ -290,6 +290,22 @@ namespace PETScWrappers // honor the initial guess in the // solution vector. do so here as well: KSPSetInitialGuessNonzero (ksp, PETSC_TRUE); + + // Hand over the absolute + // tolerance and the maximum + // iteration number to the PETSc + // convergence criterion. The + // custom deal.II SolverControl + // object is ignored by the PETSc + // Richardson method (when no + // PETSc monitoring is present), + // since in this case PETSc + // uses a faster version of + // the Richardson iteration, + // where no residual is + // available. + KSPSetTolerances(ksp, PETSC_DEFAULT, this->solver_control.tolerance(), + PETSC_DEFAULT, this->solver_control.max_steps()); }