Extracting Force


I am trying to extract the sum of forces on the atoms of a cnt undergoing compression at z direction. However, there is something wrong with my codes, I can’t get the correct force-strain graph. Can someone help me check what is wrong with my codes?

units metal
dimension 3
atom_style atomic
boundary s s s
neighbor 2.0 bin
neigh_modify every 1

create geometry

read_data data.cnt.txt
pair_style airebo 3.0
pair_coeff * * C:\LAMMPS\CH.airebo.txt C

define groups

group lower id <= 40
group lower2 id <> 40 81
group upper id >= 1361
group upper2 id <> 1320 1361
group halfup id >= 701
group halflow id < 701

group mobile subtract all lower upper
group boundary union lower upper


minimize 1.0e-8 1.0e-8 10000 10000


initial velocity

velocity all create 0.01 5176542 mom yes rot yes dist gaussian units box
compute mytemp mobile temp



fix 1 all nvt temp 0.01 0.01 0.01

run 10000
reset_timestep 0

As I've said before, no one is likely to run a complex input
script and help you answer the question, "what is wrong?".

You need to treat this like a debugging exercise. Simplify
your script. Add new options one at a time and verify
they do what you expect. If you have a question about
a specific LAMMPS command or option, then ask that Q.
Rinse and repeat.


Ok, let me rephrase my question. What I'm asking is, how do I extract the force at z direction in the upper2 and lower2 groups? What command should I be using? I used store force but the value I get is not consistent with the cnt undergoing compression. Is there any other way for me to extract force?

Thank you

A variable can use the function fcm(group), which will
give you the total force on a group of atoms, which can
then be printed out with thermo info.