Skip to content

Self-Gravity error: "Bicgstab:: beta is nan in step 2" #243

Answered by Anto6453
Anto6453 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @glesur,
The main problem I encountered with BICGSTAB is that during its iteration, the variable rho = ComputeDotProduct(res0, res) can become equal to zero, so that in the next step the variable beta = rho/rhoOld becomes nan.

When this happened, the solver would restart from a flat potential that was too far from the solution to converge correctly. I therefore followed the recommendation of this Lecture Note (ln07.pdf) which explains on page 6 that when rho becomes equal to (or very close to) zero, it is possible to set only res0 and dir to res (as when we initialize the solver) and continue the iteration without restarting the potential.

This works well enough in my case to avoid the…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Anto6453
Comment options

@glesur
Comment options

@glesur
Comment options

@Anto6453
Comment options

Answer selected by Anto6453
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants