movement problem with rigid body

Dear lammps-users and developers

I would like to study the tensile process of A/B interface. The initial model consists of 24 A layers and 24 B layers.

For the tensile test, I set the last six B layers (group base0) and three A layers (group additive0) as rigid body. And then 24 A layers are moved up 0.3 Å by 0.3 Å, used by command displace_atoms.

The problem I met is, it can work in LAMMPS 2009 version. However LAMMPS 2012 version and the later versions, it cannot work. The position of A layers(group additive0) is not moved. This perplexes me with a long time.

I need your help.

Best wishes

Hang Fan

Here is my script



units real

dimension 3

atom_style full

read_data ${File}


group base0 molecule 1

group base1 molecule 2

group base union base0 base1

group additive1 molecule 3

group additive0 molecule 4

group additive union additive0 additive1

group bound union base0 additive0

group body union base1 additive1

variable t equal temp

variable e equal etotal

variable ep equal pe

variable ek equal ke

variable z0 equal xcm(base0,z)

variable z1 equal xcm(additive0,z)

timestep 0.5

thermo 1

thermo_style custom step temp etotal pe ke v_z0 v_z1

minimize 0 0 10000 1000000

velocity body create 600 428751 dist gaussian

fix bound bound rigid group 2 base0 additive 0 force * off off off torque * off off off

fix md body nvt temp 300 300 100 drag 0.2

(fix md body nvt 300 300 100 drag 0.2, Lammps 2009 Version)

run 10000

dump xyz all xyz 100 ${File}

run 0

undump xyz


variable File index

variable n loop 30

include in.create

label start_loop

fix print all print 1 "$t e {ep} {ek} {z0} {z1}" file {File}.$n.result

run 10000

unfix print

dump xyz all xyz 100 ${File}.$

run 0

undump xyz

displace_atoms additive move 0 0 0.3 units box

next n

jump start_loop

variable n delete


I don’t think it will work to use displace_atoms on a rigid body

(the doc page should warn about this). That’s b/c a rigid body

has internal state (the center of mass) which is not stored

with the atoms. Displacing the atoms doesn’t change the

center-of-mass so the atoms in the body won’t really move either.

You could do bad things to a rigid body with displace_atoms

like move 1/2 the atoms in the body.

It might work if you put the fix rigid command inside your

loop so that it re-created the rigid body each time, after

the atoms were displaced.

You could probably also do what you want w/out using rigid bodies.

Either freeze the end atoms, or use fix ave/force which will let

them move in one or more dimensions as a frozen set.