Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to solve Ax=b, but I realize that even if it is sparse, storing the matrix coefficients of my problem will take too much memory. So now I'm considering using a matrix-free method, because the same coefficients appear a lot of time in the matrix, so I could use my own private storage scheme (and increase cache efficiency by the way).

I'm looking at petsc, which provides interface for such matrix-free linear operators, but what I don't really understand, is how the preconditioner is then computed by petsc ? Or should I provide my own preconditioner ? If so, are there tools or recipies available to construct preconditioner from a matrix-free linear operator ?

More information about my operator: it is unsymmetric, not diagonally dominant, but dominated by a few sidebands (but it is not banded diagonal either)

share|improve this question
up vote 3 down vote accepted

You'll need to roll your own preconditioner. If you know the matrix, it should not be terribly difficult to implement something like an SSOR preconditioner, for example. If you know something else about the problem, for example that it comes from a PDE whose solution can be well approximated on a coarser mesh, then you can also consider constructing preconditioners by restricting the problem to the coarser mesh, solving there, and extending the solution back out to the original one. Restriction and prolongation can be implemented as matrix-free operations.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.