Problems Encountered in Constant Load Tensile Simulation of Models Using the addforce Command When stretching the model using addforce, the calculated stress and strain values show significant abnormalities

My code is below. Please help me fix it, thanks!

units real

atom_style full

boundary p p p

timestep 1

neighbor 2.0 bin

neigh_modify every 1 delay 0 check yes

bond_style harmonic

angle_style harmonic

dihedral_style harmonic

improper_style cvff

pair_style lj/cut/coul/long 12.0

read_data 4-5-4.data extra/bond/per/atom 4 extra/angle/per/atom 7 extra/special/per/atom 30

kspace_style pppm 1.0e-4

special_bonds lj/coul 0.0 0.0 0.5

minimize 1e-4 1e-6 1000 10000

velocity all create 298.0 3489

fix 111 all npt temp 298.0 298.0 100.0 iso 0.0 0.0 100.0

thermo 200

thermo_style custom step temp press

run 20000

unfix 111

reset_timestep 0

compute ymin0 all reduce min y

compute ymax0 all reduce max y

variable ly0 equal c_ymax0 - c_ymin0

group AP molecule 1

group mix subtract all AP

variable y_thick equal 8.0

variable ybot_region equal c_ymin0 + ${y_thick}

variable ytop_region equal c_ymax0 - ${y_thick}

region bottom block INF INF {c_ymin0} {ybot_region} INF INF units box

region top block INF INF {ytop_region} {c_ymax0} INF INF units box

group bottom region bottom

group up region top

group mid subtract all bottom up

compute Nbot bottom count

compute Ntop up count

fix 100 bottom nve

fix 101 bottom addforce 0.0 -0.01/c_Nbot 0.0

fix_modify 101 virial yes

fix 200 up nve

fix 201 up addforce 0.0 0.01/c_Ntop 0.0

fix_modify 201 virial yes

fix 300 mid nvt temp 298.0 298.0 100.0

compute myPress all pressure NULL pair bond angle dihedral improper kspace

variable pyy equal c_myPress[2]

compute ymin all reduce min y

compute ymax all reduce max y

variable L equal c_ymax - c_ymin

variable strain equal (v_L - v_ly0)/v_ly0

variable stress_GPa equal -v_pyy * 0.000101325

thermo 1000

thermo_style custom step temp v_strain v_stress_GPa

dump 2 all cfg 10000 dump.tensile.*.cfg mass type xs ys zs id

dump_modify 2 sort id

fix 1000 all print 1000 “{step} {strain} ${stress_GPa}” file stress_strain.txt screen no

run 500000

It is not particularly obvious where to begin, since the command compute ... count does not exist (in the official version of LAMMPS).

Non-existent commands cause LAMMPS to abort a run rather than silently continue and leave the user hoping for the best. It would therefore be very surprising for this script to produce any values of stress and strain at all, let alone any reasonable values.

You may want to search for the “Guidelines For Posting” to have a better chance of getting useful help.

Good luck!