Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inplace update? #21

Open
JianghuiDu opened this issue Oct 8, 2021 · 5 comments
Open

Inplace update? #21

JianghuiDu opened this issue Oct 8, 2021 · 5 comments

Comments

@JianghuiDu
Copy link

Is there a function to update the ILU preconditioner inplace?

@haampie
Copy link
Owner

haampie commented Oct 13, 2021

How do you mean exactly?

@JianghuiDu
Copy link
Author

If the preconditioner changes during iteration then you would want to preallocate the preconditioner and then do in place update later. The Preconditioners.jl package does this for AMG using UpdatePreconditioner!(p, A) where p is the preallocated preconditioner and A is the preconditioner matrix that will be updated during iteration. Same thing in package ILUZero where you update the preconditioner using ilu0!(LU, A) where preconditioner LU is preallocated.

Is the sparsity pattern of ILU constant with fixed drop tolerance? If yes then maybe it is possible to do in place update?

@haampie
Copy link
Owner

haampie commented Oct 13, 2021

Ah no, the sparsity pattern depends on the matrix entries, so preallocation is not applicable.

Although maybe it is possible to update using the same sparsity pattern later and just disregard the drop tolerance criterion then. But then the updated preconditioner is not the same one you would get from rerunning ilu on the new matrix. I don't think this functionality should be part of this package though, basically it would be doing an approximate LU within the fixed sparsity pattern generated ahead of time by this package.

@haampie
Copy link
Owner

haampie commented Oct 13, 2021

By the way, just noticed you are at ETH too, feel free to ping me on Slack (https://julialang.org/slack/) either in the #linear-algebra channel or direct message if you want to discuss your use case further

@JianghuiDu
Copy link
Author

Cool thank! I think the usage is rather common. When we solve nonlinear equations the Jacobian changes over iterations and the preconditioner should change with it. If we can't pre-allocate the preconditioner then it would take many memory allocations. Maybe that's the advantage of ILU(k) where you know the sparsity pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants