Commit 09c2dec7 authored by Sievers's avatar Sievers
Browse files

Fixed small non chemsnap multielement bug

parent 98c89363
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -162,7 +162,10 @@ void PairSNAP::compute(int eflag, int vflag)

    // compute Ui, Yi for atom I

    if (alloyflag)
      snaptr->compute_ui(ninside, ielem);
    else
      snaptr->compute_ui(ninside, 0);

    // for neighbors of I within cutoff:
    // compute Fij = dEi/dRj = -dEi/dRi
@@ -175,8 +178,12 @@ void PairSNAP::compute(int eflag, int vflag)

    for (int jj = 0; jj < ninside; jj++) {
      int j = snaptr->inside[jj];
      if(alloyflag)
        snaptr->compute_duidrj(snaptr->rij[jj], snaptr->wj[jj],
                               snaptr->rcutij[jj],jj, snaptr->element[jj]);
      else
        snaptr->compute_duidrj(snaptr->rij[jj], snaptr->wj[jj],
                               snaptr->rcutij[jj],jj, 0);

      snaptr->compute_deidrj(fij);

@@ -329,9 +336,15 @@ void PairSNAP::compute_bispectrum()
      }
    }

    if (alloyflag)
      snaptr->compute_ui(ninside, ielem);
    else
      snaptr->compute_ui(ninside, 0);
    snaptr->compute_zi();
    if (alloyflag)
      snaptr->compute_bi(ielem);
    else
      snaptr->compute_bi(0);

    for (int icoeff = 0; icoeff < ncoeff; icoeff++){
      bispectrum[ii][icoeff] = snaptr->blist[icoeff];
+9 −2
Original line number Diff line number Diff line
@@ -120,7 +120,11 @@ SNA::SNA(LAMMPS* lmp, double rfac0_in, int twojmax_in,
  bnorm_flag = alloy_flag_in;
  alloy_flag = alloy_flag_in;
  wselfall_flag = wselfall_flag_in;

  if (alloy_flag)
    nelements = nelements_in;
  else
    nelements = 1;

  twojmax = twojmax_in;

@@ -347,7 +351,10 @@ void SNA::compute_ui(int jnum, int ielem)
    z0 = r / tan(theta0);

    compute_uarray(x, y, z, z0, r, j);
    if (alloy_flag)
      add_uarraytot(r, wj[j], rcutij[j], j, element[j]);
    else
      add_uarraytot(r, wj[j], rcutij[j], j, 0);
  }

}