SciML / LinearSolve.jl

LinearSolve.jl: High-Performance Unified Interface for Linear Solvers in Julia. Easily switch between factorization and Krylov methods, add preconditioners, and all in one interface.
https://docs.sciml.ai/LinearSolve/stable/
Other
244 stars 52 forks source link

Strategy with precs ? #529

Open j-fu opened 3 weeks ago

j-fu commented 3 weeks ago

Question❓

What is should be the strategy with implementing precs ? The pattern I like is:

struct ILUZero_ILU0 end

function (::ILUZero_ILU0)(A, p=nothing)
    (ilu0(sparse(A)),I)
end

so we can have a solver like KrylovJL_CG(precs=ILUZero_ILU0()) etc. Where this implementation should live ?

a) Due to the fact that this implementation does not depend on LinearSolve, it could become part of the respectve preconditioning packages. So should we go and make PRs there ?

b) Or do you plan to have Package extensions for LinearSolve ?

I find a) quite intriguing...

oscardssmith commented 3 weeks ago

I think for now, it belongs in the preconditioner package, but they could also belong as package extensions. Both approaches seem to work to me, and I don't think either has a hidden downside.