I have an external file that contains, e.g., 100 atom positions (x,y,z). How can I impose that subsequent sets of ten coordinates consitute a single rigid body, i.e. ten rigid bodies build of ten atoms each?
How about writing a small script/program that converts the file into a data file for atom style molecular or atom style full? Then you can assign a different molecule ID to each rigid body and use the molecule option of fix rigid or fix rigid/small to create the rigid bodies.
For your (and others that stumble upon this post) reference here is minimal example with 4 atoms forming two rigid bodies:
data file (rigid.data):
# demo rigid body data file. Use atom style molecular
2 atom types
4 atoms
# box dimensions
-5.0 5.0 xlo xhi
-5.0 5.0 ylo yhi
-5.0 5.0 zlo zhi
Atoms # molecular
# atom-ID mol-ID type x y z
1 1 1 -3.0 -1.0 0.0
2 1 2 -3.0 1.0 0.0
3 2 2 3.0 -1.0 0.0
4 2 1 3.0 1.0 0.0
Input for for periodic boundaries, repulsive-only LJ potential in reduced units
units lj
atom_style molecular
pair_style lj/cut 3.0
read_data rigid.data
mass 1 1.0
mass 2 5.0
# repulsive only LJ potential
pair_coeff 1 1 1.0 1.0 $(2.0^(1.0/6.0)*1.0)
pair_coeff 2 2 1.0 2.0 $(2.0^(1.0/6.0)*2.0)
pair_modify shift yes
fix move all rigid molecule langevin 1.5 1.5 0.5 13215123
velocity all create 3.0 34256234 loop geom
# uncomment for visualization in LAMMPS GUI
# dump 1 all image 100 rigid*.png type type zoom 1.2 size 800 800
thermo 100
run 10000 post no
# write out final state *with* complete coeff info
write_data run.data pair ij
Short animation:
Dear Dr. Axel Kohlmeyer,
thank you very much for your comprehensive and informative response.