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

Test conjugate gradient for pressure solve #71

Open
JamieJQuinn opened this issue Dec 17, 2021 · 1 comment
Open

Test conjugate gradient for pressure solve #71

JamieJQuinn opened this issue Dec 17, 2021 · 1 comment

Comments

@JamieJQuinn
Copy link

From what I can tell, the code looks like it's using Jacobi or Gauss-Seidel methods for solving the divergence <-> pressure Laplace equation. I presume Jacobi because that's what's in the GPU gems reference.

At any rate, I implemented a very similar algorithm in Python but replacing the Jacobi solver with a conjugate gradient solver and found the conjugate gradient method to converge to an error of something like 1e-6 in only about 3 iterations. This is compared to >100 iterations to achieve a similar error using the Jacobi method.

My expectation is that WebGL-FS could also benefit from using the conjugate gradient method and so I'm suggesting testing it keeping in mind the following caveats:

  • My code also included two Laplace solves in the diffusion step which isn't in WebGL-FS so the solver won't be as much of a bottleneck.
  • I know the default # of Jacobi iterations is only 20 so it's not obvious that the conjugate-gradient solver would be faster
  • The conjugate-gradient is also a fair bit more complicated to implement
  • The pressure solve was one of the slowest parts of my code, that may not be true for WebGL-FS
@MiracleCK
Copy link

MiracleCK commented Dec 17, 2021 via email

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