dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #02815
uBlas Krylov solver and preconditioner
I've extended the uBlas Krylov solver so that it now works with
matrices of type uBlasKrylovMatrix, only defined by having two
functions size() and mult(). I had to make some minor changes to avoid
using axpy_prod() but the tests I made showed now reduction in
speed. (There is one extra copy of values into a vector compared to
the original code.)
I have temporarily disabled the preconditioning. See all comments
// FIXME: Preconditioner temporarily disabled
This was necessary since uBlasPreconditioner assumes uBlasSparseMatrix.
We need to make it so that it only assumes uBlasKrylovMatrix. Then we
can have a special subclass, like
class uBlasILUPreconditioner : public uBlasPreconditioner
or similarly. This class should then take in the constructor as
argument a uBlasSparseMatrix. Then we can overload solve()
uBlasKrylovSolver so we have two versions: one with and one without an
extra preconditioner argument.
I don't think it's possible to let the Krylov solver create a
preconditioner on its own since it only knows how to do mult(), that
is, it only knows that the matrix is uBlasKrylovMatrix. So it can't
create a preconditioner that assumes it can do M.assign(A).
Does that make sense?
/Anders
Follow ups