-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fix LBGPU velocity interpolation close to boundary #3593
Fix LBGPU velocity interpolation close to boundary #3593
Conversation
Codecov Report
@@ Coverage Diff @@
## python #3593 +/- ##
=======================================
+ Coverage 88% 88% +<1%
=======================================
Files 527 527
Lines 23572 23572
=======================================
+ Hits 20755 20761 +6
+ Misses 2817 2811 -6
Continue to review full report at Codecov.
|
testsuite/python/lb_interpolation.py
Outdated
# np.testing.assert_almost_equal(self.lbf.get_interpolated_velocity(pos)[2], 0.0) | ||
# Check interpolated vel at upper boundary. The node position is at | ||
# box_l[0]-agrid/2. | ||
np.testing.assert_allclose(self.lbf.get_interpolated_velocity( |
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.
do we need to guard the result of get_interpolated_velocity
with np.copy()
?
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.
We let the CI decide.
Did you figure out the source of the error |
I don't understand the larger error for the clang:6.0 and cuda 9 images. On my machine, (and apparently on the cuda 10 container), the accuracy is much better. Atol=1E-10 worked locally. I'm increasing the tolerance for now, because the result is still much better than the one with the missing prefactor without this PR. But I don't understand why that should be needed. |
Co-Authored-By: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
Co-Authored-By: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
210b513
to
b426d5c
Compare
Accuracy reduction was caused by an unintended parameter change (TAU) which I reverted now. still don't understand the platform-dependence, now. |
Seems to be working now. Could you please revert the |
I added the print stuff on purpose, just like in the LB test. Since the error message output from the Mach limit test cannot be supressed, the output of the test is confusing without the new print.
W.r. to squashing I already eliminated the merge commit. couldn’t you cherry-pick the commit range with a current git. The frequent context switches for revisiting PRs impedes my science work too much, currently.
|
is the boundary velocity stored in MD units? The correct fix would be to store it in LB units and not adding this unit conversion in the LB code. This should be reverted. |
is the boundary velocity stored in MD units? The correct fix would be to store it in LB units and not adding this unit conversion in the LB code. This should be reverted.
Apparantly it is in LBGPU. I find the boundary code to be rather ‘write-only’ and the LBGPU is to be replaced anyway, so I did not make an attempt at cleaning things up.
For Walberla, we use the same units everywhere, obviously.
|
all right |
Fixes # Description of changes: LB GPu velocity interpolation used incorrect velocities at boundary nodes. This lead to incorrect resutls for interpolations closer than one lattice constant to the boundary. This adds a missing unit conversion 1/lattice_speed for boundary nodes, which fixes the issue. Tests for interpolation at the boundary position and at the mid-point between the boundary and the next lattice site. This should go into 4.1.3
Fixes #
Description of changes:
LB GPu velocity interpolation used incorrect velocities at boundary nodes. This lead to incorrect resutls for interpolations closer than one lattice constant to the boundary.
This adds a missing unit conversion 1/lattice_speed for boundary nodes, which fixes the issue.
Tests for interpolation at the boundary position and at the mid-point between the boundary and the next lattice site.
This should go into 4.1.3