From bbbde3cc15d2e4791f9232d881ce6d1544b2cc73 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 31 Oct 2021 16:18:32 -0400 Subject: [PATCH] fix indexing bug --- src/fix_vector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fix_vector.cpp b/src/fix_vector.cpp index 9066182ed1..1f6411c5bc 100644 --- a/src/fix_vector.cpp +++ b/src/fix_vector.cpp @@ -111,9 +111,9 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nvalues; i++) { if (which[i] == ArgInfo::COMPUTE) { Compute *compute = modify->compute[modify->find_compute(ids[i])]; - if (argindex[0] == 0) value = compute->extscalar; + if (argindex[i] == 0) value = compute->extscalar; else if (compute->extvector >= 0) value = compute->extvector; - else value = compute->extlist[argindex[0]-1]; + else value = compute->extlist[argindex[i]-1]; } else if (which[i] == ArgInfo::FIX) { Fix *fix = modify->fix[modify->find_fix(ids[i])]; if (argindex[i] == 0) value = fix->extvector;