handle one more case where allowing shifted potential with cutoff 0.0 would create NaNs
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user