Commit 00474ab0 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

handle one more case where allowing shifted potential with cutoff 0.0 would create NaNs

parent 733ea61b
Loading
Loading
Loading
Loading
+1 −1
Changes for src/USER-DRUDE/pair_lj_cut_thole_long.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -417,7 +417,7 @@ double PairLJCutTholeLong::init_one(int i, int j)
  lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
  lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);

  if (offset_flag) {
  if (offset_flag && (cut_lj[i][j] > 0.0)) {
    double ratio = sigma[i][j] / cut_lj[i][j];
    offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
  } else offset[i][j] = 0.0;
+0 −3
Changes for src/USER-MISC/pair_morse_smooth_linear.cpp: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -296,7 +296,6 @@ void PairMorseSmoothLinear::read_restart(FILE *fp)
void PairMorseSmoothLinear::write_restart_settings(FILE *fp)
{
  fwrite(&cut_global,sizeof(double),1,fp);
  // fwrite(&offset_flag,sizeof(int),1,fp);
  fwrite(&mix_flag,sizeof(int),1,fp);
}

@@ -308,11 +307,9 @@ void PairMorseSmoothLinear::read_restart_settings(FILE *fp)
{
  if (comm->me == 0) {
    fread(&cut_global,sizeof(double),1,fp);
    // fread(&offset_flag,sizeof(int),1,fp);
    fread(&mix_flag,sizeof(int),1,fp);
  }
  MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
  // MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
  MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}