How to get seperate virial contributions

Please post to the list, not to me.

You said you were using a Jan 2009 version of the code. Please
try your problem with the current version. If the 3 commands I posted
do not give aggreement between the total pressure and the summer
per-atom stress (from off the compute pressure doc page), then
post a simple, small example of your input files to the list. You shouldn't
have to run more than 10 steps to do the test.

Steve

**Hi all ,**

Hi Steve,

I have used two versions of LAMMPS one is 11 Apr 2011 and other one is 10 Dec 2010 with all standard packages except GPU,MEAM,POEMS,REAX, SRD and no USER-packages.

I am pulling a periodic 3D box of polyethylene with 160 molecules each molecule having 200 atoms.
And i have used NPT ensemble. Now i am trying to get a stress per atom for that i used proper commands in input file as mentioned in manual. As below

compute peratom all stress/atom compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3] variable pressure equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)

To get output i have used thermo_style as below

thermo_style custom step temp press v_pressure pxx pyy pzz pxy pxz pyz **in an output thermo_style pressure and summed stress per atom values are not matching, what is the reason behind that is i am not getting?**

For your reference i appended below my input as well as output log file please check them once and let me know if there is any mistakes.

input file:

units real

atom_style full
boundary p p p
pair_style lj/cut/opt 6.0
bond_style harmonic
angle_style cosine/squared
dihedral_style opls
special_bonds lj 0.0 0.0 0.0 dihedral no

read_data 200_PE_LAMMPS_INPUT

mass 1 14
mass 2 15

pair_coeff 1 1 0.0862233699 4.0685000000
pair_coeff 1 2 0.0862233699 4.0685000000
pair_coeff 2 2 0.2104232379 3.7654000000

pair_modify tail yes
neighbor 1.0 bin

bond_coeff 1 327.8159977500 1.5330000000
bond_coeff 2 327.8159977500 1.5310000000

angle_coeff * 89.4358472550 113.3000000000

dihedral_coeff * 1.8773287740 -1.0413681240 3.7164422040 0.0000000000

timestep 2.0
run_style verlet

fix 1 all npt temp 100.00 100.00 200 x 0.0 0.0 500 y 0.0 0.0 500
fix 2 all temp/rescale 1 100.0 100.0 10 0.5

fix 3 all deform 1 z vel 0.0005 units box

compute peratom all stress/atom
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable pressure equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)

thermo_style custom step temp press v_pressure pxx pyy pzz pxy pxz pyz

thermo 1
run 3000

output file:

LAMMPS (11 Apr 2011)
Scanning data file …
1 = max bonds/atom
1 = max angles/atom
1 = max dihedrals/atom
Reading data file …
orthogonal box = (-47.8418 -47.8418 -47.8418) to (47.8418 47.8418 47.8418)
1 by 1 by 1 processor grid
32000 atoms
31840 bonds
31680 angles
31520 dihedrals
Finding 1-2 1-3 1-4 neighbors …
2 = max # of 1-2 neighbors
2 = max # of 1-3 neighbors
4 = max # of 1-4 neighbors
6 = max # of special neighbors
Setting up run …
Memory usage per processor = 35.5468 Mbytes
Step Temp Press pressure Pxx Pyy Pzz Pxy Pxz Pyz
0 0 -424.47644 2171.2047 -479.12454 -362.84958 -431.4552 -7.2978093 -43.727494 50.973856
1 53.035949 -108.24603 2487.4511 -155.44124 -50.053871 -119.24297 -6.296583 -40.762836 55.591285
2 90.22997 311.35425 2907.1456 302.71385 355.45867 275.89024 -7.5642367 -22.120383 71.234512
3 95.523993 435.79202 3031.5986 467.65208 462.90429 376.8197 -10.691304 -0.034818175 85.624293
4 88.342377 323.01901 2918.6899 386.00997 333.01347 250.03358 -14.796574 20.118885 95.661921
5 79.64572 103.72869 2699.138 184.07392 99.00356 28.108591 -19.169109 35.969836 100.23086
6 79.261078 -67.783084 2527.3103 12.350419 -81.493938 -134.20573 -22.997323 45.063148 99.647513
7 90.932577 -80.979672 2513.8092 -20.351199 -98.062834 -124.52498 -27.060995 46.957405 92.862341
8 107.98431 32.778648 2627.2925 59.887303 14.911372 23.53727 -31.84299 44.392964 79.516066
9 117.81442 115.97088 2710.2113 104.37986 97.209032 146.32374 -36.842691 40.797585 61.404803
10 115.22465 60.283842 2654.225 14.230152 39.885812 126.73556 -40.536523 37.590068 42.738842
11 109.02293 -95.054125 2498.5766 -164.23065 -119.02246 -1.9092683 -40.961316 34.680023 27.43902
12 90.267394 -343.07686 2250.2854 -418.82708 -371.90623 -238.49726 -36.744262 30.943852 18.516662
13 85.438893 -465.46731 2127.7429 -530.48872 -498.09174 -367.82146 -26.731544 27.120099 17.428021
14 86.783658 -440.33034 2152.8955 -478.76028 -474.79152 -367.43922 -11.528341 24.020375 24.709527
15 92.760899 -262.07495 2331.3267 -266.01396 -294.49932 -225.71158 6.7105976 25.504826 36.627626

in the above output file
press is the global thermo value(3rd column)

pressure is the summed stress/atom by compute(4th column), if you observe that they are not matching, can you please verify and let me know the problem.

thanks,

grn.