-
Notifications
You must be signed in to change notification settings - Fork 8
Issue # 376: Incorporating initial guess into residuals for iterative solvers #378
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase, follow ReSolve guidelines, and remove binary files.
b80efd6 to
430b5c1
Compare
|
This rebase is not correct.
If you touched very few files, it probably makes the most sense to just make a new branch off |
|
Hello Shaked, apologies for not following the right steps. I will delete this branch and I will make a new branch off develop and apply the changes to the iterative methods. |
Description
The solution from the direct solve is treated as the initial guess. The iterative solvers are set up to compute an update. If the update plus the initial guess is offering a better estimation to the solution than the initial guess, then we return that quantity. If the initial residual is greater than the norm of the rhs, we assert that the initial guess is a poor choice.
_Closes # 376
_Mentions @shakedregev
Proposed changes
The changes have been implemented within the solve member of the class. During the pre-processing, we setup two new vectors vec_R_ and vec_Y_. The vector vec_R_ is the intial residual, whereas vec_Y_ contains our update (it is set to zero before the start of the FGMRES loop). These new vectors are essential replacing the rhs and the direct solution x from previous implementations. The main loop is largely the same, except we replace all references to x with vec_Y_ instead. After the loop we add the update to the initial guess, making sure to overwrite the update. The residual from this quantity is used to overwrite vec_R_. The norm of the new vec_R_ is computed and compared with the initial residual norm (saved during the pre-processing) and then the decision to overwrite x is made.
Checklist
Put an
xin the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask. We're here
to help! This is simply a reminder of what we are going to look for before
merging your code.
-Wall -Wpedantic -Wconversion -Wextra.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining
why you chose the solution you did and what alternatives you considered, etc.