be paranoid about invalid molecule templates

This commit is contained in:
Axel Kohlmeyer
2025-06-27 22:47:50 -04:00
parent 6b58058bca
commit c279d194dc

View File

@ -501,6 +501,8 @@ void FixPour::pre_exchange()
imol = 0;
while (rng > molfrac[imol]) imol++;
natom = onemols[imol]->natoms;
if (natom <= 0)
error->all(FLERR, "Invalid number of atoms ({}) in molecule {}", natom, onemols[imol]->id);
if (dimension == 3) {
r[0] = random->uniform() - 0.5;
r[1] = random->uniform() - 0.5;