fix bug in fix adapt: reinit must be called for the top-level pair/bond style

This commit is contained in:
Axel Kohlmeyer
2021-08-31 14:23:13 -04:00
parent 888d6fd9b4
commit c66a51bca1

View File

@ -612,23 +612,13 @@ void FixAdapt::change_settings()
// ditto for bond styles if any BOND settings were changed
// this resets other coeffs that may depend on changed values,
// and also offset and tail corrections
// we must call force->pair->reinit() instead of the individual
// adapted pair styles so that also the top-level
// tail correction values are updated for hybrid pair styles.
// same for bond styles
if (anypair) {
for (int m = 0; m < nadapt; m++) {
Adapt *ad = &adapt[m];
if (ad->which == PAIR) {
ad->pair->reinit();
}
}
}
if (anybond) {
for (int m = 0; m < nadapt; ++m) {
Adapt *ad = &adapt[m];
if (ad->which == BOND) {
ad->bond->reinit();
}
}
}
if (anypair) force->pair->reinit();
if (anybond) force->bond->reinit();
// reset KSpace charges if charges have changed