Unverified Commit 23a8b343 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2267 from abhiShandy/force-tests

unit tests for beck, morse, few LJ derivatives, few buck/coul and born/coul
parents 75dcd9ae bbb4c396
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ void PairBuckCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr)
          forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
        } else forcebuck = 0.0;

        fpair = (forcecoul + factor_lj*forcebuck)*r2inv;
        fpair = (factor_coul*forcecoul + factor_lj*forcebuck)*r2inv;

        fxtmp += delx*fpair;
        fytmp += dely*fpair;
+1 −2
Original line number Diff line number Diff line
@@ -69,8 +69,7 @@ void PairBuckCoulCut::compute(int eflag, int vflag)
{
  int i,j,ii,jj,inum,jnum,itype,jtype;
  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
  double rsq,r2inv,r6inv,forcecoul,forcebuck,factor_coul,factor_lj;
  double r,rexp;
  double rsq,r2inv,r6inv,r,rexp,forcecoul,forcebuck,factor_coul,factor_lj;
  int *ilist,*jlist,*numneigh,**firstneigh;

  evdwl = ecoul = 0.0;
+17 −11
Original line number Diff line number Diff line
@@ -129,8 +129,7 @@ void PairLJCubic::compute(int eflag, int vflag)
          if (rsq <= cut_inner_sq[itype][jtype])
            evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
          else
            evdwl = epsilon[itype][jtype]*
              (PHIS + DPHIDS*t - A3*t*t*t/6.0);
            evdwl = epsilon[itype][jtype]*(PHIS + DPHIDS*t - A3*t*t*t/6.0);
          evdwl *= factor_lj;

          if (evflag) ev_tally(i,j,nlocal,newton_pair,
@@ -222,10 +221,11 @@ void PairLJCubic::coeff(int narg, char **arg)
double PairLJCubic::init_one(int i, int j)
{
  if (setflag[i][j] == 0) {
    epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
    epsilon[i][j] = epsilon[j][i] = mix_energy(epsilon[i][i],epsilon[j][j],
                                               sigma[i][i],sigma[j][j]);
    sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
    cut_inner[i][j] = mix_distance(cut_inner[i][i],cut_inner[j][j]);
    sigma[i][j] = sigma[j][i] = mix_distance(sigma[i][i],sigma[j][j]);
    cut_inner[i][j] = cut_inner[j][i] = mix_distance(cut_inner[i][i],
                                                     cut_inner[j][j]);
    cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
  }

@@ -329,6 +329,13 @@ double PairLJCubic::single(int /*i*/, int /*j*/, int itype, int jtype,
  double r,t;
  double rmin;

  // this is a truncated potential with an implicit cutoff

  if (rsq >= cutsq[itype][jtype]) {
    fforce=0.0;
    return 0.0;
  }

  r2inv = 1.0/rsq;
  if (rsq <= cut_inner_sq[itype][jtype]) {
    r6inv = r2inv*r2inv*r2inv;
@@ -344,8 +351,7 @@ double PairLJCubic::single(int /*i*/, int /*j*/, int itype, int jtype,
  if (rsq <= cut_inner_sq[itype][jtype])
    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
  else
    philj = epsilon[itype][jtype]*
      (PHIS + DPHIDS*t - A3*t*t*t/6.0);
    philj = epsilon[itype][jtype]*(PHIS + DPHIDS*t - A3*t*t*t/6.0);

  return factor_lj*philj;
}
+1 −0
Original line number Diff line number Diff line
@@ -306,6 +306,7 @@ double PairLJCutCoulWolf::init_one(int i, int j)
  lj3[j][i] = lj3[i][j];
  lj4[j][i] = lj4[i][j];
  offset[j][i] = offset[i][j];
  cut_ljsq[j][i] = cut_ljsq[i][j];

  // compute I,J contribution to long-range tail correction
  // count total # of atoms of type I and J via Allreduce
+1 −1
Original line number Diff line number Diff line
@@ -339,7 +339,7 @@ void PairZBL::read_restart_settings(FILE *fp)
void PairZBL::write_data(FILE *fp)
{
  for (int i = 1; i <= atom->ntypes; i++)
    fprintf(fp,"%d %g\n",i,z[i]);
    fprintf(fp,"%d %g %g\n",i,z[i],z[i]);
}

/* ----------------------------------------------------------------------
Loading