mbuild icon indicating copy to clipboard operation
mbuild copied to clipboard

Rigid Body Types

Open mikemhenry opened this issue 7 years ago • 1 comments

I'm playing around with rigid bodies in preparation to work on a hoomdxml reader that will understand rigid bodies using the old hoomd1.3.x syntax.

I have a pretty good idea on what I need to do for the reader to work, but there is one issue. I need another xml field that labels the rigid 'type', something like:

<rbody_type>
0 A
1 A
3 A
4 A
5 B
</rbody_type>

Would represent a system where rigid bodies 0-4 are the same type, and rigid body 5 is a different type.

The 'easy' way of handling this is requiring a user to provide a type/label to label_rigid_bodies(). The harder way would be for mbuild to check to see if the rigid bodies are the same, but checking if two graphs are isomorphic is an expensive calculation.

If this sounds sensible, it is something I'm willing to work on.

mikemhenry avatar Mar 29 '17 16:03 mikemhenry

It looks like the rigid body types that will be needed in the XML file are essentially the same as the compound names that are provided to label_rigid_bodies() via the discrete_bodies argument, so we might be able to store those body names in an attribute. Although I can foresee some issues with this, e.g. constructing a rigid body from parts that are already labelled as rigid, such as in this unit test.

Computational cost aside, I think checking the isomorphism of the graphs is probably the more elegant approach here. It might be best to try this out first, and if this slows things down too much we can take a different approach.

summeraz avatar Mar 29 '17 16:03 summeraz

This is probably a bit outdated with the new HOOMD release + probably more relevant for GMSO

daico007 avatar Apr 04 '24 02:04 daico007