correct pair coeff mixing diagnostic for CLASS2 pair styles

This commit is contained in:
Axel Kohlmeyer
2022-08-28 04:29:17 -04:00
parent be844dd9b7
commit 4bcd43ff90
4 changed files with 10 additions and 2 deletions

View File

@ -513,6 +513,7 @@ double PairLJClass2::init_one(int i, int j)
pow(sigma[j][j], 3.0) / (pow(sigma[i][i], 6.0) + pow(sigma[j][j], 6.0));
sigma[i][j] = pow((0.5 * (pow(sigma[i][i], 6.0) + pow(sigma[j][j], 6.0))), 1.0 / 6.0);
cut[i][j] = mix_distance(cut[i][i], cut[j][j]);
did_mix = true;
}
lj1[i][j] = 18.0 * epsilon[i][j] * pow(sigma[i][j], 9.0);

View File

@ -277,6 +277,7 @@ double PairLJClass2CoulCut::init_one(int i, int j)
sigma[i][j] = pow((0.5 * (pow(sigma[i][i], 6.0) + pow(sigma[j][j], 6.0))), 1.0 / 6.0);
cut_lj[i][j] = mix_distance(cut_lj[i][i], cut_lj[j][j]);
cut_coul[i][j] = mix_distance(cut_coul[i][i], cut_coul[j][j]);
did_mix = true;
}
double cut = MAX(cut_lj[i][j], cut_coul[i][j]);

View File

@ -711,6 +711,7 @@ double PairLJClass2CoulLong::init_one(int i, int j)
pow(sigma[j][j], 3.0) / (pow(sigma[i][i], 6.0) + pow(sigma[j][j], 6.0));
sigma[i][j] = pow((0.5 * (pow(sigma[i][i], 6.0) + pow(sigma[j][j], 6.0))), 1.0 / 6.0);
cut_lj[i][j] = mix_distance(cut_lj[i][i], cut_lj[j][j]);
did_mix = true;
}
double cut = MAX(cut_lj[i][j], cut_coul);

View File

@ -290,6 +290,11 @@ void Pair::init()
if (!manybody_flag && (comm->me == 0)) {
const int num_mixed_pairs = atom->ntypes * (atom->ntypes - 1) / 2;
// CLASS2 always applies sixthpower mixing to epsilon/sigma
if (utils::strmatch(force->pair_style,"^lj/class2"))
utils::logmesg(lmp,"Generated {} of {} mixed pair_coeff terms from {}/{} mixing rule\n",
mixed_count, num_mixed_pairs, "sixthpower", mixing_rule_names[mix_flag]);
else
utils::logmesg(lmp,"Generated {} of {} mixed pair_coeff terms from {} mixing rule\n",
mixed_count, num_mixed_pairs, mixing_rule_names[mix_flag]);
}