Add methods for retreiving number of iterations and residual norm from KSM linear solvers #185
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.
In my nonlinear solver, I wanted to be able to check the final residual and the number of iterations from each linear solve (e.g to decide whether the preconditioner needs to be updated), this PR adds this functionality for all solvers that inherit from
TACSKsm
PR Summary:
iterCount
andresNorm
attributes to the abstractTACSKsm
class,iterCount
is the total number of iterations taken for the last linear solve andresNorm
is the residual norm from the end of the last linear solve.TACSKsm
that initialisesiterCount
andresNorm
to 0iterCount
andresNorm
toTACSKsm
and their python interfacesiterCount
andresNorm
to the end of thesolve
methods of thePCG
,GMRES
andGCROT
classes that inherit fromTACSKsm
iterCount
andresNorm
toStaticTestCase.test_solve
Closes #4