Skip to content
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

Feature request: wrap function when wrapped=False in space.periodic and space.periodic_general #82

Open
cpgoodri opened this issue May 6, 2020 · 0 comments

Comments

@cpgoodri
Copy link
Contributor

cpgoodri commented May 6, 2020

When passing wrapped=False to the periodic space functions, it seems that in addition to displacement and shift, it is important to define a third function that allows the user to put the particles back in the box. A typical use case would be to use unwrapped positions during a simulation because they are (presumably) faster, and then do something like R = wrap(state.position) to get the final positions. My thinking is that there are two options for the api:

option 1:
displacement, shift = space.periodic(L)
displacement, shift, wrap = space.periodic(L, wrapped=False)

option 2:
displacement, shift = space.periodic(L)
displacement, shift = space.periodic(L, wrapped=False)
displacement, shift, wrap = space.periodic(L, wrapped=False, wrap_function=True)

The second option might be preferable since it would be backwards compatible. I would be happy to take a first shot at this if that would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant