--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To post to this group, send email to hoomd...@googlegroups.com.
To unsubscribe from this group, send email to hoomd-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hoomd-users?hl=en.
Adding a way to create and change bonds within python is one of the last things on the TODO list for the soon to be released 0.9.2. No promises on when I'll get to working on it though. It actually requires some subtle changes throughout the data structures, as I need to provide some way for you to name your bond types.
Your best option right now is to not use init.create_empty and instead write a python script that outputs an XML file and then use init.read_xml.
unofficially, the following lines of code might work you but they might not, I offer no guarantee (i.e., I haven't tested them). They may also fail to work with the next version of hoomd. Plus, I don't even have a clue what the bond type gets named if you do this - it could end up being uninitialized memory.
init.create_empty(N=whatever, box=(x,y,z), n_bond_types=1)
globals.system_definition.getBondData().addBond(hoomd.Bond(0, i, j))
# should add a bond between particles i and j
--------
Joshua A. Anderson, Ph.D.
Chemical Engineering Department, University of Michigan