Shallow water equation; Numba compiled version differs from Vanilla evolution rate version #818
Unanswered
Jerry-Haoyu
asked this question in
Q&A
Replies: 1 comment
|
I unfortunately don't have time to help you implement specific equations, but if there is a difference between different implementations of the gradient that would be a good thing to report! Generally, all backends should give identical results (up to float point precision). |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi!
I'm solving a shallow water equation:

I implemented a vanilla solver in pypde and it worked perfectly:
https://github.com/user-attachments/assets/bdcde83d-7768-4436-bd09-60741b68c08e
The simulation, however, is quite slow so I tried the numba-compiled version. The result, however, is clearly wrong and vastly differs:
thermocline_numba.mp4
Here is the code:
I've also tried the
make_evolution_rate()approach which is quite similar, the same pathological behavior is observed; I think the problem is with the make_operator(); Some numerical experiment shows they actually differ in results with the naive python class method gradient of the classScalarField. Is this a known issue?Thanks a lot!
All reactions