add test whether drude particle was found locally and stop with error when not

this handles two cases:
1 the actual drude particle is not in the sub-domain
2 the drude particle was never assigned by fix drude
This commit is contained in:
Axel Kohlmeyer
2025-01-23 04:54:21 -05:00
parent 3e4a50fe63
commit 4be26c3480

View File

@ -192,6 +192,13 @@ void ComputeTempDrude::compute_vector()
kineng_core_loc += mtot_inv * ecore;
kineng_drude_loc += mtot_inv * mcore * mdrude * edrude;
}
if (j < 0) {
if (drudeid[i] == 0) {
error->one(FLERR, "Drude atom for core atom ID {} is not defined", atom->tag[i]);
} else {
error->one(FLERR, "Drude atom ID {} for core atom ID {} is out of range", drudeid[i],
atom->tag[i]);
}
}
}