The bond and different particle type settings.

146 views
Skip to first unread message

Yang Wang

unread,
Mar 2, 2021, 8:51:35 AM3/2/21
to hoomd-users
Dear all, 
     I want to do a FENE simulation with 5 polymer1 and 5 polymer2 as shown in the figure, each of them has a different particle type located at the end of the chain. 
     In my opinion,  I should set 6 pair interactions between A-A, B-B, C-C, A-B, A-C, B-C, and  3 bonded potentials between A-B, B-B, and B-C. What's more, if I want to simulate the bond_swap between type A and C by using 'hoomd.md.many_body.RevCross', I also should set RevCross between A and C.
   But the question is, I read a gsd file generated from OVITO, how should I set bond information? And in the second figure below, what does the 'polymer' and 'backbone' mean?
       Here is my script, could anybody give me some advice?
Thanks.

integrator = hoomd.md.Integrator(dt=0.005);
cell = hoomd.md.nlist.Cell();

harmonic = hoomd.md.bond.Harmonic()
harmonic.params['polymer'] = dict(k=3.0, r0=2.38)
harmonic.params['backbone'] = dict(k=10.0, r0=1.0)

lj = hoomd.md.pair.LJ(nlist=cell);
lj.params[('A', 'A')] = dict(epsilon=1, sigma=1);
lj.params[('B', 'B')] = dict(epsilon=1, sigma=1);
lj.params[('C', 'C')] = dict(epsilon=1, sigma=1);
lj.params[('A', 'B')] = dict(epsilon=1, sigma=1);
lj.params[('A', 'C')] = dict(epsilon=1, sigma=1);
lj.params[('B', 'C')] = dict(epsilon=1, sigma=1);
lj.r_cut[('A', 'A')]  = 3.0;
lj.r_cut[('B', 'B')]  = 3.0;
lj.r_cut[('C', 'C')]  = 3.0;
lj.r_cut[('A', 'B')]  = 3.0;
lj.r_cut[('A', 'C')]  = 3.0;
lj.r_cut[('B', 'C')]  = 3.0;

bond_swap = hoomd.md.many_body.RevCross(r_cut=1.3,nlist=cell);
bond_swap.params[(['A','C'],['A','C'])] = dict(sigma=0,n=0,epsilon=0,lambda3=0);
# a bond can be made only between A-B and not A-A or B-B;
bond_swap.params[('A','C')] = dict(sigma=1,n=100,epsilon=10,lambda3=1);
integrator.forces.append(lj);
integrator.forces.append(harmonic);
integrator.forces.append(bond_swap);
#npt = hoomd.md.methods.NPT(filter=hoomd.filter.All(), tau=1.0, kT=0.65, tauS = 1.2, couple = "all", S=2.0);
nvt=hoomd.md.methods.NVT(filter=hoomd.filter.All(), kT=1.0, tau=0.5)
integrator.methods.append(nvt);
print("dt:", integrator.dt);
print("methods:", integrator.methods[:]);
print("forces:", integrator.forces[:]);

cpu = hoomd.device.CPU();
sim = hoomd.Simulation(device=cpu);
sim.create_state_from_gsd(filename='My_Polymer.gsd');

sim.operations.integrator = integrator;

gsd = hoomd.write.GSD(filename='Wangyang.gsd',
                      trigger=hoomd.trigger.Periodic(100),
                      mode='wb')
sim.operations.writers.append(gsd)
sim.run(60000)
print('All Done')

After that, an ERROR occurred:
**ERROR**: Particle with unique tag 395 is no longer in the simulation box.

Cartesian coordinates: 
x: 7.95728e+43 y: 1.00558e+43 z: -4.35941e+43
Fractional coordinates: 
f.x: 1.07632e+43 f.y: 1.36017e+42 f.z: -5.89664e+42
Local box lo: (-3.69652, -3.69652, -3.69652)
          hi: (3.69652, 3.69652, 3.69652)

 1cbcdab478f6975bf5a40be27b574a3.png
1614693070(1).jpg

Joshua Anderson

unread,
Mar 3, 2021, 11:47:04 AM3/3/21
to hoomd...@googlegroups.com
Yang,

You need to specify the bonded pairs of particles and the corresponding type for each bond in the GSD file: https://gsd.readthedocs.io/en/stable/python-module-gsd.hoomd.html#gsd.hoomd.BondData

I do not know how to do this with OVITO, you should consult the OVITO documentation or ask on OVITO support channels.

'polymer' and 'backbone' are bond type names. You can name your bond types as you please in your gsd file. You will need to set bond parameters for every bond type present.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
> <1cbcdab478f6975bf5a40be27b574a3.png>
> <1614693070(1).jpg>
>
> --
> You received this message because you are subscribed to the Google Groups "hoomd-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/787ea6dc-cc08-4655-89a1-4dbc61917686n%40googlegroups.com.
> <1614693070(1).jpg><1cbcdab478f6975bf5a40be27b574a3.png>

Reply all
Reply to author
Forward
0 new messages