A couple of problems about compute group/group command

I am trying to calculate the interaction energy between two groups of atoms. But I found a couple of problems with it. First, when I used different number of processors to run the same job, the resulting interaction energy is different, not slightly but remarkably different (>30% difference between 1 processor and 6 processor runs); second, I used periodic boundary condition, and I got bizarre results when the interaction crosses the boundary. To put the second problem more clearly, I am simulating bulk graphite with 10 layers in the model; the 1st and 10th layer are close to the bottom and top boundary, respectively. I monitored the interaction energy between the 5th and 6th layer and that between the 1th and 10th layer, respectively, by “compute group/group”, and they are expected to be almost the same. However, the former is found to be about 7.5eV and latter 17.5eV, which does not look right.

I would appreciate it if someone could give me some suggestions.

I speculate that it has something to do with communication between processors, or MPI stuff. I am using lammps-10Apr12. I am not sure if someone has met with the same problem as me.

I don't believe compute group/group depends either on the number
of procs or where the 2 groups are with respect to the periodic boundary.
Please post an example input script for a small problem where this
problem occurs on timestep 0 when you print the group/group energy
with the thermo output.

Steve

Hi Steve,
thank you very much for your reply! My input script is as follows:

units metal

atom_style molecular

boundary p p p

read_data medium_10_layer_updated.lammps05

dump xyz_graphene all xyz 10000 graphene_atom_medium_10_layer_from_npt.xyz graphene_atom_10_layer.out id mol x y z

timestep .0005 #picoseconds

velocity all create 300 12390

group layer1 type 1

group layer2 type 2

group layer3 type 3

group layer4 type 4

group layer5 type 5

group layer6 type 6

group layer7 type 7

group layer8 type 8

group layer9 type 9

group layer10 type 10

group block1 type <> 1 5

group block2 type <> 6 10

group center1 type <> 4 5

group center2 type <> 6 7

group center11 type <> 6 7

group center12 type <> 8 9

group center21 type <> 7 8

group center22 type 9 10

pair_style hybrid lj/smooth/linear 7.13176 tersoff

pair_coeff * * tersoff SiC.tersoff C C C C C C C C C C

pair_coeff 1 2*10 lj/smooth/linear .003 3.4

pair_coeff 2 3*10 lj/smooth/linear .003 3.4

pair_coeff 3 4*10 lj/smooth/linear .003 3.4

pair_coeff 4 5*10 lj/smooth/linear .003 3.4

pair_coeff 5 6*10 lj/smooth/linear .003 3.4

pair_coeff 6 7*10 lj/smooth/linear .003 3.4

pair_coeff 7 8*10 lj/smooth/linear .003 3.4

pair_coeff 8 9*10 lj/smooth/linear .003 3.4

pair_coeff 9 10 lj/smooth/linear .003 3.4

neighbor 2.0 bin

neigh_modify delay 0 every 20 check no

fix 1 all npt temp 300.0 300.0 0.1 x 1.0 1.0 0.2 y 1.0 1.0 0.2 z 1.0 1.0 0.2 drag 0.2

#compute morsePE all pair lj/smooth/linear

compute PEblock block1 group/group block2

compute PEcenter0 layer5 group/group layer6

compute PEcenter center1 group/group center2

compute PEcenter1 center11 group/group center12

compute PEcenter2 center21 group/group center22

compute PEbound layer1 group/group layer10

fix calcPELJ all ave/time 1 500 500 c_PEblock c_PEcenter0 c_PEcenter c_PEcenter1 c_PEcenter2 c_PEbound file PELJ.profile

thermo_style custom step temp pe ke etotal c_PEblock c_PEcenter0 c_PEcenter c_PEcenter1 c_PEcenter2 c_PEbound

thermo 100

run 10000

I monitored the interaction energy between several pairs of groups as defined in the script.

The thermo output of 1 processor run is:

Memory usage per processor = 13.2838 Mbytes
Step Temp PotEng KinEng TotEng PEblock PEcenter0 PEcenter PEcenter1 PEcenter2 PEbound
0 300 -20591.202 108.53974 -20482.662 -35.982298 -12.360447 -12.367833 -8.6242827 -12.021959 -17.659791
100 160.46224 -20753.834 58.055103 -20695.778 -31.496998 -10.822025 -10.827605 -7.8479427 -10.569837 -17.312917
200 160.50746 -20747.084 58.071461 -20689.012 -29.739504 -10.760975 -10.764245 -7.8430489 -10.633853 -17.255462
300 174.16506 -20745.477 63.01277 -20682.464 -28.580609 -10.838329 -10.840682 -7.859317 -10.689181 -16.758839
400 187.0805 -20743.598 67.685566 -20675.912 -28.368535 -11.008486 -11.010793 -7.8285857 -10.550734 -16.8122
500 188.39422 -20737.624 68.160866 -20669.463 -28.789981 -11.086765 -11.089402 -7.8313876 -10.562458 -17.229449
600 184.64988 -20729.652 66.806171 -20662.846 -29.319951 -11.099756 -11.103119 -7.736693 -10.614819 -17.628407
700 200.88337 -20728.793 72.679431 -20656.113 -29.730889 -11.143994 -11.149758 -7.6999079 -10.516923 -17.810558
800 202.53252 -20722.62 73.276093 -20649.344 -30.041089 -11.157048 -11.168049 -7.7919514 -10.260461 -17.868569

The thermo output for the 12 processors run is:

Memory usage per processor = 6.98042 Mbytes
Step Temp PotEng KinEng TotEng PEblock PEcenter0 PEcenter PEcenter1 PEcenter2 PEbound
0 300 -20589.823 108.53974 -20481.283 -32.238749 -8.6168978 -8.6242844 -8.6242827 -8.6242862 -17.659791
100 160.46224 -20755.941 58.055103 -20697.886 -28.72091 -7.9964096 -8.0515182 -7.8479427 -8.1396255 -17.312917
200 160.50746 -20750.028 58.071461 -20691.957 -26.960941 -7.9386613 -7.9856815 -7.8430489 -8.2870153 -17.255462
300 174.16506 -20748.58 63.01277 -20685.567 -25.732705 -7.9508024 -7.9927783 -7.859317 -8.3968252 -16.758839
400 187.0805 -20746.495 67.685566 -20678.81 -25.42405 -8.0144726 -8.0663078 -7.8285857 -8.2129768 -16.8122
500 188.39422 -20740.175 68.160866 -20672.014 -25.724976 -7.974708 -8.0243971 -7.8313876 -8.1479309 -17.229449
600 184.64988 -20732.261 66.806171 -20665.454 -26.211196 -7.9365191 -7.9943637 -7.736693 -8.2242309 -17.628407
700 200.88337 -20731.524 72.679431 -20658.844 -26.622133 -7.9725024 -8.041003 -7.6999079 -8.108174 -17.810558
800 202.53252 -20725.618 73.276093 -20652.341 -26.911697 -7.9401552 -8.0386572 -7.7919514 -7.8839057 -17.868569

First, PEbound column is much larger than PEcenter0 column, the former specifies the interaction between boundary two layers and the latter between central two layers. Second, the two runs give different interaction energy, which can be exemplified by the difference between the PEcenter0 column in different runs.

I guess if there is nothing wrong with compute group/group, then there might be some problem with lj/smooth/linear potential.

I tried to replace lj/smooth/linear potential with morse potential, the numerical value is not so different now.

The thermo output for 1 processor run:

Step Temp PotEng KinEng TotEng PEblock PEcenter0 PEcenter PEcenter1 PEcenter2 PEbound
0 300 -20782.192 108.53974 -20673.652 -63.326511 -28.645176 -32.057563 -32.057568 -32.057564 -26.81189
100 159.46194 -20935.472 57.693195 -20877.779 -59.61249 -26.489303 -29.85282 -29.882764 -29.915353 -25.563442
200 164.27388 -20932.23 59.434151 -20872.796 -60.455063 -26.493899 -29.993601 -30.07084 -30.265096 -26.620343
300 174.60557 -20930.028 63.172148 -20866.856 -59.9193 -26.523774 -30.067031 -30.133515 -30.252383 -26.396828
400 187.63768 -20928.402 67.887154 -20860.515 -59.710064 -26.396968 -29.958919 -30.20763 -29.779621 -26.469204
500 196.21219 -20924.843 70.989403 -20853.853 -59.769938 -26.4313 -30.056062 -30.205145 -29.945888 -26.377513
600 183.34282 -20913.236 66.333277 -20846.903 -60.154507 -26.51569 -30.340963 -29.846839 -29.827127 -26.353546
700 207.11631 -20914.892 74.934504 -20839.957 -60.571254 -26.295786 -30.517771 -30.064643 -29.586258 -26.540435
800 208.34638 -20908.325 75.379543 -20832.945 -59.756018 -25.131908 -29.78329 -29.842863 -29.594512 -26.482794

The thermo output for 12 processor run:

Step Temp PotEng KinEng TotEng PEblock PEcenter0 PEcenter PEcenter1 PEcenter2 PEbound
0 300 -20782.192 108.53974 -20673.652 -63.326511 -28.645176 -32.057563 -32.057568 -32.057564 -26.81189
100 159.46194 -20935.472 57.693195 -20877.779 -59.61249 -26.489303 -29.85282 -29.882764 -29.915353 -25.563442
200 164.27388 -20932.23 59.434151 -20872.796 -60.455063 -26.493899 -29.993601 -30.07084 -30.265096 -26.620343
300 174.60557 -20930.028 63.172148 -20866.856 -59.9193 -26.523774 -30.067031 -30.133515 -30.252383 -26.396828
400 187.63768 -20928.402 67.887154 -20860.515 -59.710064 -26.396968 -29.958919 -30.20763 -29.779621 -26.469204
500 196.21219 -20924.843 70.989403 -20853.853 -59.769938 -26.4313 -30.056062 -30.205145 -29.945888 -26.377513
600 183.34282 -20913.236 66.333277 -20846.903 -60.154507 -26.51569 -30.340963 -29.846839 -29.827127 -26.353546
700 207.11631 -20914.892 74.934504 -20839.957 -60.571254 -26.295786 -30.517771 -30.064643 -29.586258 -26.540435
800 208.34638 -20908.325 75.379543 -20832.945 -59.756018 -25.131908 -29.78329 -29.842863 -29.594512 -26.482794