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

Add support for writing rigid bodies when converting to HOOMD formats. #850

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

chrisjonesBSU
Copy link
Contributor

@chrisjonesBSU chrisjonesBSU commented Sep 17, 2024

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:

  • handle cases where some molecules are rigid and others aren't
  • throw an error if rigid particle type is found in the topology already

@chrisjonesBSU chrisjonesBSU added core feature conversions conversions of GMSO to and from other format labels Sep 17, 2024
@chrisjonesBSU chrisjonesBSU linked an issue Sep 17, 2024 that may be closed by this pull request
@chrisjonesBSU chrisjonesBSU marked this pull request as ready for review September 26, 2024 16:21
@CalCraven
Copy link
Contributor

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?
https://hoomd-blue.readthedocs.io/en/v3.6.0/tutorial/06-Modelling-Rigid-Bodies/00-index.html

@chrisjonesBSU chrisjonesBSU changed the title Add rigid_id field to Atom and handle rigid bodies when converting to HOOMD formats. Add support for writing rigid bodies when converting to HOOMD formats. Oct 3, 2024
@CalCraven
Copy link
Contributor

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.

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.51%. Comparing base (c8c62ae) to head (4eaf697).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
gmso/external/convert_hoomd.py 96.15% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #850      +/-   ##
==========================================
- Coverage   94.07%   93.51%   -0.57%     
==========================================
  Files          65       65              
  Lines        6953     6998      +45     
==========================================
+ Hits         6541     6544       +3     
- Misses        412      454      +42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chrisjonesBSU
Copy link
Contributor Author

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.

I believe this is correctly implemented now, but I still need to test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conversions conversions of GMSO to and from other format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement rigid bodies for GSD writer.
2 participants