From c504d93e3ce583f42698538b12939722579955fd Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Sun, 17 Nov 2019 19:23:14 -0700 Subject: [PATCH] Found an error in energy row that only affected ntypes > 1 --- src/SNAP/compute_snap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index 2a535d5a2b..2442e33641 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -387,17 +387,17 @@ void ComputeSnap::compute_array() // linear contributions for (int icoeff = 0; icoeff < ncoeff; icoeff++) - snap[0][icoeff] += snaptr->blist[icoeff]; + snap[0][icoeff+typeoffset_global] += snaptr->blist[icoeff]; // quadratic contributions if (quadraticflag) { for (int icoeff = 0; icoeff < ncoeff; icoeff++) { double bveci = snaptr->blist[icoeff]; - snap[0][icoeff] += 0.5*bveci*bveci; + snap[0][icoeff+typeoffset_global] += 0.5*bveci*bveci; for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) { double bvecj = snaptr->blist[jcoeff]; - snap[0][icoeff] += bveci*bvecj; + snap[0][icoeff+typeoffset_global] += bveci*bvecj; } } }