Sudden displacement for first step

Hello everyone,

I am using LAMMPS window version 19 March 2020. I want just move one graphene layer to some distance. In the code, I have set velocity 0.5 A/fs and run for 40 steps with timestep of 0.25 fs. Then, at end, I should have displacement for 5 A.

When I run the code, I found that for first step I am getting higher than 5 A, while from 2 to 40 steps, the graphene is moving at constant speed of 0.5 A/fs visualizing using Ovito 3.0 2020 version. Previously, I equilibrated the system using NPT ensemble where I was using periodic boundary conditions. As I want to pull the graphene. Here , I used boundary condition m f f. Below is code:

log “C:\one\log\justpull.txt”
echo screen
units real
dimension 3
boundary m p p
atom_style charge

read_data C:\one\datafile\data_1.txt

pair_style reax/c NULL safezone 2.0 mincap 200
pair_coeff * * …/potentials/ffield.Reax.latest C C O C O H C O C N H H

group Lowergraphene id 1:576:1

neighbor 2.0 bin
neigh_modify delay 0 every 1 check yes

timestep 0.25

compute reax all pair reax/c
fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 reax/c

variable eb equal c_reax[1]
variable ea equal c_reax[2]
variable elp equal c_reax[3]
variable emol equal c_reax[4]
variable ev equal c_reax[5]
variable epen equal c_reax[6]
variable ecoa equal c_reax[7]
variable ehb equal c_reax[8]
variable et equal c_reax[9]
variable eco equal c_reax[10]
variable ew equal c_reax[11]
variable ep equal c_reax[12]
variable efi equal c_reax[13]
variable eqeq equal c_reax[14]

fix 2 Lowergraphene move linear 0.5 NULL NULL units box

thermo 1

thermo_style custom step temp press pxx pyy pzz density enthalpy etotal pe ke epair evdwl ecoul v_eb v_ea v_elp v_emol v_ev v_epen v_ecoa v_ehb v_et v_eco v_ew v_ep v_efi v_eqeq lx ly lz

dump dumpdisp_1 all custom 1 C:\one\strjdisp\disp_1.lammpstrj id type x y z ix iy iz

run 40

write_data C:\one\datafileloop\data_2.txt

unfix 2
undump dumpdisp_1

print "code just pull is run successfully "

When I did visualize carefully, I found that In the image, atoms present in -X edge of box are coming to +X edge in 1 st step. How can I fix this issue?

Thanks and best regards,


this is likely due to inconsistent geometry data in your data file, but there is not enough information here to make a definite statement. axel.

Thanks, Axel.

To check the cause of inconsistency geometry data. I build two graphene in Material studio then using msi2lmptool got LAMMPS data file. Then minimization. I have initial data min2data.txt. Then I run code for minimization using script min3input.txt after that I run nvt1input.txt.

Then, I run code pullinggraphenecode1.txt for data file (1) case I got from script min3input and (2) nvt1nput.txt using write data command available in LAMMPS. All the files are attached. Sudden displacement is observed for first timestep in case of second case. I observed for first step atoms lie on -x edge is shifted to +x edge at first step. Then all graphene are pulling at constant speed. But as I run script again data file I got from this pulling script. Box is expanding. What am I doing wrong?

Thanks and Best Regards,

nvt1input.txt (2.11 KB)

pullinggraphenecode1.txt (1.54 KB)

min3input.txt (1.75 KB)

min3data.txt (202 KB)

nvt1data.txt (204 KB)

ffield.Reax.latest (32.3 KB)

min2data.txt (202 KB)

As I suspected, you have an inconsistent data file when starting the pulling. during the nvt equilibration, some atoms have moved outside the principle simulation cell and thus their image flags are not zero. however, for fixed or shrinkwrapped boundary conditions, they cannot be. thus their positions when writing out dump files is bogus.

when reading data files it is assumed that you read them with the same settings that you wrote them. so switching from periodic to non-periodic is better done after reading the data file with boundary p p p and then issuing the command:

change_box all boundary m p p


Thank you so much, Axel.

Hello, Axel. I added the command “change_box all boundary m p p” after reading read data. But still getting same sudden displacement as I was getting previously.

Thanks and Best Regards,

pullinggraphenecode1.txt (1.51 KB)

Hello, Axel. I added the command “change_box all boundary m p p” after reading read data. But still getting same sudden displacement as I was getting previously.

that means your LAMMPS version is too old. since you are using windows, you are currently out of luck, since there are no newer binary package (the build procedure needs to be updated, and that won’t happen for a few more weeks).
you could try inserting:

set group all image 0 0 0

after the change_box command, that might work in your specific case, since you have no explicit bond topology.


Thank you so much, Axel for quick response. The problem is finally solved :-).