# custom preconditioner: how are they treated?

Asked by Nico Schlömer on 2013-04-16

For the sake of trying it out, I'd like to precondition my system with the mass matrix of the system. To this end, I did something along the lines of

solver = PETScKrylovSolver('gmres')
A_petsc = as_backend_type(A)
M_petsc = as_backend_type(M)
solver.set_operators(A_petsc, M_petsc)
b_petsc = as_backend_type(b)
phi_petsc = as_backend_type(phi.vector())
solver.solve(phi_petsc, b_petsc)

This tells Dolfin to solve the system

M^{-1} A x = M^{-1} b

-- right? How are the systems M^{-1} solved in each step?

## Question information

Language:
English Edit question
Status:
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
 Revision history for this message Garth Wells (garth-wells) said on 2013-04-22: #1

On 16 April 2013 23:21, Nico Schlömer
> New question #226857 on DOLFIN:
>
> For the sake of trying it out, I'd like to precondition my system with the mass matrix of the system. To this end, I did something along the lines of
>
> solver = PETScKrylovSolver('gmres')
> A_petsc = as_backend_type(A)
> M_petsc = as_backend_type(M)
> solver.set_operators(A_petsc, M_petsc)
> b_petsc = as_backend_type(b)
> phi_petsc = as_backend_type(phi.vector())
> solver.solve(phi_petsc, b_petsc)
>
> This tells Dolfin to solve the system
>
> M^{-1} A x = M^{-1} b
>
> -- right? How are the systems M^{-1} solved in each step?
>

It will use the default preconditioner for the chosen backend. I
believe that PETSc defaults to ILU in serial.

Take a look at the stoke-iterative demo to set the preconditioner.

Garth

> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.

 Revision history for this message Anders Logg (logg) said on 2013-05-09: #2

consult the documentation on the FEniCS web page for where and
how to (re)post your question: http://fenicsproject.org/support/

 Revision history for this message Anders Logg (logg) said on 2013-05-09: #3