From b38033bc590a4131978b6eb1dfa957aed346552f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eugen=20Ro=C5=BEi=C4=87?= Date: Thu, 21 Feb 2019 01:07:46 +0100 Subject: [PATCH] Fixed bug in lammps_scatter_atoms_subset... - ids was ignored for the single-value integer arrays (e.g. type, id, ...) --- src/library.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/library.cpp b/src/library.cpp index 429dd14cd9..d8c55159a2 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1363,9 +1363,11 @@ void lammps_scatter_atoms_subset(void *ptr, char *name, int *dptr = (int *) data; if (count == 1) { - for (i = 0; i < ndata; i++) - if ((m = lmp->atom->map(i+1)) >= 0) + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0) vector[m] = dptr[i]; + } } else if (imgpack) { for (i = 0; i < ndata; i++) {