Skip to content

Unified handling of preconditoners and factorizations ? #308

Closed
@j-fu

Description

@j-fu

Hi,

I see that 2.0 is underway, so this may be an occasion to have some discussion about the API. The current API handles preconditioners and direct solvers very differently. IMHO they both are (possibly incomplete) factorizations and could be handeled in a similar way.

OTOH, the current API puts UMFPACKFactorization() and the like and iterative solvers into one basket which seems to be not very logical to me either.

So my view is the following:

  • A complete factorization provides a solver: Pardiso, Umfpack, KLU, Cholesky etc.

  • whereas an approximate factorization provides a preconditioner:
    ILU0, Jacobi, AlgebraicMultigrid etc.

Iterative algorithms are CG, GMRES etc. Direct solution essentially corresponds to a "OneStep" algorithm which works together with a complete factorization aka solver.

In that sense, a solve API could look as follows:

solve(P::LinearProblem, F::Factorization, I::Iteration)

and one could have something like

solve(P::LinearProblem, F::Factorization)= solve(P,F,OneStep())

(with a possible warning that an incomplete factorization doesn't solve)

As factorization one would provide a preconditioner constructor instead of a the preconditioner itself. So we could have

solve(p, KLUFactorization())
solve(p, ILU0Factorization(), CG())

Repeated solve after updating the matrix could update the preconditioner in a similar way as a factorization.

May be this proposal comes too late or doesn't fit for some other reasons, I can live either way (and already coded around this...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions