-
Notifications
You must be signed in to change notification settings - Fork 36
Add support for writing rigid bodies when converting to HOOMD formats. #850
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
for more information, see https://pre-commit.ci
A remaining question to figure out: What if only some molecules are rigid in a hoomd simulation? How does the list of rigid body indices change? |
rigid_id
field to Atom
and handle rigid bodies when converting to HOOMD formats.
Was playing around with the rigid bodies in HOOMD. Got a working simulation with some rigid particles and some non-rigid particles. Looks like the body argument, shown now in line, get's a tag of -1 if the particle is not rigid. The rigid particles get the rigid ID for that particle, and the rigid COM particle, named "dimer" here, also get's that same ID. |
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.
Mostly a bunch of doc string suggestions.
We should add a test also checking for the error that comes up when an mBuild object is generated with rigid molecules at the back of the compound list, where the snapshot rigid stuff will fail. Maybe we can write a descriptive error for that case to catch. |
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.
This LGTM! Should be ready to merge
|
||
return gsd_snapshot, base_units | ||
if rigid_info: | ||
return gsd_snapshot, base_units, rigid_info |
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.
Let's be sure to raise this issue, maybe we could make a new GMSO issue for breaking changes that we should start collating.
I'm just going to add a check for the hierarchy ordering of rigid and non-rigid, then it should be good to go. |
rigid IDs are
ints
assigned to particles/atoms that signal which rigid body they belong to which is needed when recording rigid body information in HOOMD Frames and/or GSD files. The mBuild hoomd writers handled this, but we still need to implement them here.In mBuild, rigid_id is a property at the particle level, so we can treat it the same here, at the site level.
This is a draft for now. Remaining TODOs are: