diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index bdff7a5cd684e7481832aaae8ed7cdea3db4408e..25bdae14f1dd30002f87cc4ecc5442d0b8e65bc4 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -281,7 +281,7 @@ void PairGayBerne::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp index 4e3df473a385bc92d635ae66406613bd061382dc..fc92ed4dc1b98565d64d3fffd328651b8fb40e69 100644 --- a/src/ASPHERE/pair_line_lj.cpp +++ b/src/ASPHERE/pair_line_lj.cpp @@ -355,7 +355,7 @@ void PairLineLJ::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp index 172516aa49021691de908ca9b24cfcff3db156eb..ed9d9b36c4012c766df9e58a23956d59319420d0 100644 --- a/src/ASPHERE/pair_resquared.cpp +++ b/src/ASPHERE/pair_resquared.cpp @@ -253,7 +253,7 @@ void PairRESquared::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp index 773ad2d6a3737707d53112462818d4ebec33aea9..4f30b40e9a8976d9abb98913c7d4b30c5ae78278 100644 --- a/src/ASPHERE/pair_tri_lj.cpp +++ b/src/ASPHERE/pair_tri_lj.cpp @@ -426,7 +426,7 @@ void PairTriLJ::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/BODY/pair_body.cpp b/src/BODY/pair_body.cpp index 2a9edb37cc5fc365e0d9391440950535286a57ce..b1be99731018e2f30ebaa4258a679abb93944472 100644 --- a/src/BODY/pair_body.cpp +++ b/src/BODY/pair_body.cpp @@ -372,7 +372,7 @@ void PairBody::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index ee61aaae1fdcc905bf4d8ad6ed811547f29afc25..e79dc0c6ded265f05a15a271b51e95057f92bf52 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -174,7 +174,7 @@ void PairLJClass2::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index 45f0ccfe2788069aa47d5473195545127aef4d63..bec7f1da15e21057b488ad74021a18ef83011d92 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -202,7 +202,7 @@ void PairLJClass2CoulCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_lj[i][j] = cut_lj_global; cut_coul[i][j] = cut_coul_global; diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index b58094713f79ff181c72504b5497ce91831d44cd..5f7d738e92e1ff87c327838016e3e1d68fe55e95 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -240,7 +240,7 @@ void PairLJClass2CoulLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/COLLOID/pair_brownian.cpp b/src/COLLOID/pair_brownian.cpp index 84fda485a036b0f93a1997335be4f73f2c78f5f8..2bf01303b44aa1193d9e885fc3f49e8ec27f5463 100644 --- a/src/COLLOID/pair_brownian.cpp +++ b/src/COLLOID/pair_brownian.cpp @@ -403,7 +403,7 @@ void PairBrownian::settings(int narg, char **arg) if (allocated) { for (int i = 1; i <= atom->ntypes; i++) - for (int j = i+1; j <= atom->ntypes; j++) + for (int j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_inner[i][j] = cut_inner_global; cut[i][j] = cut_global; diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp index 440d6f9d4f8f86da23ab16e97ffb3f693b20d563..68150f6effb62b06971b516cf94ae8621007b404 100644 --- a/src/COLLOID/pair_colloid.cpp +++ b/src/COLLOID/pair_colloid.cpp @@ -256,7 +256,7 @@ void PairColloid::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index 71e08f3f1993501268402885d61530e422a60c9e..93cb48a15db6355f79d25264a9dd0bed35681101 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -489,7 +489,7 @@ void PairLubricate::settings(int narg, char **arg) if (allocated) { for (int i = 1; i <= atom->ntypes; i++) - for (int j = i+1; j <= atom->ntypes; j++) + for (int j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_inner[i][j] = cut_inner_global; cut[i][j] = cut_global; diff --git a/src/COLLOID/pair_lubricateU.cpp b/src/COLLOID/pair_lubricateU.cpp index a50473a194fb653a6af52800ca0c1aec0e1b2e6c..5d0a4243a7fbb59e021dea3c9179146730c264c8 100644 --- a/src/COLLOID/pair_lubricateU.cpp +++ b/src/COLLOID/pair_lubricateU.cpp @@ -1707,7 +1707,7 @@ void PairLubricateU::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_inner[i][j] = cut_inner_global; cut[i][j] = cut_global; diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 29e192cd94a8bd3cdf7987ebb7c5c3fcad0b3015..428aa41cb6f9c2000549db290f45d813d6805d45 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -1104,7 +1104,7 @@ void PairLubricateUPoly::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_inner[i][j] = cut_inner_global; cut[i][j] = cut_global; diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp index c57eb09e52e2f8fca83b4dac4aefe09fb8af7d1a..addd02e505cbc47d7f56275c1d3918711f9a373a 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp @@ -307,7 +307,7 @@ void PairLJCutDipoleCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_lj[i][j] = cut_lj_global; cut_coul[i][j] = cut_coul_global; diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.cpp b/src/DIPOLE/pair_lj_cut_dipole_long.cpp index ae85b55ff7063089c10067e04ce4eea1e9b834c4..78922e356f1e9d4caee3746d5b4b5ee6fc29f7e7 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_long.cpp @@ -140,174 +140,174 @@ void PairLJCutDipoleLong::compute(int eflag, int vflag) jtype = type[j]; if (rsq < cutsq[itype][jtype]) { - r2inv = 1.0/rsq; - rinv = sqrt(r2inv); - - if (rsq < cut_coulsq) { - r = sqrt(rsq); - grij = g_ewald * r; - expm2 = exp(-grij*grij); - t = 1.0 / (1.0 + EWALD_P*grij); - erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2; - - pdotp = mu[i][0]*mu[j][0] + mu[i][1]*mu[j][1] + mu[i][2]*mu[j][2]; - pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz; - pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz; - - g0 = qtmp*q[j]; - g1 = qtmp*pjdotr - q[j]*pidotr + pdotp; - g2 = -pidotr*pjdotr; - - if (factor_coul > 0.0) { - b0 = erfc * rinv; - b1 = (b0 + pre1*expm2) * r2inv; - b2 = (3.0*b1 + pre2*expm2) * r2inv; - b3 = (5.0*b2 + pre3*expm2) * r2inv; - - g0b1_g1b2_g2b3 = g0*b1 + g1*b2 + g2*b3; - fdx = delx * g0b1_g1b2_g2b3 - - b1 * (qtmp*mu[j][0] - q[j]*mu[i][0]) + - b2 * (pjdotr*mu[i][0] + pidotr*mu[j][0]); - fdy = dely * g0b1_g1b2_g2b3 - - b1 * (qtmp*mu[j][1] - q[j]*mu[i][1]) + - b2 * (pjdotr*mu[i][1] + pidotr*mu[j][1]); - fdz = delz * g0b1_g1b2_g2b3 - - b1 * (qtmp*mu[j][2] - q[j]*mu[i][2]) + - b2 * (pjdotr*mu[i][2] + pidotr*mu[j][2]); - - zdix = delx * (q[j]*b1 + b2*pjdotr) - b1*mu[j][0]; - zdiy = dely * (q[j]*b1 + b2*pjdotr) - b1*mu[j][1]; - zdiz = delz * (q[j]*b1 + b2*pjdotr) - b1*mu[j][2]; - zdjx = delx * (-qtmp*b1 + b2*pidotr) - b1*mu[i][0]; - zdjy = dely * (-qtmp*b1 + b2*pidotr) - b1*mu[i][1]; - zdjz = delz * (-qtmp*b1 + b2*pidotr) - b1*mu[i][2]; - - if (factor_coul < 1.0) { - fdx *= factor_coul; - fdy *= factor_coul; - fdz *= factor_coul; - zdix *= factor_coul; - zdiy *= factor_coul; - zdiz *= factor_coul; - zdjx *= factor_coul; - zdjy *= factor_coul; - zdjz *= factor_coul; - } - } else { - fdx = fdy = fdz = 0.0; - zdix = zdiy = zdiz = 0.0; - zdjx = zdjy = zdjz = 0.0; - } - - if (factor_coul < 1.0) { - d0 = (erfc - 1.0) * rinv; - d1 = (d0 + pre1*expm2) * r2inv; - d2 = (3.0*d1 + pre2*expm2) * r2inv; - d3 = (5.0*d2 + pre3*expm2) * r2inv; - - g0d1_g1d2_g2d3 = g0*d1 + g1*d2 + g2*d3; - fax = delx * g0d1_g1d2_g2d3 - - d1 * (qtmp*mu[j][0] - q[j]*mu[i][0]) + - d2 * (pjdotr*mu[i][0] + pidotr*mu[j][0]); - fay = dely * g0d1_g1d2_g2d3 - - d1 * (qtmp*mu[j][1] - q[j]*mu[i][1]) + - d2 * (pjdotr*mu[i][1] + pidotr*mu[j][1]); - faz = delz * g0d1_g1d2_g2d3 - - d1 * (qtmp*mu[j][2] - q[j]*mu[i][2]) + - d2 * (pjdotr*mu[i][2] + pidotr*mu[j][2]); - - zaix = delx * (q[j]*d1 + d2*pjdotr) - d1*mu[j][0]; - zaiy = dely * (q[j]*d1 + d2*pjdotr) - d1*mu[j][1]; - zaiz = delz * (q[j]*d1 + d2*pjdotr) - d1*mu[j][2]; - zajx = delx * (-qtmp*d1 + d2*pidotr) - d1*mu[i][0]; - zajy = dely * (-qtmp*d1 + d2*pidotr) - d1*mu[i][1]; - zajz = delz * (-qtmp*d1 + d2*pidotr) - d1*mu[i][2]; - - if (factor_coul > 0.0) { - facm1 = 1.0 - factor_coul; - fax *= facm1; - fay *= facm1; - faz *= facm1; - zaix *= facm1; - zaiy *= facm1; - zaiz *= facm1; - zajx *= facm1; - zajy *= facm1; - zajz *= facm1; - } - } else { - fax = fay = faz = 0.0; - zaix = zaiy = zaiz = 0.0; - zajx = zajy = zajz = 0.0; - } - - forcecoulx = fdx + fax; - forcecouly = fdy + fay; - forcecoulz = fdz + faz; - - tixcoul = mu[i][1]*(zdiz + zaiz) - mu[i][2]*(zdiy + zaiy); - tiycoul = mu[i][2]*(zdix + zaix) - mu[i][0]*(zdiz + zaiz); - tizcoul = mu[i][0]*(zdiy + zaiy) - mu[i][1]*(zdix + zaix); - tjxcoul = mu[j][1]*(zdjz + zajz) - mu[j][2]*(zdjy + zajy); - tjycoul = mu[j][2]*(zdjx + zajx) - mu[j][0]*(zdjz + zajz); - tjzcoul = mu[j][0]*(zdjy + zajy) - mu[j][1]*(zdjx + zajx); - - } else { - forcecoulx = forcecouly = forcecoulz = 0.0; - tixcoul = tiycoul = tizcoul = 0.0; - tjxcoul = tjycoul = tjzcoul = 0.0; - } - - // LJ interaction - - if (rsq < cut_ljsq[itype][jtype]) { - r6inv = r2inv*r2inv*r2inv; - forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); - fforce = factor_lj * forcelj*r2inv; - } else fforce = 0.0; - - // total force - - fx = qqrd2e*forcecoulx + delx*fforce; - fy = qqrd2e*forcecouly + dely*fforce; - fz = qqrd2e*forcecoulz + delz*fforce; - - // force & torque accumulation - - f[i][0] += fx; - f[i][1] += fy; - f[i][2] += fz; - torque[i][0] += qqrd2e*tixcoul; - torque[i][1] += qqrd2e*tiycoul; - torque[i][2] += qqrd2e*tizcoul; - - if (newton_pair || j < nlocal) { - f[j][0] -= fx; - f[j][1] -= fy; - f[j][2] -= fz; - torque[j][0] += qqrd2e*tjxcoul; - torque[j][1] += qqrd2e*tjycoul; - torque[j][2] += qqrd2e*tjzcoul; - } - - if (eflag) { - if (rsq < cut_coulsq && factor_coul > 0.0) { - ecoul = qqrd2e*(b0*g0 + b1*g1 + b2*g2); - if (factor_coul < 1.0) { - ecoul *= factor_coul; - ecoul += (1-factor_coul) * qqrd2e * (d0*g0 + d1*g1 + d2*g2); + r2inv = 1.0/rsq; + rinv = sqrt(r2inv); + + if (rsq < cut_coulsq) { + r = sqrt(rsq); + grij = g_ewald * r; + expm2 = exp(-grij*grij); + t = 1.0 / (1.0 + EWALD_P*grij); + erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2; + + pdotp = mu[i][0]*mu[j][0] + mu[i][1]*mu[j][1] + mu[i][2]*mu[j][2]; + pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz; + pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz; + + g0 = qtmp*q[j]; + g1 = qtmp*pjdotr - q[j]*pidotr + pdotp; + g2 = -pidotr*pjdotr; + + if (factor_coul > 0.0) { + b0 = erfc * rinv; + b1 = (b0 + pre1*expm2) * r2inv; + b2 = (3.0*b1 + pre2*expm2) * r2inv; + b3 = (5.0*b2 + pre3*expm2) * r2inv; + + g0b1_g1b2_g2b3 = g0*b1 + g1*b2 + g2*b3; + fdx = delx * g0b1_g1b2_g2b3 - + b1 * (qtmp*mu[j][0] - q[j]*mu[i][0]) + + b2 * (pjdotr*mu[i][0] + pidotr*mu[j][0]); + fdy = dely * g0b1_g1b2_g2b3 - + b1 * (qtmp*mu[j][1] - q[j]*mu[i][1]) + + b2 * (pjdotr*mu[i][1] + pidotr*mu[j][1]); + fdz = delz * g0b1_g1b2_g2b3 - + b1 * (qtmp*mu[j][2] - q[j]*mu[i][2]) + + b2 * (pjdotr*mu[i][2] + pidotr*mu[j][2]); + + zdix = delx * (q[j]*b1 + b2*pjdotr) - b1*mu[j][0]; + zdiy = dely * (q[j]*b1 + b2*pjdotr) - b1*mu[j][1]; + zdiz = delz * (q[j]*b1 + b2*pjdotr) - b1*mu[j][2]; + zdjx = delx * (-qtmp*b1 + b2*pidotr) - b1*mu[i][0]; + zdjy = dely * (-qtmp*b1 + b2*pidotr) - b1*mu[i][1]; + zdjz = delz * (-qtmp*b1 + b2*pidotr) - b1*mu[i][2]; + + if (factor_coul < 1.0) { + fdx *= factor_coul; + fdy *= factor_coul; + fdz *= factor_coul; + zdix *= factor_coul; + zdiy *= factor_coul; + zdiz *= factor_coul; + zdjx *= factor_coul; + zdjy *= factor_coul; + zdjz *= factor_coul; + } + } else { + fdx = fdy = fdz = 0.0; + zdix = zdiy = zdiz = 0.0; + zdjx = zdjy = zdjz = 0.0; + } + + if (factor_coul < 1.0) { + d0 = (erfc - 1.0) * rinv; + d1 = (d0 + pre1*expm2) * r2inv; + d2 = (3.0*d1 + pre2*expm2) * r2inv; + d3 = (5.0*d2 + pre3*expm2) * r2inv; + + g0d1_g1d2_g2d3 = g0*d1 + g1*d2 + g2*d3; + fax = delx * g0d1_g1d2_g2d3 - + d1 * (qtmp*mu[j][0] - q[j]*mu[i][0]) + + d2 * (pjdotr*mu[i][0] + pidotr*mu[j][0]); + fay = dely * g0d1_g1d2_g2d3 - + d1 * (qtmp*mu[j][1] - q[j]*mu[i][1]) + + d2 * (pjdotr*mu[i][1] + pidotr*mu[j][1]); + faz = delz * g0d1_g1d2_g2d3 - + d1 * (qtmp*mu[j][2] - q[j]*mu[i][2]) + + d2 * (pjdotr*mu[i][2] + pidotr*mu[j][2]); + + zaix = delx * (q[j]*d1 + d2*pjdotr) - d1*mu[j][0]; + zaiy = dely * (q[j]*d1 + d2*pjdotr) - d1*mu[j][1]; + zaiz = delz * (q[j]*d1 + d2*pjdotr) - d1*mu[j][2]; + zajx = delx * (-qtmp*d1 + d2*pidotr) - d1*mu[i][0]; + zajy = dely * (-qtmp*d1 + d2*pidotr) - d1*mu[i][1]; + zajz = delz * (-qtmp*d1 + d2*pidotr) - d1*mu[i][2]; + + if (factor_coul > 0.0) { + facm1 = 1.0 - factor_coul; + fax *= facm1; + fay *= facm1; + faz *= facm1; + zaix *= facm1; + zaiy *= facm1; + zaiz *= facm1; + zajx *= facm1; + zajy *= facm1; + zajz *= facm1; + } + } else { + fax = fay = faz = 0.0; + zaix = zaiy = zaiz = 0.0; + zajx = zajy = zajz = 0.0; + } + + forcecoulx = fdx + fax; + forcecouly = fdy + fay; + forcecoulz = fdz + faz; + + tixcoul = mu[i][1]*(zdiz + zaiz) - mu[i][2]*(zdiy + zaiy); + tiycoul = mu[i][2]*(zdix + zaix) - mu[i][0]*(zdiz + zaiz); + tizcoul = mu[i][0]*(zdiy + zaiy) - mu[i][1]*(zdix + zaix); + tjxcoul = mu[j][1]*(zdjz + zajz) - mu[j][2]*(zdjy + zajy); + tjycoul = mu[j][2]*(zdjx + zajx) - mu[j][0]*(zdjz + zajz); + tjzcoul = mu[j][0]*(zdjy + zajy) - mu[j][1]*(zdjx + zajx); + + } else { + forcecoulx = forcecouly = forcecoulz = 0.0; + tixcoul = tiycoul = tizcoul = 0.0; + tjxcoul = tjycoul = tjzcoul = 0.0; + } + + // LJ interaction + + if (rsq < cut_ljsq[itype][jtype]) { + r6inv = r2inv*r2inv*r2inv; + forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]); + fforce = factor_lj * forcelj*r2inv; + } else fforce = 0.0; + + // total force + + fx = qqrd2e*forcecoulx + delx*fforce; + fy = qqrd2e*forcecouly + dely*fforce; + fz = qqrd2e*forcecoulz + delz*fforce; + + // force & torque accumulation + + f[i][0] += fx; + f[i][1] += fy; + f[i][2] += fz; + torque[i][0] += qqrd2e*tixcoul; + torque[i][1] += qqrd2e*tiycoul; + torque[i][2] += qqrd2e*tizcoul; + + if (newton_pair || j < nlocal) { + f[j][0] -= fx; + f[j][1] -= fy; + f[j][2] -= fz; + torque[j][0] += qqrd2e*tjxcoul; + torque[j][1] += qqrd2e*tjycoul; + torque[j][2] += qqrd2e*tjzcoul; } - } else ecoul = 0.0; - if (rsq < cut_ljsq[itype][jtype]) { - evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) - - offset[itype][jtype]; - evdwl *= factor_lj; - } else evdwl = 0.0; - } + if (eflag) { + if (rsq < cut_coulsq && factor_coul > 0.0) { + ecoul = qqrd2e*(b0*g0 + b1*g1 + b2*g2); + if (factor_coul < 1.0) { + ecoul *= factor_coul; + ecoul += (1-factor_coul) * qqrd2e * (d0*g0 + d1*g1 + d2*g2); + } + } else ecoul = 0.0; + + if (rsq < cut_ljsq[itype][jtype]) { + evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) - + offset[itype][jtype]; + evdwl *= factor_lj; + } else evdwl = 0.0; + } - if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair, - evdwl,ecoul,fx,fy,fz,delx,dely,delz); + if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair, + evdwl,ecoul,fx,fy,fz,delx,dely,delz); } } } @@ -360,8 +360,8 @@ void PairLJCutDipoleLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } @@ -407,7 +407,7 @@ double PairLJCutDipoleLong::init_one(int i, int j) { if (setflag[i][j] == 0) { epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j], - sigma[i][i],sigma[j][j]); + sigma[i][i],sigma[j][j]); sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]); cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]); } @@ -472,9 +472,9 @@ void PairLJCutDipoleLong::write_restart(FILE *fp) for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { - fwrite(&epsilon[i][j],sizeof(double),1,fp); - fwrite(&sigma[i][j],sizeof(double),1,fp); - fwrite(&cut_lj[i][j],sizeof(double),1,fp); + fwrite(&epsilon[i][j],sizeof(double),1,fp); + fwrite(&sigma[i][j],sizeof(double),1,fp); + fwrite(&cut_lj[i][j],sizeof(double),1,fp); } } } @@ -496,14 +496,14 @@ void PairLJCutDipoleLong::read_restart(FILE *fp) if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) { - fread(&epsilon[i][j],sizeof(double),1,fp); - fread(&sigma[i][j],sizeof(double),1,fp); - fread(&cut_lj[i][j],sizeof(double),1,fp); - } - MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); - MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); - MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world); + if (me == 0) { + fread(&epsilon[i][j],sizeof(double),1,fp); + fread(&sigma[i][j],sizeof(double),1,fp); + fread(&cut_lj[i][j],sizeof(double),1,fp); + } + MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); + MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); + MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world); } } } diff --git a/src/DIPOLE/pair_lj_long_dipole_long.cpp b/src/DIPOLE/pair_lj_long_dipole_long.cpp index ef865b66cd50efd89d75a8c5b5d5e24770d99d07..15ac2e788cf75fab24577733bc00ad6afb78947a 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_long_dipole_long.cpp @@ -102,8 +102,8 @@ void PairLJLongDipoleLong::settings(int narg, char **arg) if (allocated) { // reset explicit cuts int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } @@ -343,9 +343,9 @@ void PairLJLongDipoleLong::write_restart(FILE *fp) for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); if (setflag[i][j]) { - fwrite(&epsilon_read[i][j],sizeof(double),1,fp); - fwrite(&sigma_read[i][j],sizeof(double),1,fp); - fwrite(&cut_lj_read[i][j],sizeof(double),1,fp); + fwrite(&epsilon_read[i][j],sizeof(double),1,fp); + fwrite(&sigma_read[i][j],sizeof(double),1,fp); + fwrite(&cut_lj_read[i][j],sizeof(double),1,fp); } } } @@ -367,14 +367,14 @@ void PairLJLongDipoleLong::read_restart(FILE *fp) if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) { - fread(&epsilon_read[i][j],sizeof(double),1,fp); - fread(&sigma_read[i][j],sizeof(double),1,fp); - fread(&cut_lj_read[i][j],sizeof(double),1,fp); - } - MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world); - MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world); - MPI_Bcast(&cut_lj_read[i][j],1,MPI_DOUBLE,0,world); + if (me == 0) { + fread(&epsilon_read[i][j],sizeof(double),1,fp); + fread(&sigma_read[i][j],sizeof(double),1,fp); + fread(&cut_lj_read[i][j],sizeof(double),1,fp); + } + MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world); + MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world); + MPI_Bcast(&cut_lj_read[i][j],1,MPI_DOUBLE,0,world); } } } diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index dc85c39832cd0028c864f842b99f9047ae9bf25e..0771572e46b9bb399437672e511cb58392c79cc6 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -241,7 +241,7 @@ void PairCoulDebyeKokkos<DeviceType>::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/KSPACE/pair_born_coul_long.cpp index 14d43f4c6383fcb1dcc82e9fbbb89f6823f62ba7..e588a30b55aed1ec2813c6830b9cf49effc7f499 100644 --- a/src/KSPACE/pair_born_coul_long.cpp +++ b/src/KSPACE/pair_born_coul_long.cpp @@ -250,7 +250,7 @@ void PairBornCoulLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp index 9cd8485e5ccbcc849e26543f5fbcbea516317ac4..476e3c716a84f0c45f492963a165762f88d011b9 100644 --- a/src/KSPACE/pair_buck_coul_long.cpp +++ b/src/KSPACE/pair_buck_coul_long.cpp @@ -240,7 +240,7 @@ void PairBuckCoulLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index 26bcb136b33bf52bf1e27f0eda0194618aa0d8f9..8aa4d720839f00e2ea05f1a338009592754c2f96 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -104,7 +104,7 @@ void PairBuckLongCoulLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_buck[i][j] = cut_buck_global; } } diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 764aebc522b54b4483271e8c815994a7c19fcc40..e9799843fc2b9a80b6c5019a5c99e9efca895996 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -608,7 +608,7 @@ void PairLJCutCoulLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp index 146d4e6f376f5a27b6e8dd9c742f5d1fc31ed031..588d21ac66be082e4bb9c8412bddd39261fc54fa 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp @@ -450,7 +450,7 @@ void PairLJCutTIP4PLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index e474347935fed35e81768c76735114d9cecae734..44256a9fbb7f3e8481955ef29c0f4dd410e8ed63 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -103,7 +103,7 @@ void PairLJLongCoulLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp index c3d95c37a6c26e27268cf5ecc0e4ee0587534f6d..fd318fd75bd56052e23d458e26c7c60f8fd26a7e 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp @@ -1439,8 +1439,8 @@ void PairLJLongTIP4PLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp index 344faf87f62bff5da684c9b77f694877782513e4..29ecde202369a009a52bcea40d3f00acddfe0401 100644 --- a/src/MC/pair_dsmc.cpp +++ b/src/MC/pair_dsmc.cpp @@ -230,7 +230,7 @@ void PairDSMC::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/MISC/pair_nm_cut.cpp b/src/MISC/pair_nm_cut.cpp index 467be1b7bedb369c86d93bced6f0f28e365f8bcb..0163cdcf588893d15cb253fe3c2bdd34d24f5de6 100644 --- a/src/MISC/pair_nm_cut.cpp +++ b/src/MISC/pair_nm_cut.cpp @@ -187,7 +187,7 @@ void PairNMCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/MISC/pair_nm_cut_coul_cut.cpp b/src/MISC/pair_nm_cut_coul_cut.cpp index 86fa09f176700239016bfca52e83f4e7859c0349..5cb2452906cee3f7cdccf9ff6a6f2dc646857789 100644 --- a/src/MISC/pair_nm_cut_coul_cut.cpp +++ b/src/MISC/pair_nm_cut_coul_cut.cpp @@ -213,7 +213,7 @@ void PairNMCutCoulCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_lj[i][j] = cut_lj_global; cut_coul[i][j] = cut_coul_global; diff --git a/src/MISC/pair_nm_cut_coul_long.cpp b/src/MISC/pair_nm_cut_coul_long.cpp index c186d19539da00ec8448b1d7e8e5e1724ccb7b93..15d5d0375796d74b54f5cba141ca25f52db27378 100644 --- a/src/MISC/pair_nm_cut_coul_long.cpp +++ b/src/MISC/pair_nm_cut_coul_long.cpp @@ -255,7 +255,7 @@ void PairNMCutCoulLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index 15f5d52961e71cf2254a53e45ec34a8a120f2ec5..e3093e4d103c49deeb34e28b8fe3a56fe92a370a 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -441,7 +441,7 @@ void PairLJCutTIP4PCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } @@ -596,7 +596,7 @@ void PairLJCutTIP4PCut::write_restart(FILE *fp) for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j],sizeof(int),1,fp); - if (setflag[i][j]){ + if (setflag[i][j]) { fwrite(&epsilon[i][j],sizeof(double),1,fp); fwrite(&sigma[i][j],sizeof(double),1,fp); fwrite(&cut_lj[i][j],sizeof(double),1,fp); diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index cd89c3984d536b9373e51c0ee868dac30b68e3d5..2ce1a926845721c8fc10fe001585f99de5dae2b7 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -454,16 +454,6 @@ void PairAWPMDCut::settings(int narg, char **arg){ else if(!strcmp(arg[i],"flex_press")) flexible_pressure_flag = 1; } - - - // reset cutoffs that have been explicitly set - /* - if (allocated) { - int i,j; - for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) cut[i][j] = cut_global; - }*/ } /* ---------------------------------------------------------------------- @@ -489,7 +479,7 @@ void PairAWPMDCut::coeff(int narg, char **arg) else{ int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } diff --git a/src/USER-CGSDK/pair_lj_sdk.cpp b/src/USER-CGSDK/pair_lj_sdk.cpp index 665f188ce9d740d50a86fdc879f91420c15875f6..23b0f47a6d6613dfa47da1282a3829292a006bd8 100644 --- a/src/USER-CGSDK/pair_lj_sdk.cpp +++ b/src/USER-CGSDK/pair_lj_sdk.cpp @@ -248,7 +248,7 @@ void PairLJSDK::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp index 5e4a0db31c721b19f262c99396f6915cd7c8d789..845c5822a7fadd2015d86100970e0ebe217636b0 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp @@ -308,7 +308,7 @@ void PairLJSDKCoulLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/USER-DPD/pair_dpd_fdt.cpp b/src/USER-DPD/pair_dpd_fdt.cpp index e7e9febd824994027fc34610ca8208ca6531573e..26f5806cf1331f1c57fc69300654b9e389da61ab 100644 --- a/src/USER-DPD/pair_dpd_fdt.cpp +++ b/src/USER-DPD/pair_dpd_fdt.cpp @@ -267,7 +267,7 @@ void PairDPDfdt::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-DPD/pair_dpd_fdt_energy.cpp b/src/USER-DPD/pair_dpd_fdt_energy.cpp index 569588b6fdcc85eea5f6634416176ade8e845dc0..c3fc7fb3f510509e0a8736efe3081b5e6a59fd83 100644 --- a/src/USER-DPD/pair_dpd_fdt_energy.cpp +++ b/src/USER-DPD/pair_dpd_fdt_energy.cpp @@ -351,7 +351,7 @@ void PairDPDfdtEnergy::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-DPD/pair_exp6_rx.cpp b/src/USER-DPD/pair_exp6_rx.cpp index deff0d34e98251789d1ee6028dd46a606c5af13a..61b62efc53595706d82ba2e02e3bb3ed1d36846b 100644 --- a/src/USER-DPD/pair_exp6_rx.cpp +++ b/src/USER-DPD/pair_exp6_rx.cpp @@ -562,7 +562,7 @@ void PairExp6rx::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp index 671de7090b3f9ba3e79cadcd98cb43576c3d7cd0..a74f51477c64e8a4fa12a741ffdcda72f36e476e 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp @@ -295,11 +295,11 @@ void PairLJCutTholeLong::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) { - thole[i][j] = thole_global; - cut_lj[i][j] = cut_lj_global; - } + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) { + thole[i][j] = thole_global; + cut_lj[i][j] = cut_lj_global; + } } } diff --git a/src/USER-DRUDE/pair_thole.cpp b/src/USER-DRUDE/pair_thole.cpp index 0ed94ebbc919b3b5be5d691caa15d86edede5989..abb37b82b766581aafadb5519f76169ca8289491 100644 --- a/src/USER-DRUDE/pair_thole.cpp +++ b/src/USER-DRUDE/pair_thole.cpp @@ -199,11 +199,11 @@ void PairThole::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) { - thole[i][j] = thole_global; - cut[i][j] = cut_global; - } + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) { + thole[i][j] = thole_global; + cut[i][j] = cut_global; + } } } diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index 66f59c86c31aee1fe3b1d6ffc0f4bc352b16000e..850c52362967721bf00248aa0474d4a7d67efd18 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -846,7 +846,7 @@ void PairEffCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-FEP/pair_coul_cut_soft.cpp b/src/USER-FEP/pair_coul_cut_soft.cpp index 2c675c607f4fee76bc93a8830a640e4c6f4a0941..a7ac8004fe631c576d9e5cc3b58106dd6d997356 100644 --- a/src/USER-FEP/pair_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_coul_cut_soft.cpp @@ -168,7 +168,7 @@ void PairCoulCutSoft::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp index 16da07a657214b2b3be32010ea058dfe4a029d3a..b2e781c57b2de74da87c02a4e91c95e8bf60ff54 100644 --- a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp @@ -211,7 +211,7 @@ void PairLJCutCoulCutSoft::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_lj[i][j] = cut_lj_global; cut_coul[i][j] = cut_coul_global; diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index 6636e727159be3c3a85c69a5e57a48d08305b72c..3b80729b0ba8c8cdc20ed4ff2d088d5edcbacf96 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -582,7 +582,7 @@ void PairLJCutCoulLongSoft::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 3798b279369e56a98cf5584b5eb6c3483e3af7e3..800fdfcde810e8cdff76da307039b3377583f726 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -462,7 +462,7 @@ void PairLJCutSoft::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index 5beed08b725fef82aca820c72e7ac33bdf18448d..8d9162e564097a44c68960ee2d28eb7746b856fc 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -436,7 +436,7 @@ void PairLJCutTIP4PLongSoft::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index 6c86d8916fb1611c001f7f13c8fff46fe5390b37..1333bc28ca947075eeb439458db0870f53c5809a 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -222,7 +222,7 @@ void PairMorseSoft::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-MISC/pair_buck_mdf.cpp b/src/USER-MISC/pair_buck_mdf.cpp index 3a433b16bd1daaca6179f825a23247d84939a93c..6c3dcbd7ee852a54d4e67117055ac714f165a7e3 100644 --- a/src/USER-MISC/pair_buck_mdf.cpp +++ b/src/USER-MISC/pair_buck_mdf.cpp @@ -197,7 +197,7 @@ void PairBuckMDF::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-MISC/pair_coul_diel.cpp b/src/USER-MISC/pair_coul_diel.cpp index a732ace1a0ab04d836e8c48cfc7687056283a33b..a62362aa6f1622a9e40e3551d2122f5e93126667 100644 --- a/src/USER-MISC/pair_coul_diel.cpp +++ b/src/USER-MISC/pair_coul_diel.cpp @@ -168,7 +168,7 @@ void PairCoulDiel::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index f44b1bbd2d0d16a2fcc249d33ea3d1ed675de768..3836187a648fd5c75c5d7e6c43a281506bd6dba9 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -175,7 +175,7 @@ void PairGaussCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp index ddb39f6870ad0a9968d739e32bf137207640150b..15a325e106f3e9dff0414a8899c8695cd57f7aeb 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp @@ -209,7 +209,7 @@ void PairKolmogorovCrespiZ::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-MISC/pair_lennard_mdf.cpp b/src/USER-MISC/pair_lennard_mdf.cpp index 3a81955199d1e19c8b7506b8e3f0405250b3b6a9..b959f513c0cec33e496b4c324eacb85ad50c9501 100644 --- a/src/USER-MISC/pair_lennard_mdf.cpp +++ b/src/USER-MISC/pair_lennard_mdf.cpp @@ -197,7 +197,7 @@ void PairLJ_AB_MDF::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_inner[i][j] = cut_inner_global; cut[i][j] = cut_global; diff --git a/src/USER-MISC/pair_lj_mdf.cpp b/src/USER-MISC/pair_lj_mdf.cpp index 3b52cf0b86f84227581daecab051d73899d9d5e1..ebec1f80e1f75dd827fc6a9fb2f5cf10238db084 100644 --- a/src/USER-MISC/pair_lj_mdf.cpp +++ b/src/USER-MISC/pair_lj_mdf.cpp @@ -197,7 +197,7 @@ void PairLJMDF::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_inner[i][j] = cut_inner_global; cut[i][j] = cut_global; diff --git a/src/USER-MISC/pair_lj_sf.cpp b/src/USER-MISC/pair_lj_sf.cpp index 32f45ff48d181b80e856a7b5d515ce85110fa740..a34119f880b89e5dcdb599d5ad458c922a4c853c 100644 --- a/src/USER-MISC/pair_lj_sf.cpp +++ b/src/USER-MISC/pair_lj_sf.cpp @@ -181,7 +181,7 @@ void PairLJShiftedForce::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp index 33f10f2f12ad51889ded6c00c1cf247d88e89d33..fb63638b52699676baa643d2366d0a7fa67910a1 100644 --- a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp +++ b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp @@ -342,7 +342,7 @@ void PairLJSFDipoleSF::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_lj[i][j] = cut_lj_global; cut_coul[i][j] = cut_coul_global; diff --git a/src/USER-MISC/pair_momb.cpp b/src/USER-MISC/pair_momb.cpp index b7337c17a8025feb08eefd258d7ad6517d4c2623..0d8d2e060eb7bc13317eb095118ce8428e2a9a4c 100644 --- a/src/USER-MISC/pair_momb.cpp +++ b/src/USER-MISC/pair_momb.cpp @@ -199,7 +199,7 @@ void PairMomb::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-MISC/pair_morse_smooth_linear.cpp b/src/USER-MISC/pair_morse_smooth_linear.cpp index 3857ad47e776ddac1b18020257f6accdb51c8e63..3e776e7e1ce472f2c6962e641b1e6eee355676ea 100644 --- a/src/USER-MISC/pair_morse_smooth_linear.cpp +++ b/src/USER-MISC/pair_morse_smooth_linear.cpp @@ -171,7 +171,7 @@ void PairMorseSmoothLinear::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index 18ea4dc332ed971477b83cb98b0d8ee6674eadad..46c53349fab8de3d29648667d9b34de8cdfced03 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -408,7 +408,7 @@ void PairSRP::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= bptype; i++) - for (j = i+1; j <= bptype; j++) + for (j = i; j <= bptype; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_beck.cpp b/src/pair_beck.cpp index e3e8b0c5cc3d679e4ca7fbdb2e96c4d2b8ca6299..36e44e5c2ebc5203f97a8fc20041fe3b07fbfd25 100644 --- a/src/pair_beck.cpp +++ b/src/pair_beck.cpp @@ -181,10 +181,8 @@ void PairBeck::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) { - cut[i][j] = cut_global; - } + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_born.cpp b/src/pair_born.cpp index 5fc26e2529f11552cf2085f627f4a4627dd74f44..6d420fb36be8eebe621f4555c1e4177ddbf01a82 100644 --- a/src/pair_born.cpp +++ b/src/pair_born.cpp @@ -185,7 +185,7 @@ void PairBorn::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_born_coul_dsf.cpp b/src/pair_born_coul_dsf.cpp index 87c2a14baa2ce271724a03c896f3bef76be6ad8b..caec95759a5bfa0da21bae480c65a28201a33583 100644 --- a/src/pair_born_coul_dsf.cpp +++ b/src/pair_born_coul_dsf.cpp @@ -226,9 +226,8 @@ void PairBornCoulDSF::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) - cut_lj[i][j] = cut_lj_global; + for (j = i; j <= atom->ntypes; j++) + if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/pair_born_coul_wolf.cpp b/src/pair_born_coul_wolf.cpp index 31c0cc715c661ef625ac7300c0436456045071e0..bad0c5ed3eab9a270e51931a86398055c5791999 100644 --- a/src/pair_born_coul_wolf.cpp +++ b/src/pair_born_coul_wolf.cpp @@ -229,7 +229,7 @@ void PairBornCoulWolf::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } } diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp index ac15e82020590eed35d7f530ebe97185090d6696..e4da772e0abb38d9d4475a50bd52f3a52ae13049 100644 --- a/src/pair_buck.cpp +++ b/src/pair_buck.cpp @@ -176,7 +176,7 @@ void PairBuck::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index 7c948f58a8e6c323e448d94c3a0df9eec557eaa8..c052c3100adcd8553bdc04b01996100cecec646b 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -205,7 +205,7 @@ void PairBuckCoulCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_lj[i][j] = cut_lj_global; cut_coul[i][j] = cut_coul_global; diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp index fec592bb191e079c2e5bca23179622a00328ca82..b505dcb02ce5836c8edc0a2e568a622634e67474 100644 --- a/src/pair_coul_cut.cpp +++ b/src/pair_coul_cut.cpp @@ -155,7 +155,7 @@ void PairCoulCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_coul_debye.cpp b/src/pair_coul_debye.cpp index dcb84d7e2d2b4e54d64be367a9a74a40799688f5..df4555753f2c5782060892cf2ec13e794acefb9e 100644 --- a/src/pair_coul_debye.cpp +++ b/src/pair_coul_debye.cpp @@ -126,7 +126,7 @@ void PairCoulDebye::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp index b5b959f85b62a3d57ef5c8de1dacc94cdaf84a66..61f700a33ecda8c04197d5055d9ef4df1bdfbc75 100644 --- a/src/pair_dpd.cpp +++ b/src/pair_dpd.cpp @@ -207,7 +207,7 @@ void PairDPD::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_dpd_tstat.cpp b/src/pair_dpd_tstat.cpp index 6d8f75d95d61a5e7b852d4198b61a4d38404cf88..0a5ebd33f85728d573097d354662dab87fa60ed7 100644 --- a/src/pair_dpd_tstat.cpp +++ b/src/pair_dpd_tstat.cpp @@ -159,7 +159,7 @@ void PairDPDTstat::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp index c8f6afdacc6853e7df8b697d46958e2053015131..c66cfc2c8058dd424ea204d415641b74870496fa 100644 --- a/src/pair_gauss.cpp +++ b/src/pair_gauss.cpp @@ -173,7 +173,7 @@ void PairGauss::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index 1f79226e649f0fc9d3be8b9225e97afa1afe6c0e..f4b2747d40dd781a8f0bd171e6f908f5e862335b 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -442,7 +442,7 @@ void PairLJ96Cut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_lj_cubic.cpp b/src/pair_lj_cubic.cpp index 633c12019ea312d294d1e10084427800da6772a9..c96d4490cbddf7cbaabb5314f46d32627a1842e5 100644 --- a/src/pair_lj_cubic.cpp +++ b/src/pair_lj_cubic.cpp @@ -179,14 +179,8 @@ void PairLJCubic::settings(int narg, char **arg) { if (narg != 0) error->all(FLERR,"Illegal pair_style command"); - // reset cutoffs that have been explicitly set - - if (allocated) { - int i,j; - for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - if (setflag[i][j]) cut[i][j] = 0.0; - } + // NOTE: lj/cubic has no global cutoff. instead the cutoff is + // inferred from the lj parameters. so we must not reset cutoffs here. } /* ---------------------------------------------------------------------- diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index bffdd7fff45fe3894a50215dad42a0034ab631c8..a3ebf414c9b0c3af0353c34f20eb4ceb16abaf65 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -436,7 +436,7 @@ void PairLJCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp index 0d2bff3c9f8c96941215bb16d3b3a83dfb60a118..0d62c43dc30596592383c85baf04e9589f4e0755 100644 --- a/src/pair_lj_cut_coul_cut.cpp +++ b/src/pair_lj_cut_coul_cut.cpp @@ -198,7 +198,7 @@ void PairLJCutCoulCut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_lj[i][j] = cut_lj_global; cut_coul[i][j] = cut_coul_global; diff --git a/src/pair_lj_cut_coul_dsf.cpp b/src/pair_lj_cut_coul_dsf.cpp index 538336d8e648f4964dd8db46f1e20f200dd135c1..09293a6f4c0c4154417eca50384c675f78e38161 100644 --- a/src/pair_lj_cut_coul_dsf.cpp +++ b/src/pair_lj_cut_coul_dsf.cpp @@ -224,7 +224,7 @@ void PairLJCutCoulDSF::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut_lj[i][j] = cut_lj_global; } diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp index 90f1ae0df29abbcb81e50cc7c4f622bdc3ce20f1..2fd780472a24c9f84073191b0411f832cc93ba1a 100644 --- a/src/pair_lj_expand.cpp +++ b/src/pair_lj_expand.cpp @@ -179,7 +179,7 @@ void PairLJExpand::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp index bb0a6e647e8f76cbe892c6f61af042c97596825b..3375c6c4e203ea41a14c4587e1f2fe99da952e87 100644 --- a/src/pair_lj_gromacs.cpp +++ b/src/pair_lj_gromacs.cpp @@ -204,7 +204,7 @@ void PairLJGromacs::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_inner[i][j] = cut_inner_global; cut[i][j] = cut_global; diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp index c59b35aebf87287ce0c6b6afdb05cafac9f4f4a0..1afaef9235a6c0ddbf837bbcb58db5bbeb798817 100644 --- a/src/pair_lj_smooth.cpp +++ b/src/pair_lj_smooth.cpp @@ -206,7 +206,7 @@ void PairLJSmooth::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) { cut_inner[i][j] = cut_inner_global; cut[i][j] = cut_global; diff --git a/src/pair_lj_smooth_linear.cpp b/src/pair_lj_smooth_linear.cpp index 189475aa71bd62e2598890cbac33db48c39a3496..415ca7b6d3650a1b2f71f8060da75f47221eb3c1 100644 --- a/src/pair_lj_smooth_linear.cpp +++ b/src/pair_lj_smooth_linear.cpp @@ -175,7 +175,7 @@ void PairLJSmoothLinear::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } diff --git a/src/pair_mie_cut.cpp b/src/pair_mie_cut.cpp index 3c13c19a3bcde8ba1604d0930bf3c9be947a26f2..312fb7bc700a6365c9ade1ada569898ea5f7e43b 100644 --- a/src/pair_mie_cut.cpp +++ b/src/pair_mie_cut.cpp @@ -447,7 +447,7 @@ void PairMIECut::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp index 2144ad5008b96a40c78bdd641e73f058069deec8..5f906420653530a824ea38541056af259e157e13 100644 --- a/src/pair_morse.cpp +++ b/src/pair_morse.cpp @@ -165,7 +165,7 @@ void PairMorse::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp index 8ffd1393077f82e0e9db88fe5f7a65519b536961..b05058b4dcdc20699f0d4892b31f7c8bdfd28554 100644 --- a/src/pair_soft.cpp +++ b/src/pair_soft.cpp @@ -158,7 +158,7 @@ void PairSoft::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } } diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index a38e2aa8808aa1a9f1ada33654d2328783c2d7f7..0e5fd36cd6377e539596978739cc11ccf2f4f648 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -162,7 +162,7 @@ void PairYukawa::settings(int narg, char **arg) if (allocated) { int i,j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) + for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; } }