Unverified Commit 322c244b authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1456 from akohlmey/fix-mapping-for-KC-etc

Fix element mapping and a few other issues for interlayer potentials 
parents 60f6c3f3 e228555a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ pair_style hybrid/overlay ilp/graphene/hbn 16.0 1
pair_coeff * * ilp/graphene/hbn  BNCH.ILP B N C :pre

pair_style  hybrid/overlay rebo tersoff ilp/graphene/hbn 16.0 coul/shield 16.0
pair_coeff  * * rebo                 CH.airebo   NULL NULL C
pair_coeff  * * rebo                 CH.rebo     NULL NULL C
pair_coeff  * * tersoff              BNC.tersoff B    N    NULL
pair_coeff  * * ilp/graphene/hbn     BNCH.ILP    B    N    C
pair_coeff  1 1 coul/shield 0.70
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ pair_coeff * * none
pair_coeff * * kolmogorov/crespi/full  CH.KC   C C :pre

pair_style hybrid/overlay rebo kolmogorov/crespi/full 16.0 1
pair_coeff * * rebo                    CH.airebo    C H
pair_coeff * * rebo                    CH.rebo      C H
pair_coeff * * kolmogorov/crespi/full  CH_taper.KC  C H :pre

[Description:]
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ pair_coeff * * none
pair_coeff 1 2 kolmogorov/crespi/z  CC.KC   C C :pre

pair_style hybrid/overlay rebo kolmogorov/crespi/z 14.0
pair_coeff * * rebo                 CH.airebo  C C
pair_coeff * * rebo                 CH.rebo    C C
pair_coeff 1 2 kolmogorov/crespi/z  CC.KC      C C :pre

[Description:]
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ pair_coeff * * none
pair_coeff 1 2 lebedeva/z  CC.Lebedeva   C C :pre

pair_style hybrid/overlay rebo lebedeva/z 14.0
pair_coeff * * rebo                 CH.airebo  C C
pair_coeff * * rebo        CH.rebo       C C
pair_coeff 1 2 lebedeva/z  CC.Lebedeva   C C :pre

[Description:]
+22 −12
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;
}
@@ -801,9 +801,10 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg)
    error->all(FLERR,"Incorrect args for pair coefficients");
  if (!allocated) allocate();

  int ilo,ihi,jlo,jhi;
  force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
  force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);
  // insure I,J args are * *

  if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
    error->all(FLERR,"Incorrect args for pair coefficients");

  // read args that map atom types to elements in potential file
  // map[i] = which element the Ith atom type is, -1 if NULL
@@ -837,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");
}
@@ -859,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]];
Loading