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

Preconditioned Richardson Iteration linear solver #86

Closed
shreyas02 opened this issue Dec 18, 2024 · 4 comments
Closed

Preconditioned Richardson Iteration linear solver #86

shreyas02 opened this issue Dec 18, 2024 · 4 comments

Comments

@shreyas02
Copy link
Contributor

Hi @JordiManyer, I was wondering why the Preconditioned Richardson iteration solver is not there and only a Richardon smoother is there . I have been using the Preconditioned Richardson method. Perhaps we could add this to the library by creating a pull request?

@JordiManyer
Copy link
Member

JordiManyer commented Dec 18, 2024

Hi @shreyas02 this is covered by the LinearSolverFromSmoother solver. You can do

S = LinearSolverFromSmoother(smoother)

and it should work. It's not documented, nor tested. I want at some point to draw a clear distinction between smoothers and solvers, and have mappings between the two. This is a first step in that direction.

If you still think your PR brings something new, feel free to open it.

@shreyas02
Copy link
Contributor Author

Hi @JordiManyer,
Thanks, I had a look at the code. It seems we can't pass arguments such as the tolerance to the solver. It always performs maximum iterations. For a solver, that is not ideal. Should I open a PR to add arguments such as tolerance and logging?

I understand that this does not make sense for a smoother, so I was thinking of making this argument optional and default setting to 0. So when used as a smoother, it performs n iterations; when used as a solver, it performs iterations until the required tolerance is achieved.

Also, could you briefly explain the purpose of LinearSolverFromSmoother(smoother)? I see that this is used just for performance benefits by preallocating memory.

@JordiManyer
Copy link
Member

we can't pass arguments such as the tolerance to the solver

I see... I do not want any overhead in the smoothers if possible. Computing norms is relatively expensive in parallel. Considering this, I would prefer if you went ahead and implemented a RichardsonLinearSolver as proposed at the beginning.

Also, could you briefly explain the purpose of LinearSolverFromSmoother(smoother)? I see that this is used just for performance benefits by preallocating memory.

Its just to save lines of code. I just didn't want to maintain both the solver and the smoother. But I do understand that as a solver you probably want more control over the convergence. I overlooked that.

So yeah, go ahead and create a new LinearSolver. Tag me and I'll review the PR when it's done. Thank you very much!

@JordiManyer
Copy link
Member

Closed by #87

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