-
Notifications
You must be signed in to change notification settings - Fork 154
Lees-Edwards boundary conditions for shear flow #2122
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
base: trunk-minor
Are you sure you want to change the base?
Conversation
Co-authored-by: Michael Howard <[email protected]>
Co-authored-by: Michael Howard <[email protected]>
Co-authored-by: Michael Howard <[email protected]>
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
Now that 5.4 is out, this is next on my list to review. I'll look at the proposed changes soon. |
|
Thanks! I’ve also asked Kwabena to merge up trunk-minor to keep this current. |
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.
Thanks @wkdarko! This looks good to me based on our internal rounds of review. I had a couple small requests below related to the fixes you pushed to the communicators, then I think it should be good to go from my side.
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.
Thanks! The code is clean and the changes are minimal.
I am concerned about the large number of minImage, wrap, and shift methods. Some return results, others modify references in place. To someone reading this code a year from now, it will not be clear what method is called. Could you add a suffix to the new methods to ameliorate this problem?
This PR is also missing a user interface to set the deformation rate and documentation of the feature in features.rst. We need to clearly document what classes in HOOMD-blue interoperate with the deformation rate and what ones do not. At this point, it is not clear to me whether that can be done in features.rst or if it needs to be mentioned in each class's documentation. Ideally, classes that don't support box deformations will raise an error when the deformation rate is non-zero.
Longer term (after this PR), you should add a tutorial to https://github.com/glotzerlab/hoomd-examples that shows users how to perform Lees-Edwards simulations.
The methods we added have the same argument / return types as the existing methods, so we thought overloading to include a velocity argument would be cleaner than appending a suffix. Would it be OK if we address this by expanding the doxygen documentation for the new methods? We can explain that they are used in the same way as the position-only methods but when the velocity also needs to be manipulated. Otherwise, we will need to go back through all the files in the diff manually to rename.
Yes, we are working on the user interface to do this in a separate PR! We were worried this one was getting too bulky. If you are OK with it, I think this PR could be merged as a temporarily undocumented feature because it doesn't change any behavior of existing code without an interface to set the deformation rates. (They are all zero by default.) @wkdarko left a comment on #2120 to ask about how it would be best to implement the deformation, and we would appreciate your feedback there before we proceed too far! Because of how we have modified the
Yes, definitely will do! |
|
|
||
| // apply periodic boundary conditions | ||
| dx = box.minImage(dx); | ||
| box.minImage(dx, dv); |
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.
@mphoward minImage is the method I was referring to that returns a value in two out of four overloads, but not in the other two. I understand that C++ lacks a natural syntax for multiple return value unpacking, so I don't have a better suggestion.
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.
Oh, I see what you mean. If you have a strong preference toward something like minImageWithVelocity(dx, dv) we can do that.
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.
No, I don't have a strong preference. Perhaps it is best to leave as is and expand the documentation as you suggest.
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.
I'll work with @wkdarko to expand this documentation to see if we can resolve it that way.
Yes, I would prefer everything in one PR. Reviewing the changes in batches is helpful.
Understood, I will move this discussion there. |
Description
This PR implements the Lees-Edwards boundary conditions for performing shear flow simulations.
Motivation and context
The implementation will allow users to simulate bulk rheology under full periodic boundary conditions.
How has this been tested?
Unit tests on box deformation methods were added.
Checklist:
sphinx-doc/credits.rst) in the pull request source branch.CHANGELOG.rstfollowing the established format.