From 6760d0dd572dd04c48ef5c5d3cf4dbd081aa87b5 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 22 Jul 2014 22:52:38 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12196 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/dump_custom.cpp | 20 +++++++++++++++++++- src/dump_custom.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 860f084058..a65485883b 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -34,7 +34,7 @@ using namespace LAMMPS_NS; // customize by adding keyword // also customize compute_atom_property.cpp -enum{ID,MOL,TYPE,ELEMENT,MASS, +enum{ID,MOL,PROC,TYPE,ELEMENT,MASS, X,Y,Z,XS,YS,ZS,XSTRI,YSTRI,ZSTRI,XU,YU,ZU,XUTRI,YUTRI,ZUTRI, XSU,YSU,ZSU,XSUTRI,YSUTRI,ZSUTRI, IX,IY,IZ, @@ -451,6 +451,10 @@ int DumpCustom::count() for (i = 0; i < nlocal; i++) dchoose[i] = molecule[i]; ptr = dchoose; nstride = 1; + } else if (thresh_array[ithresh] == PROC) { + for (i = 0; i < nlocal; i++) dchoose[i] = me; + ptr = dchoose; + nstride = 1; } else if (thresh_array[ithresh] == TYPE) { int *type = atom->type; for (i = 0; i < nlocal; i++) dchoose[i] = type[i]; @@ -978,6 +982,9 @@ int DumpCustom::parse_fields(int narg, char **arg) error->all(FLERR,"Dumping an atom property that isn't allocated"); pack_choice[i] = &DumpCustom::pack_molecule; vtype[i] = INT; + } else if (strcmp(arg[iarg],"proc") == 0) { + pack_choice[i] = &DumpCustom::pack_proc; + vtype[i] = INT; } else if (strcmp(arg[iarg],"type") == 0) { pack_choice[i] = &DumpCustom::pack_type; vtype[i] = INT; @@ -1384,6 +1391,7 @@ int DumpCustom::modify_param(int narg, char **arg) if (strcmp(arg[1],"id") == 0) thresh_array[nthresh] = ID; else if (strcmp(arg[1],"mol") == 0) thresh_array[nthresh] = MOL; + else if (strcmp(arg[1],"proc") == 0) thresh_array[nthresh] = PROC; else if (strcmp(arg[1],"type") == 0) thresh_array[nthresh] = TYPE; else if (strcmp(arg[1],"mass") == 0) thresh_array[nthresh] = MASS; @@ -1683,6 +1691,16 @@ void DumpCustom::pack_molecule(int n) /* ---------------------------------------------------------------------- */ +void DumpCustom::pack_proc(int n) +{ + for (int i = 0; i < nchoose; i++) { + buf[n] = me; + n += size_one; + } +} + +/* ---------------------------------------------------------------------- */ + void DumpCustom::pack_type(int n) { int *type = atom->type; diff --git a/src/dump_custom.h b/src/dump_custom.h index 3d32a3fce6..794349515a 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -117,6 +117,7 @@ class DumpCustom : public Dump { void pack_id(int); void pack_molecule(int); + void pack_proc(int); void pack_type(int); void pack_mass(int);