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
[bug] Fix stable fluid BFECC advection #1764
[bug] Fix stable fluid BFECC advection #1764
Conversation
…d return to use jacobii_single
Codecov Report
@@ Coverage Diff @@
## master #1764 +/- ##
==========================================
- Coverage 43.42% 42.58% -0.85%
==========================================
Files 44 44
Lines 6010 6185 +175
Branches 1041 1072 +31
==========================================
+ Hits 2610 2634 +24
- Misses 3249 3397 +148
- Partials 151 154 +3
Continue to review full report at Codecov.
|
intermedia_qf[i, j] = bilerp(qf, p) | ||
|
||
ti.cache_read_only(intermedia_qf, qf, vf) | ||
for i, j in vf: |
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.
Is the key problem about separating bfecc to two offload?
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.
Yes. To be more precise, we need a forward advection (backtrack + interpolate) to get an inter-media quantity field first, then a backward advection to (backtrace in -dt direction + interpolate) to get the field at the original time stamp (assuming there is no error). Finally, we got the error and fix the inter-media field.
Since for the second one (backward advection) we need the whole inter-media field ready, it's necessary to run it in a separate another loop and store it already.
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.
But to be noticed, jacobbi_dual
caused serious artifacts with the new bfecc
.
I will post detailed comparisons between combination of different methods when I get a minute.
Co-authored-by: 彭于斌 <1931127624@qq.com>
This is super interesting~@archibate |
Thanks for all the hard work here! I think I found the reason now. |
After fixing the irrigating Will organize and make it ready for review |
examples/stable_fluid.py
Outdated
@@ -326,6 +338,9 @@ def reset(): | |||
dyes_pair.cur.fill(0) | |||
|
|||
|
|||
v_mngr = ti.VideoManager('./', framerate=24, automatic_build=False) | |||
|
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.
examples/stable_fluid.py
Outdated
@@ -326,6 +338,9 @@ def reset(): | |||
dyes_pair.cur.fill(0) | |||
|
|||
|
|||
v_mngr = ti.VideoManager('./', framerate=24, automatic_build=False) | |||
|
|||
|
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.
Please do not use |
Related issue = #1757
In this PR I plan to fix the BFECC advection in
stable_fluid.py
. Seems that there are several problems tangled inside this one. So let's try to solve them one-by-one. I may need your @yuanming-hu and @archibate help to review if the errors are from the BFECC or the PPE solving. Thanks a lot,jacobi_single
.advect_bfecc
function.int()
(withmath.floor()
) which irritates when input is negative[Click here for the format server]