Unverified Commit e325c786 authored by Richard Berger's avatar Richard Berger Committed by GitHub
Browse files

Merge pull request #1101 from Pakketeretet2/bugfix-pair-morse-smooth-linear

Bugfix pair morse smooth linear
parents aea148a8 5003354f
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ using namespace LAMMPS_NS;
PairMorseSmoothLinear::PairMorseSmoothLinear(LAMMPS *lmp) : Pair(lmp)
{
  writedata = 1;

}

/* ---------------------------------------------------------------------- */
@@ -203,6 +202,14 @@ void PairMorseSmoothLinear::coeff(int narg, char **arg)
      alpha[i][j] = alpha_one;
      r0[i][j] = r0_one;
      cut[i][j] = cut_one;

      morse1[i][j] = 2.0*d0[i][j]*alpha[i][j];

      double alpha_dr = -alpha[i][j] * (cut[i][j] - r0[i][j]);

      offset[i][j]        = d0[i][j] * (exp(2.0*alpha_dr) - 2.0*exp(alpha_dr));
      der_at_cutoff[i][j] = -2.0*alpha[i][j]*d0[i][j] * (exp(2.0*alpha_dr) - exp(alpha_dr));

      setflag[i][j] = 1;
      count++;
    }
@@ -222,17 +229,13 @@ double PairMorseSmoothLinear::init_one(int i, int j)

  morse1[i][j] = 2.0*d0[i][j]*alpha[i][j];

  double alpha_dr = -alpha[i][j] * (cut[i][j] - r0[i][j]);

  offset[i][j]        = d0[i][j] * (exp(2.0*alpha_dr) - 2.0*exp(alpha_dr));
  der_at_cutoff[i][j] = -2.0*alpha[i][j]*d0[i][j] * (exp(2.0*alpha_dr) - exp(alpha_dr));

  d0[j][i] = d0[i][j];
  alpha[j][i] = alpha[i][j];
  r0[j][i] = r0[i][j];
  morse1[j][i] = morse1[i][j];
  der_at_cutoff[j][i] = der_at_cutoff[i][j];
  offset[j][i] = offset[i][j];
  cut[j][i] = cut[i][j];

  return cut[i][j];
}