-
Notifications
You must be signed in to change notification settings - Fork 2
Support for non square boxes in DPStokes #57
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
Conversation
|
✅ Linter reported no issues All Python files are correctly formatted with Black. |
|
✅ Linter reported no issues All C/C++ files are correctly formatted with clang-format. |
|
@rykerfish do you have the bandwidth to take a look at this to add some additional tests? |
|
I made some time to look at it today. I tinkered around with using the reference datasets from the wall tests as another set of tests, but I don't think it's possible/a good idea since the reference domain size is roughly @RaulPPelaez something of note- your test for I tried to fix it here, but if anything I think I made it worse since now the test seems to randomly fail in both x and y. I may have set the z-radius incorrectly, though. Do you think it's correct to somehow modify the kernel parameters? |
|
Two other things that might've caused my fix to go wrong:
|
The way to do this is to choose beta, etc, using the smallest h. You get slightly more accuracy in one direction, but the kernel is not asymmetric.
I cannot remember -.-, the BM kernel is defined here: https://github.com/RaulPPelaez/UAMMD/blob/01cd9d175aadf296603989a1f4a3bbd65ccc0329/src/misc/IBM_kernels.cuh#L83-L113
That is strange that it fails for you and not for me. I have not run the test since I wrote it in this repo, though. But it was passing then. I can see things being weird when hx!=hy the way I left things. |
|
I added a test to check that a particle responds the same when the domain is extended in x and y. It fails with the BM kernel as it currently is, but passes if you modify I'll need to modify and test the changes in UAMMD for torques as well if this is the change we want. |
|
That makes total sense, and your implementation looks correct. Let's merge RaulPPelaez/UAMMD#62 |
|
I have a somewhat insane-sounding bug. With the test how you left it, I will get random test failures. More particles makes it more likely to fail, but it will pass sometimes. The max absolute error is usually between 1e-2 and 1e-3. I've tracked it down to it being related to the number of grid points. Since we double the domain we'd expect double the number of grid points, but this is not always the case. With the parameters as-is (which uses Is this something you're concerned by? It may just be what we get from the FFT grids and, in the bad case, is still around the error threshold that DPStokes is designed to provide. This explains the random failures I was experiencing. I'm running the UAMMD tests as we speak and will let you know on the other PR once they finish! |
|
When DPStokes chooses the number of grid points, it takes into account FFT-friendlyness. That means that doubling the size in one direction can result in a different cell size, h. You get different results perhaps because h is related to the width of the kernel and then to the hydrodynamic radius, so you are comparing systems with slightly differently sized particles. Now, is that change in hydrodynamic radius ok? I just cannot give you an answer -.- If I am correct, if you increase the accuracy (by using a larger support, etc) the effect would vanish. |
…each direction (x,y,z) for the DPStokes kernels.
|
@RaulPPelaez I think this is done with two caveats. First is that we'll need to merge this PR into UAMMD and bump the version here. Second is that I kinda trashed the initialization of DPStokes while working in the beta initialization. I'm happy to rewrite it to be cleaner, just didn't get to it today and wanted to put the working code online for you to look at. Take a look at the tests in tests_dpstokes.py. I think they're pretty thorough. |
|
You should be able to set v3.0.0 as the UAMMD version now. |
rykerfish
left a comment
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.
Looks good to me aside from the comments I made. I'm inclined to create issues for anything outstanding that doesn't have to do with non-square domains and handle them in new PRs.



I addressed a warning about non square boxes in DPStokes. I added a test to check all is fine.
I also added similar tests to UAMMD regarding this.