Skip to content

Add preconditioner interface#405

Merged
pelesh merged 14 commits intodevelopfrom
kakeru/preconditioner-interface
Feb 1, 2026
Merged

Add preconditioner interface#405
pelesh merged 14 commits intodevelopfrom
kakeru/preconditioner-interface

Conversation

@KakeruUeda
Copy link
Collaborator

@KakeruUeda KakeruUeda commented Jan 30, 2026

Description

This adds a preconditioner base class and refactors SystemSolver to use it, removing the current coupling to LinSolverDirect and enabling custom preconditioner implementations.

Closes #114

cc @shakedregev

Proposed changes

Added a Preconditioner base class with the following methods:

  • setup()
  • apply() (calls the preconditioner)
  • reset() (for updated matrix values with the same sparsity pattern)

Checklist

  • All tests pass (make test and make test_install per testing instructions). Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • I have manually run the non-experimental examples and verified that residuals are close to machine precision. (In your build directory run:
    ./examples/<your_example>.exe -h to get instructions how to run examples). Code tested on:
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows Re::Solve style guidelines.
  • [N/A] There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

Further comments

@KakeruUeda KakeruUeda requested a review from pelesh January 30, 2026 20:48
@shakedregev
Copy link
Collaborator

@KakeruUeda - it seems some tests are not passing. I will wait before I review this.

@pelesh pelesh added the enhancement New feature or request label Jan 30, 2026
@pelesh pelesh added this to the Release 0.99.3 milestone Jan 30, 2026
@KakeruUeda KakeruUeda changed the title Kakeru/preconditioner interface Add preconditioner interface Jan 31, 2026
Copy link
Collaborator

@pelesh pelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean implementation consistent with the rest of the code. All tests pass.

@pelesh pelesh merged commit 0e45561 into develop Feb 1, 2026
6 checks passed
@KakeruUeda KakeruUeda deleted the kakeru/preconditioner-interface branch February 2, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a preconditioner interface class.

3 participants