Unverified Commit b2942cba authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

correctly handle coeff statement for ilp/graphene/hbn

parent c8635996
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ PairILPGrapheneHBN::PairILPGrapheneHBN(LAMMPS *lmp) : Pair(lmp)
  // always compute energy offset
  offset_flag = 1;

  // set comm size needed by this Pair
  // set comm size needed by this pair style
  comm_forward = 39;
  tap_flag = 1;
}
@@ -838,16 +838,23 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg)

  read_file(arg[2]);

  double cut_one = cut_global;
  // clear setflag since coeff() called once with I,J = * *

  n = atom->ntypes;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      setflag[i][j] = 0;

  // set setflag i,j for type pairs where both are mapped to elements

  int count = 0;
  for (int i = ilo; i <= ihi; i++) {
    for (int j = MAX(jlo,i); j <= jhi; j++) {
      cut[i][j] = cut_one;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      if (map[i] >= 0 && map[j] >= 0) {
        setflag[i][j] = 1;
        cut[i][j] = cut_global;
        count++;
      }
  }

  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
@@ -860,6 +867,8 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg)
double PairILPGrapheneHBN::init_one(int i, int j)
{
  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
  if (!offset_flag)
    error->all(FLERR,"Must use 'pair_modify shift yes' with this pair style");

  if (offset_flag  && (cut[i][j] > 0.0)) {
    int iparam_ij = elem2param[map[i]][map[j]];
+0 −1
Original line number Diff line number Diff line
@@ -260,7 +260,6 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg)
    }
  }


  read_file(arg[2]);

  // clear setflag since coeff() called once with I,J = * *