[lammps-users] is Pxx=fcm(all,x)/YZ ?

Dear lammps users,
I need to use fcm(ID,dim) function calculate the pressure of a section of my box. As a simple check I did a sample job and calculated fcm(all, x), fcm(all,y), and fcm(all,z). Then divided them by the cross section area. However, the value (after unit conversions) is not equal to pxx, pyy, and pzz. Is there a second term that I have to add to it to get the pressure of the box ( like NkT/V or sigma(mi vi vj)/V )? A sample of numbers I get is as below:

pxx(atm) pyy(atm) pzz(atm) fx(kcal/mol.Ang) fy(kcal/mol.Ang) fz(kcal/mol.Ang)
246.16825 478.012 209.28018 3.93e-13 -5.14e-13 3.07e-13

after unit conversions for 500 propane in a box of (45.7 Ang)^3

pxx(J/m3) pyy(J/m3) pzz(J/m3) fx((J/m3) fy(J/m3) fz(J/m3)
0.002429 0.0047176 0.002065 0.0006447 -0.000846 0.0005047

Thank you very much

Dear Amir,

If you look back on my previous emails, you can check that I never
said that. From your description I assumed that you had two reservoirs
separated by a membrane. What I wrote is that the *pressure
difference* between the two reservoirs would be given by the total
force *on the membrane* divided by the area of the membrane. Therefore
you have to define a group from the atoms of your membrane, and
compute the force only on this group.

The total force on all atoms in the system has nothing to do with the
pressure of the system. Plus, as your system is not homogeneous, the
meaning of pxx is not clear to me.