From e0808bef81e28932d432bca62a3bc6bc2a26dff9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 24 Jul 2014 18:20:58 -0400 Subject: [PATCH] enabled using integer custom per atom data for dump_modify threshold --- src/dump_custom.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 35f6b1914c..f1cb9379fa 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -854,6 +854,17 @@ int DumpCustom::count() iwhich = atom->find_custom(id_custom[field2index[i]],tmp); ptr = atom->dvector[iwhich]; nstride = 1; + + } else if (thresh_array[ithresh] == INAME) { + int iwhich,tmp; + i = nfield + ithresh; + iwhich = atom->find_custom(id_custom[field2index[i]],tmp); + + int *ivector = atom->ivector[iwhich]; + for (i = 0; i < nlocal; i++) + dchoose[i] = ivector[i]; + ptr = dchoose; + nstride = 1; } // unselect atoms that don't meet threshhold criterion @@ -1685,8 +1696,22 @@ int DumpCustom::modify_param(int narg, char **arg) // must grow field2index and argindex arrays, since access is beyond nfield } else if (strncmp(arg[1],"i_",2) == 0) { - error->all(FLERR,"Using custom per-atom integer vectors " - "for dump_modify is not supported"); + thresh_array[nthresh] = INAME; + memory->grow(field2index,nfield+nthresh+1,"dump:field2index"); + memory->grow(argindex,nfield+nthresh+1,"dump:argindex"); + int n = strlen(arg[1]); + char *suffix = new char[n]; + strcpy(suffix,&arg[1][2]); + argindex[nfield+nthresh] = 0; + + int tmp = -1; + n = atom->find_custom(suffix,tmp); + if ((n < 0) || (tmp != 0)) + error->all(FLERR,"Could not find dump modify " + "custom atom integer property ID"); + + field2index[nfield+nthresh] = add_custom(suffix,0); + delete [] suffix; } else error->all(FLERR,"Invalid dump_modify threshhold operator");