How to remove bonds in between runs

28 views
Skip to first unread message

Bernardo Zubillaga Herrera

unread,
May 21, 2023, 1:06:14 AM5/21/23
to hoomd-users
Hi all,

I am relatively new to Hoomd and would be very grateful if your could help me with something.

I am simulating a polymer with Hoomd 2.9.7.
It is a linear string/sequence of beads with bonds between each pair of successive beads.

I am interested in simulating a polymer the following way:
1) Remove a handful of bonds in the polymer chain
2) Run Langevin dynamics for some time
3) Take current state of the polymer and remove a few more bonds
4) Run Langevin dynamics starting from the last state with bonds removed
and so on and so for for many iterations.

basically, remove bonds, evolve in time, remove bonds, evolve in time, etc.

I am attempting to remove the bonds in between the successive runs by taking a snapshot of the system:

a) snapshot = system.take_snapshot(all=True)

and then changing/updating the number of bonds, angles, etc.:
b) snapshot.bonds.resize = new number of bonds after removal
c) snapshot.bonds.group = new list of bonds after removal of bonds
d) snapshot.angles.group = new list of angles after removal of bonds

then:
e) system.restore_snapshot(snapshot)

this is followed by running the Langevin integrator.

f) hoomd.md.integrate.mode_standard(dt=0.001);
g) integrator = hoomd.md.integrate.langevin(group = all, kT = 10, seed=11726)
e) integrator.set_gamma('CA', gamma=1)

f) hoomd.run(nsteps)
 g) integrator.disable()

and then running the same procedure over and over again, removing bonds and evolving in time with langevin dynamics.

I want to print the trajectory of the whole process as a gsd file
hoomd.dump.gsd('traj.gsd', overwrite=True,  period=1000, group=all, phase=0)

I want the gsd trajectory of the whole process to reflect the succesive bond removals in between runs

Is this the best way to go about it?
What would you suggest?

Thank you very much for your help and feedback with this.

Bernardo

Reply all
Reply to author
Forward
0 new messages