Thank you guys!!!
I have found deprecated module which is exactly what I am looking for initialization of random particle positions. But now there is error in my cell list that I cannot figure out.
The code is the following
import hoomd
import hoomd.md
import hoomd.deprecated
#import hoomd.hpmc
#import ex_render
hoomd.context.initialize('');
#hoomd.init.create_lattice(unitcell=hoomd.lattice.sq(a=2.0), n=10);
#initialise random particles
hoomd.deprecated.init.create_random(N=1000, phi_p=0.5,name='A', min_dist=0.7)
all = hoomd.group.all();
#dump data for the visulaisation
d = hoomd.dump.gsd("trajectory.gsd", period=10, group=all, overwrite=True);
# setup pair potential inbetween particles
nl = hoomd.md.nlist.cell();
lj = hoomd.md.pair.lj(r_cut=2.0, nlist=nl)
lj.pair_coeff.set('A','A', epsilon=0.25, sigma=2, alpha=0, r_cut=2.0);
# setup forces, integrators and run simulation
hoomd.md.integrate.mode_standard(dt=0.001);
hoomd.md.integrate.brownian(group=all, kT=1,seed=250);
hoomd.run(2e4);
The ERROR Is
** starting run **
**ERROR**: Particle with unique tag 856 is no longer in the simulation box.
**ERROR**: Cartesian coordinates:
**ERROR**: x: -302.26 y: -48.2951 z: -147.622
**ERROR**: Fractional coordinates:
**ERROR**: f.x: -29.2649 f.y: -4.25583 f.z: -14.037
**ERROR**: Local box lo: (-5.07746, -5.07746, -5.07746)
**ERROR**: hi: (5.07746, 5.07746, 5.07746)
Traceback (most recent call last):
File "test2.py", line 18, in <module>
hoomd.run(2e4);
File "/home/alan/miniconda3/lib/python3.6/site-packages/hoomd/__init__.py", line 194, in run
context.current.system.run(int(tsteps), callback_period, callback, limit_hours, int(limit_multiple));
RuntimeError: Error computing cell list
Can you provide some insights into what I am doing wrong and how to sort it out?
Thanks
Alan