Update block preconditioning#79
Merged
Merged
Conversation
The way it was structured still used old ideas from ExtendableSparse preconditioning. Without breaking (due to being not exported anymore), we can implement this in a much clearer and simple way.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors and extends the block-preconditioning implementation by moving core preconditioner implementations into a new src/preconditioners.jl, adding block-size support to JacobiPreconBuilder, and updating tests to exercise the new/updated behavior. It also bumps the package version and records the changes in the changelog.
Changes:
- Introduce
src/preconditioners.jlwithJacobiPreconditioner,BlockPreconditioner, and related utilities (allow_views,pointblock,ILU0BlockPrecon,ProductPreconditioner). - Update
JacobiPreconBuilderto acceptblocksize, and adjust ILU block preconditioning to use the movedILU0BlockPrecon/pointblock. - Expand/adjust tests to cover block preconditioning variants (including Jacobi blocksize variants) and bump version/changelog.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
test/test_linearsolve.jl |
Adds Jacobi precon builders (incl. blocksize) and updates the block-preconditioning test setup. |
test/test_block.jl |
Updates tests to use JacobiPreconditioner and the new factorizations API, adds additional block-preconditioning comparisons. |
src/preconditioners.jl |
New file defining core preconditioners (Jacobi, block, product) and block utilities. |
src/preconbuilders.jl |
Removes inlined preconditioner implementations; adds JacobiPreconBuilder(blocksize) and uses moved core types. |
src/ExtendableSparse.jl |
Includes the new preconditioners.jl file. |
Project.toml |
Bumps version to 2.4.0. |
CHANGELOG.md |
Adds a 2.4.0 entry describing the changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+151
to
+153
| if nall != n | ||
| @error "BlockPreconditioner: sum(length,partitioning)=$(nall) but n=$(n)" | ||
| end |
Comment on lines
+113
to
116
| N = n^2 | ||
| partitioning = [i:blocksize:(n^2) for i in 1:blocksize ] | ||
| sol0 = ones(n^2) | ||
| b = A * ones(n^2) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.